1
0
mirror of https://github.com/django/django.git synced 2025-10-25 22:56:12 +00:00

Fixed #21206 -- Fixed test discovery without labels

Added test to verify an empty label performs discovery on the current
working directory.
This commit is contained in:
Preston Timmons
2013-12-31 11:41:34 -06:00
committed by Claude Paroz
parent fbbe7ca30c
commit 18d962f2e6
2 changed files with 28 additions and 12 deletions

View File

@@ -154,10 +154,12 @@ class DiscoverRunner(object):
def is_discoverable(label):
"""
Check if a test label points to a python package or file directory.
Relative labels like "." and ".." are seen as directories.
"""
try:
mod = import_module(label)
except ImportError:
except (ImportError, TypeError):
pass
else:
return hasattr(mod, '__path__')