diff options
| author | Claude Paroz <claude@2xlibre.net> | 2014-02-26 17:43:14 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2014-02-26 17:46:24 +0100 |
| commit | 4622d23ccf50a72432ff0c7416a4d6e0789c4f0b (patch) | |
| tree | 5a16d4af7e8d2c750c9343994899ad7524842540 /tests | |
| parent | 2bab9d6d9ea095c4bcaeede2df576708afd46291 (diff) | |
Fixed #22056 -- Omitted non-package directories when collecting tests
This allows us to ignore empty dirs or other unrelated dirs.
Thanks Sebastian PawluĊ for the report and the initial patch.
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/runtests.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/tests/runtests.py b/tests/runtests.py index 996aa2a84b..85a73d2e5c 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -25,10 +25,7 @@ TEMP_DIR = tempfile.mkdtemp(prefix='django_') os.environ['DJANGO_TEST_TEMP_DIR'] = TEMP_DIR SUBDIRS_TO_SKIP = [ - 'coverage_html', 'data', - 'requirements', - 'templates', 'test_discovery_sample', 'test_discovery_sample2', 'test_runner_deprecation_app', @@ -70,11 +67,10 @@ def get_test_modules(): for modpath, dirpath in discovery_paths: for f in os.listdir(dirpath): if ('.' in f or - # Python 3 byte code dirs (PEP 3147) - f == '__pycache__' or f.startswith('sql') or os.path.basename(f) in SUBDIRS_TO_SKIP or - os.path.isfile(f)): + os.path.isfile(f) or + not os.path.exists(os.path.join(dirpath, f, '__init__.py'))): continue modules.append((modpath, f)) return modules |
