|
@@ -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'],
|