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:
committed by
Claude Paroz
parent
fbbe7ca30c
commit
18d962f2e6
@@ -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__')
|
||||
|
||||
Reference in New Issue
Block a user