mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Fixed #32532 -- Made DiscoverRunner raise RuntimeError when a test label is a file path.
This commit is contained in:
parent
0af81b22b5
commit
a89e975caf
2 changed files with 17 additions and 0 deletions
|
@ -47,6 +47,16 @@ class DiscoverRunnerTests(SimpleTestCase):
|
|||
ns = parser.parse_args(["--debug-mode"])
|
||||
self.assertTrue(ns.debug_mode)
|
||||
|
||||
def test_load_tests_for_label_file_path(self):
|
||||
with change_cwd('.'):
|
||||
msg = (
|
||||
"One of the test labels is a path to a file: "
|
||||
"'test_discover_runner.py', which is not supported. Use a "
|
||||
"dotted module name instead."
|
||||
)
|
||||
with self.assertRaisesMessage(RuntimeError, msg):
|
||||
DiscoverRunner().load_tests_for_label('test_discover_runner.py', {})
|
||||
|
||||
def test_dotted_test_module(self):
|
||||
count = DiscoverRunner().build_suite(
|
||||
['test_runner_apps.sample.tests_sample'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue