From: Stefan Behnel Date: Mon, 28 Jul 2008 19:02:29 +0000 (+0200) Subject: only consider packages when searching for unit tests X-Git-Tag: 0.9.8.1~108^2~3 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=4d8e769a6f85983f84ab08c429d20644f20697ae;p=cython.git only consider packages when searching for unit tests --- diff --git a/runtests.py b/runtests.py index 5310dd7a..bb5487a5 100644 --- a/runtests.py +++ b/runtests.py @@ -287,7 +287,18 @@ def collect_unittests(path, suite, selectors): loader = unittest.TestLoader() + skipped_dirs = [] + for dirpath, dirnames, filenames in os.walk(path): + if dirpath != path and "__init__.py" not in filenames: + skipped_dirs.append(dirpath + os.path.sep) + continue + skip = False + for dir in skipped_dirs: + if dirpath.startswith(dir): + skip = True + if skip: + continue parentname = os.path.split(dirpath)[-1] if package_matches(parentname): for f in filenames: