From 4d8e769a6f85983f84ab08c429d20644f20697ae Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Mon, 28 Jul 2008 21:02:29 +0200 Subject: [PATCH] only consider packages when searching for unit tests --- runtests.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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: -- 2.26.2