Source

pygame / test / image__save_gl_surface_test.py

Diff from to

File test/image__save_gl_surface_test.py

-import test_utils
-import test.unittest as unittest
+if __name__ == '__main__':
+    import sys
+    import os
+    pkg_dir = os.path.split(os.path.abspath(__file__))[0]
+    parent_dir, pkg_name = os.path.split(pkg_dir)
+    is_pygame_pkg = (pkg_name == 'tests' and
+                     os.path.split(parent_dir)[1] == 'pygame')
+    if not is_pygame_pkg:
+        sys.path.insert(0, parent_dir)
+else:
+    is_pygame_pkg = __name__.startswith('pygame.tests.')
 
+if is_pygame_pkg:
+    from pygame.tests import test_utils
+    from pygame.tests.test_utils import unittest
+else:
+    from test import test_utils
+    from test.test_utils import unittest
 import pygame, os
 from pygame.locals import *
 
         
         pygame.display.quit()
 if __name__ == '__main__': 
-    unittest.main()
+    unittest.main()