Commit d0b9ed0e authored by Stefan Behnel's avatar Stefan Behnel

simplify evaluation of --cython-only option in test runner

parent 687d8404
...@@ -746,7 +746,8 @@ class CythonRunTestCase(CythonCompileTestCase): ...@@ -746,7 +746,8 @@ class CythonRunTestCase(CythonCompileTestCase):
self.success = False self.success = False
self.runCompileTest() self.runCompileTest()
failures, errors = len(result.failures), len(result.errors) 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): if failures == len(result.failures) and errors == len(result.errors):
# No new errors... # No new errors...
self.success = True self.success = True
...@@ -761,8 +762,7 @@ class CythonRunTestCase(CythonCompileTestCase): ...@@ -761,8 +762,7 @@ class CythonRunTestCase(CythonCompileTestCase):
pass pass
def run_tests(self, result): 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_doctests(self, module_name, result):
def run_test(result): def run_test(result):
...@@ -926,8 +926,7 @@ class CythonUnitTestCase(CythonRunTestCase): ...@@ -926,8 +926,7 @@ class CythonUnitTestCase(CythonRunTestCase):
return "compiling (%s) tests in %s" % (self.language, self.module) return "compiling (%s) tests in %s" % (self.language, self.module)
def run_tests(self, result): 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): class CythonPyregrTestCase(CythonRunTestCase):
...@@ -960,8 +959,6 @@ class CythonPyregrTestCase(CythonRunTestCase): ...@@ -960,8 +959,6 @@ class CythonPyregrTestCase(CythonRunTestCase):
self.run_doctests(module, result) self.run_doctests(module, result)
def run_tests(self, result): def run_tests(self, result):
if self.cython_only:
return
try: try:
from test import support from test import support
except ImportError: # Python2.x except ImportError: # Python2.x
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment