Commits

Anonymous committed 89a1c91

Added a redirect stderr/stdout mode to test runner. Only output unittest results and not test noise

  • Participants
  • Parent commits 612c224

Comments (0)

Files changed (54)

File async_sub.py

             #http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/347462
             
             """kill function for Win32"""
-            try:
+            # try:
                 # This works as well
-                # win32api.TerminateProcess(int(self._handle), 0)
+            
+            win32api.TerminateProcess(int(self._handle), 0) # returns None
                                            # handle,  # exit code
 
-                handle = win32api.OpenProcess(1, 0, self.pid)
-                try:
-                    win32api.TerminateProcess(handle, 0)
-                finally:
-                    win32api.CloseHandle(handle)
-            except win32api.error:
-                return False
-            return True
+            #     handle = win32api.OpenProcess(1, 0, self.pid)
+            #     try:
+            #         win32api.TerminateProcess(handle, 0)
+            #     finally:
+            #         win32api.CloseHandle(handle)
+            # except win32api.error:
+            #     return False
+            # return True
 
         def send(self, input):
             if not self.stdin:
             # zero); the high bit of the low byte is set if a core
             # file was produced. Availability: Macintosh, Unix.
 
-            try:
-                for i, sig in enumerate([SIGTERM, SIGKILL] * 2):
-                    if i % 2 == 0: os.kill(self.pid, sig)
-                    time.sleep((i * (i % 2) / 5.0)  + 0.01)
+            # try:
 
-                    killed_pid, stat = os.waitpid(self.pid, os.WNOHANG)
-                    # print (i, killed_pid, stat)
+            for i, sig in enumerate([SIGTERM, SIGKILL] * 2):
+                if i % 2 == 0: os.kill(self.pid, sig)
+                time.sleep((i * (i % 2) / 5.0)  + 0.01)
 
-                    if killed_pid != 0: return True  # ???
-            except OSError:
-                pass
+                killed_pid, stat = os.waitpid(self.pid, os.WNOHANG)
+                # print (i, killed_pid, stat)
 
-            return False
+                if killed_pid != 0: return #True  # ???
+
+            # except OSError:
+            #     pass
+
+            # return False
 
         def send(self, input):
             if not self.stdin:
         response += [proc.read_async(wait=0.1, e=0)]
 
     if ret_code is None:
-        proc.kill()
-        ret_code = '"Process timed out (time_out = %s secs)"' % time_out
+        ret_code = '"Process timed out (time_out = %s secs) ' % time_out
+        try:
+            proc.kill()
+            ret_code += 'and was successfully terminated"'
+        except (win32api.error, OSError), e:
+            ret_code += 'and termination failed (exception: %s)"' % e
 
     return ret_code, ''.join(response)
 
         ret_code, response = proc_in_time_or_kill(
             [sys.executable, '-c', 'while 1: pass'], time_out = 1
         )
-        self.assert_( ret_code.startswith('"Process timed out') )
+        
+        self.assert_( 'rocess timed out' in ret_code )
+        self.assert_( 'successfully terminated' in ret_code )
 
 ################################################################################
 

File run_tests.py

      help   = "fail incomplete tests (only single process mode)" )
 
 opt_parser.add_option (
+     "-r",  "--redirect", action = 'store_true',
+     help   = "redirect stderr/stdio, print only test results" )
+
+opt_parser.add_option (
      "-s",  "--subprocess", action = 'store_true',
      help   = "run test suites in subprocesses (default: same process)" )
 
 # this is used for testing subprocess output against single process mode
 
 if options.fake:
+    os.environ.update({"PYTHONPATH" : test_subdir})
     test_subdir = os.path.join(fake_test_subdir, options.fake )
     sys.path.append(test_subdir)
 
 #
 
 if not options.subprocess:
+    ## INITIATE TEST SUITE
     suite = unittest.TestSuite()
-    runner = unittest.TextTestRunner()
-        
+    if options.redirect: test_out, runner = test_utils.StringIO_TextTestRunner()
+    else: runner = unittest.TextTestRunner()
+
+    ## LOAD THE TEST MODULES AND COMPILE TESTS
     for module in [m for m in test_modules if m not in IGNORE]:
         print 'loading ' + module
         __import__( module )
         test = unittest.defaultTestLoader.loadTestsFromName( module )
         suite.addTest( test )
     
+    ## REDIRECT STDERR, STDOUT
+    if options.redirect:
+        (stderr, stdout), redirected = test_utils.redirect_io()
+
+    ## GET OPTIONS AND RUN THE TESTS    
     test_utils.fail_incomplete_tests = options.incomplete
-    if options.verbose:
-        runner.verbosity = 2
-    
+    if options.verbose: runner.verbosity = 2
     runner.run( suite )
-    
-    sys.exit()
+
+    ## RETURN STDERR, STDOUT
+    if options.redirect:
+        sys.stderr, sys.stdout = stderr, stdout
+        test_out.seek(0)
+        sys.stderr.write(test_out.read())
+        # redirected has anything >> stderr | stdout
 
     ###########################
     # SYS.EXIT() FLOW CONTROL #
     ###########################
+    sys.exit()
 
 ################################################################################
 # Runs an individual xxxx_test.py test suite in a subprocess
 ################################################################################
 # Run all the tests in subprocesses
 #
-
 flags = []
+if options.redirect: flags += ['-r']
 test_cmds = [ 
     (m, [options.python, os.path.join(test_subdir, '%s.py' % m)] + flags)
         for m in test_modules if  m not in SUBPROCESS_IGNORE 
 ]
 
-
 t = time.time()
 
 if options.multi_thread:
 ################################################################################
 # Combine subprocessed TextTestRunner() results to mimick single run
 # Puts complete failures in a form the build page will pick up
+#
+# NOTE: regexes will possibly fail if tests are noisy on stdout or stderr
+#       so use -r --redirect io option when using subprocess
 
 all_dots = ''
 failures = []
     all_dots += dots
 
     if 'E' in dots or 'F' in dots:
-        failure = ret[len(dots):].split(RAN_TESTS_DIV)[0]
+        failure = ret[len(dots)+1:].split(RAN_TESTS_DIV)[0]
         failures.append (
             failure.replace( "(__main__.", "(%s." % module)
         )

File test/base_test.py

 
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/blit_test.py

-import unittest
+import unittest, test_utils
 import pygame
 from pygame.locals import *
 
 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/bufferproxy_test.py

 ################################################################################
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/cdrom_test.py

 ################################################################################
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/color_test.py

 ################################################################################
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/cursors_test.py

 ################################################################################
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/display_test.py

             #pygame.quit()
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/draw_test.py

 ################################################################################
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/event_test.py

 ################################################################################
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/fastevent_test.py

 ################################################################################
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/font_test.py

         self.assert_(test_not_implemented()) 
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/image__save_gl_surface_test.py

         
         pygame.display.quit()
 if __name__ == '__main__': 
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/image_test.py

         self.assert_(test_not_implemented()) 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/joystick_test.py

 ################################################################################
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/key_test.py

 
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/mask_test.py

 if __name__ == '__main__':
 
     if 1:
-        test_utils.get_fail_incomplete_tests_option()
-        unittest.main()
+        test_utils.get_command_line_options()
+        #unittest.main()()
     else:
         mask_from_surface = maskFromSurface
 

File test/mixer_test.py

 ##################################### MAIN #####################################
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/mouse_test.py

 ################################################################################
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/movie_test.py

         self.assert_(test_not_implemented()) 
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/overlay_test.py

 ################################################################################
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/pixelarray_test.py

         #print "extract end"
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/rect_test.py

         self.assertRaises(ValueError, rect_list.remove, r2)
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/run_tests__tests/all_ok/fake_2_test.py

-import unittest
+import unittest, test_utils
 
 class KeyModuleTest(unittest.TestCase):
     def test_get_focused(self):
         self.assert_(True) 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()

File test/run_tests__tests/all_ok/fake_3_test.py

-import unittest
+import unittest, test_utils
 
 class KeyModuleTest(unittest.TestCase):
     def test_get_focused(self):
         self.assert_(True) 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()

File test/run_tests__tests/all_ok/fake_4_test.py

-import unittest
+import unittest, test_utils
 
 class KeyModuleTest(unittest.TestCase):
     def test_get_focused(self):
         self.assert_(True) 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()

File test/run_tests__tests/all_ok/fake_5_test.py

-import unittest
+import unittest, test_utils
 
 class KeyModuleTest(unittest.TestCase):
     def test_get_focused(self):
         self.assert_(True) 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()

File test/run_tests__tests/all_ok/fake_6_test.py

-import unittest
+import unittest, test_utils
 
 class KeyModuleTest(unittest.TestCase):
     def test_get_focused(self):
         self.assert_(True) 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()

File test/run_tests__tests/all_ok/no_assertions(ret_code_of_1)_test.py

-import unittest
+import unittest, test_utils
 
 class KeyModuleTest(unittest.TestCase):
     def test_get_focused(self):
         pass
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()

File test/run_tests__tests/all_ok/zero_tests_test.py

-import unittest
+import unittest, test_utils
 
 class KeyModuleTest(unittest.TestCase):
     pass
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()

File test/run_tests__tests/failures1/fake_2_test.py

-import unittest
+import unittest, test_utils
 
 class KeyModuleTest(unittest.TestCase):
     def test_get_focused(self):
         self.assert_(True) 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()

File test/run_tests__tests/failures1/fake_3_test.py

-import unittest
+import unittest, test_utils
 
 class KeyModuleTest(unittest.TestCase):
     def test_get_focused(self):
         self.assert_(True) 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()

File test/run_tests__tests/failures1/fake_4_test.py

-import unittest
+import unittest, test_utils
 
 class KeyModuleTest(unittest.TestCase):
     def test_get_focused(self):
         self.assert_(True) 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()

File test/run_tests__tests/infinite_loop/fake_1_test.py

-import unittest
+import unittest, test_utils
 
 class KeyModuleTest(unittest.TestCase):
     def test_get_focused(self):
         self.assert_(True) 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()

File test/run_tests__tests/infinite_loop/fake_2_test.py

-import unittest
+import unittest, test_utils
 
 class KeyModuleTest(unittest.TestCase):
     def test_get_focused(self):
         self.assert_(True) 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()

File test/run_tests__tests/print_stderr/fake_2_test.py

-import unittest
+import unittest, test_utils
 
 class KeyModuleTest(unittest.TestCase):
     def test_get_focused(self):
         self.assert_(True) 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()

File test/run_tests__tests/print_stderr/fake_3_test.py

-import unittest, sys
+import unittest, test_utils
 
 class KeyModuleTest(unittest.TestCase):
     def test_get_focused(self):
 
     def test_name(self):
         print >> sys.stderr, 'jibberish messes things up'
-        self.assert_(False) 
+        self.assert_(False)
 
     def test_set_mods(self):
         self.assert_(True) 
         self.assert_(True) 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()

File test/run_tests__tests/print_stderr/fake_4_test.py

-import unittest
+import unittest, test_utils
 
 class KeyModuleTest(unittest.TestCase):
     def test_get_focused(self):
         self.assert_(True) 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()

File test/run_tests__tests/print_stdout/fake_2_test.py

-import unittest
+import unittest, test_utils
 
 class KeyModuleTest(unittest.TestCase):
     def test_get_focused(self):
         self.assert_(True) 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()

File test/run_tests__tests/print_stdout/fake_3_test.py

-import unittest, sys
+import unittest, test_utils
 
 class KeyModuleTest(unittest.TestCase):
     def test_get_focused(self):
         self.assert_(True) 
 
     def test_get_pressed(self):
+        print 'jibberish ruins everything'
         self.assert_(True) 
 
     def test_name(self):
-        print 'jibberish messes things up'
-        self.assert_(False) 
+        print 'forgot to remove debug crap'
+        self.assert_(True) 
 
     def test_set_mods(self):
         self.assert_(True) 
         self.assert_(True) 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()

File test/run_tests__tests/print_stdout/fake_4_test.py

-import unittest
+import unittest, test_utils
 
 class KeyModuleTest(unittest.TestCase):
     def test_get_focused(self):
         self.assert_(True) 
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()

File test/run_tests__tests/run_tests__test.py

 
 def call_proc(cmd, cd=None):
     proc = subprocess.Popen (
-        cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd = cd,
+        cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd = cd,
 	universal_newlines = True,
     )
     assert not proc.wait()
-    return proc.stdout.read() + proc.stderr.read()
+    return proc.stdout.read()
 
 ################################################################################
 
 main_dir  = os.path.split(os.path.abspath(sys.argv[0]))[0]
 trunk_dir = os.path.normpath(os.path.join(main_dir, '../../'))
 
+os.environ.update({"PYTHONPATH" : os.path.join(trunk_dir, 'test')})
+
 test_suite_dirs = [x for x in os.listdir(main_dir) 
                            if os.path.isdir(os.path.join(main_dir, x))
                            and x not in IGNORE ]
 # Test that output is the same in single process and subprocess modes 
 #
 
-cmd = [sys.executable, 'run_tests.py', '-f']
-sub_cmd = [sys.executable, 'run_tests.py', '-s', '-f']
+cmd = [sys.executable, 'run_tests.py', '-r', '-f']
+sub_cmd = [sys.executable, 'run_tests.py', '-r', '-s', '-f']
 
 time_out_cmd = [
     sys.executable, 'run_tests.py', '-t', '4', '-s', '-f', 'infinite_loop',
     else:
         passes += 1
         print '%s suite comparison OK' % suite
-    
+
     if verbose or failed:
         print "difflib.Differ().compare(single, suprocessed):\n"
         print ''.join ( list(
 
 print "\n-h for help"
 
-################################################################################
+################################################################################

File test/scrap_test.py

         self.assertEquals (r, "buf")
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
+    test_utils.get_command_line_options()
 
     #TODO....
     pygame.init ()
     pygame.display.set_mode ((1, 1))
     scrap.init ()
-    unittest.main()
+    #unittest.main()()

File test/sndarray_test.py

 
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/sprite_test.py

 ################################################################################
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/surface_test.py

           # Surface.get_locked(): return bool
           # test if the Surface is current locked
 
-        self.assert_(test_not_implemented()) 
+        self.assert_(test_not_implemented())
 
     def test_get_locks(self):
 
           # Surface.get_rect(**kwargs): return Rect
           # get the rectangular area of the Surface
 
-        self.assert_(test_not_implemented()) 
+        self.assert_(test_not_implemented())
 
     def test_get_shifts(self):
 
 
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/surfarray_test.py

 
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/surflock_test.py

-import unittest, sys
+import unittest, sys, test_utils
 import pygame
 
 class SurfaceLockTest (unittest.TestCase):
         #print "test_surfarray_ref - end"
 
 if __name__ == '__main__':
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/sysfont_test.py

 ################################################################################
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/test_utils.py

 #################################### IMPORTS ###################################
 
-import tempfile, sys, pygame
+import tempfile, sys, pygame, unittest, StringIO
 
 ############################### INCOMPLETE TESTS ###############################
 
 def test_not_implemented():
     return not fail_incomplete_tests
 
-def get_fail_incomplete_tests_option():
+def check_option(*args):
+    # Remove the flags or it will mess up unittest cmd line arg parser
+    for arg in args:
+        if arg in sys.argv:
+            del sys.argv[sys.argv.index(arg)]
+            return True
+
+def get_command_line_options():
     global fail_incomplete_tests
-
-    for arg in "--incomplete", "-i":
-        if  arg in sys.argv:
-
-            # Remove the flag or it will mess up unittest cmd line arg parser
-            del sys.argv[sys.argv.index(arg)]
-            
-            fail_incomplete_tests = 1
-            return
+    if check_option("--incomplete", "-i"):  fail_incomplete_tests = 1
+    if check_option("--redirect", "-r"):    low_noise_test()
+    else: unittest.main()
 
 ################################## TEMP FILES ##################################
 
 def get_tmp_dir():
     return tempfile.mkdtemp()
+
+############################# UNITTEST EXTENSIONS ##############################
+
+REDIRECT_DIVISION = "<[[! MULTIPLEXED UNITTEST, STDERR, STDOUT STARTS HERE !]]>"
+
+class Redirect(StringIO.StringIO):
+    def write(self, val):
+        sys.stdout.write(val)
+        StringIO.StringIO.write(self, val)
         
+def StringIO_TextTestRunner():
+    test_out = Redirect()
+    runner = unittest.TextTestRunner(stream=test_out)
+    return test_out, runner
+
+def redirect_io():
+    yield sys.stderr, sys.stdout
+    sys.stderr = sys.stdout = StringIO.StringIO()
+    yield sys.stdout
+
+class Main(unittest.main):
+    def runTests(self):
+        self.testRunner.run(self.test)
+
+def low_noise_test(exit=True):
+    (oerr, oout), rerr_out = redirect_io()
+
+    test_out, runner = StringIO_TextTestRunner()
+    Main(testRunner = runner)
+
+    sys.stderr, sys.stdout = oerr, oout
+
+    test_out.seek(0)
+    # rerr_out.seek(0)
+
+    sys.stderr.write(test_out.read())          # unittest
+    # print REDIRECT_DIVISION
+    # sys.stdout.write(rerr_out.read())        # unittest, stderr, stdout
+
+    if exit: sys.exit()
+
 #################################### HELPERS ###################################
 
 def rgba_between(value, minimum=0, maximum=255):
         (0, 1)                                  # bl -> tl
     ]
         
-    return 'Tests: OK'
+    print 'Tests: OK'
+
 if __name__ == '__main__':
-    print helpers_test()
+    helpers_test()
 
 ################################################################################

File test/threads_test.py

 ################################################################################
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/time_test.py

 ################################################################################
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()

File test/transform_test.py

         self.assert_(test_not_implemented()) 
 
     def test_rotate(self):
+        
         # __doc__ (as of 2008-06-25) for pygame.transform.rotate:
 
           # pygame.transform.rotate(Surface, angle): return Surface
           # rotate an image
+        
+        self.assert_(test_not_implemented()) 
+        
+        # color = (128, 128, 128, 255)
+        # s = pygame.Surface((3, 3))
+        
+        # s.set_at((2, 0), color)
 
-        self.assert_(test_not_implemented())
+        # self.assert_(s.get_at((0, 0)) != color)
+        # s = pygame.transform.rotate(s, 90)
+        # self.assert_(s.get_at((0, 0)) == color)
 
     def test_rotate__lossless_at_90_degrees(self):
         w, h = 32, 32
 
         for pt, color in gradient: s.set_at(pt, color)
 
-        for rotation in (90, -90): 
+        for rotation in (90, -90):
             s = pygame.transform.rotate(s,rotation)
 
         for pt, color in gradient:
         self.assert_(test_not_implemented()) 
 
 if __name__ == '__main__':
-    test_utils.get_fail_incomplete_tests_option()
-    unittest.main()
+    test_utils.get_command_line_options()
+    #unittest.main()()