simplify evaluation of --cython-only option in test runner
authorStefan Behnel <stefan_ml@behnel.de>
Sat, 23 Feb 2013 09:20:45 +0000 (10:20 +0100)
committerStefan Behnel <stefan_ml@behnel.de>
Sat, 23 Feb 2013 09:20:45 +0000 (10:20 +0100)
runtests.py

index e7dba67..5979bac 100755 (executable)
@@ -746,7 +746,8 @@ class CythonRunTestCase(CythonCompileTestCase):
                 self.success = False
                 self.runCompileTest()
                 failures, errors = len(result.failures), len(result.errors)
-                self.run_tests(result)
+                if not self.cython_only:
+                    self.run_tests(result)
                 if failures == len(result.failures) and errors == len(result.errors):
                     # No new errors...
                     self.success = True
@@ -761,8 +762,7 @@ class CythonRunTestCase(CythonCompileTestCase):
             pass
 
     def run_tests(self, result):
-        if not self.cython_only:
-            self.run_doctests(self.module, result)
+        self.run_doctests(self.module, result)
 
     def run_doctests(self, module_name, result):
         def run_test(result):
@@ -926,8 +926,7 @@ class CythonUnitTestCase(CythonRunTestCase):
         return "compiling (%s) tests in %s" % (self.language, self.module)
 
     def run_tests(self, result):
-        if not self.cython_only:
-            unittest.defaultTestLoader.loadTestsFromName(self.module).run(result)
+        unittest.defaultTestLoader.loadTestsFromName(self.module).run(result)
 
 
 class CythonPyregrTestCase(CythonRunTestCase):
@@ -960,8 +959,6 @@ class CythonPyregrTestCase(CythonRunTestCase):
         self.run_doctests(module, result)
 
     def run_tests(self, result):
-        if self.cython_only:
-            return
         try:
             from test import support
         except ImportError: # Python2.x