diff --git a/test/meson.build b/test/meson.build index 2ef78899bf..d789ad01e0 100644 --- a/test/meson.build +++ b/test/meson.build @@ -50,6 +50,7 @@ test_files = files( 'time_test.py', 'touch_test.py', 'transform_test.py', + 'typing_test.py', 'version_test.py', 'video_test.py', 'window_test.py', diff --git a/test/typing_test.py b/test/typing_test.py new file mode 100644 index 0000000000..46fd4d29c3 --- /dev/null +++ b/test/typing_test.py @@ -0,0 +1,26 @@ +import unittest + +# A basic unit test to test that pygame.typing can import in python code, and +# the documented attributes are accessible. +# More rigorous testing needs mypy and is therefore implemented in the stubs +# directory. +TYPING_PUBLIC_ATTRS = [ + "RectLike", + "SequenceLike", + "FileLike", + "ColorLike", + "Point", + "IntPoint", +] + + +class TypingTest(unittest.TestCase): + def test_typing_has_attrs(self): + import pygame.typing + + for i in TYPING_PUBLIC_ATTRS: + self.assertTrue(hasattr(pygame.typing, i)) + + +if __name__ == "__main__": + unittest.main()