1. pygame
  2. Untitled project
  3. pygame

Commits

pygame  committed e6ad637

unit test and rect fixes

  • Participants
  • Parent commits 3966829
  • Branches default

Comments (0)

Files changed (1)

File test/base_test.py

View file
+
+import unittest, pygame
+
+
+init_called = quit_called = 0
+def __PYGAMEinit__(): #called automatically by pygame.init()
+    global init_called
+    init_called = init_called + 1
+    pygame.register_quit(pygame_quit)
+def pygame_quit():
+    global quit_called
+    quit_called = quit_called + 1
+
+
+
+class BaseTest(unittest.TestCase):
+    def testAutoInit(self):
+        pygame.init()
+        pygame.quit()
+        self.assertEqual(init_called, 1)
+        self.assertEqual(quit_called, 1)
+
+
+
+if __name__ == '__main__':
+    unittest.main()