From 7366feb46f25d07c60d1fcaa941f8d0613dbd764 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 31 Dec 2022 07:16:48 -0500 Subject: test: add a test of unknown dynamic-context --- tests/test_api.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/test_api.py') diff --git a/tests/test_api.py b/tests/test_api.py index ee24aa8f..6b53b05d 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -706,6 +706,12 @@ class ApiTest(CoverageTest): cov.stop() # pragma: nested assert_coverage_warnings(warns, "Conflicting dynamic contexts (dynamic-conflict)") + def test_unknown_dynamic_context(self): + cov = coverage.Coverage() + cov.set_option("run:dynamic_context", "no-idea") + with pytest.raises(Exception, match="Don't understand dynamic_context setting: 'no-idea'"): + cov.start() + def test_switch_context_unstarted(self): # Coverage must be started to switch context msg = "Cannot switch context, coverage is not started" -- cgit v1.2.1