Commit 634e1bc8 authored by Stefan Behnel's avatar Stefan Behnel

minor code cleanup

parent 31bb39f0
......@@ -1179,8 +1179,10 @@ class CythonPyregrTestCase(CythonRunTestCase):
run_forked_test(result, run_test, self.shortDescription(), self.fork)
include_debugger = IS_CPYTHON and sys.version_info[:2] > (2, 5)
def collect_unittests(path, module_prefix, suite, selectors, exclude_selectors):
def file_matches(filename):
return filename.startswith("Test") and filename.endswith(".py")
......@@ -1211,9 +1213,9 @@ def collect_unittests(path, module_prefix, suite, selectors, exclude_selectors):
if file_matches(f):
filepath = os.path.join(dirpath, f)[:-len(".py")]
modulename = module_prefix + filepath[len(path)+1:].replace(os.path.sep, '.')
if not [ 1 for match in selectors if match(modulename) ]:
if not any(1 for match in selectors if match(modulename)):
continue
if [ 1 for match in exclude_selectors if match(modulename) ]:
if any(1 for match in exclude_selectors if match(modulename)):
continue
module = __import__(modulename)
for x in modulename.split('.')[1:]:
......@@ -1221,7 +1223,6 @@ def collect_unittests(path, module_prefix, suite, selectors, exclude_selectors):
suite.addTests([loader.loadTestsFromModule(module)])
def collect_doctests(path, module_prefix, suite, selectors, exclude_selectors):
def package_matches(dirname):
if dirname == 'Debugger' and not include_debugger:
......
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