From f46452638885d89cacfca6831e0b9982c87b6527 Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Mon, 9 Dec 2019 11:12:06 +0100 Subject: [PATCH] Refs #30676 -- Added test for invalid --pdb and --parallel usage in DiscoverRunner. --- tests/test_runner/test_discover_runner.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_runner/test_discover_runner.py b/tests/test_runner/test_discover_runner.py index 160f174b76..2334fe6b7f 100644 --- a/tests/test_runner/test_discover_runner.py +++ b/tests/test_runner/test_discover_runner.py @@ -261,6 +261,14 @@ class DiscoverRunnerTests(SimpleTestCase): runner.build_suite(['test_runner_apps.tagged.tests']) self.assertIn('Excluding test tag(s): bar, foo.\n', stdout.getvalue()) + def test_pdb_with_parallel(self): + msg = ( + 'You cannot use --pdb with parallel tests; pass --parallel=1 to ' + 'use it.' + ) + with self.assertRaisesMessage(ValueError, msg): + DiscoverRunner(pdb=True, parallel=2) + class DiscoverRunnerGetDatabasesTests(SimpleTestCase): runner = DiscoverRunner(verbosity=2)