summaryrefslogtreecommitdiff
path: root/tests/test_runner
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_runner')
-rw-r--r--tests/test_runner/test_discover_runner.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_runner/test_discover_runner.py b/tests/test_runner/test_discover_runner.py
index 6b19f2f274..c9105989fa 100644
--- a/tests/test_runner/test_discover_runner.py
+++ b/tests/test_runner/test_discover_runner.py
@@ -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'],