diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2022-12-31 07:16:48 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2022-12-31 07:16:48 -0500 |
commit | 7366feb46f25d07c60d1fcaa941f8d0613dbd764 (patch) | |
tree | d856694623f82ba6056ae1e0373d2226501a1263 | |
parent | e2e893a0c07dee0556b8ea185b3db0987c4762e1 (diff) | |
download | python-coveragepy-git-7366feb46f25d07c60d1fcaa941f8d0613dbd764.tar.gz |
test: add a test of unknown dynamic-context
-rw-r--r-- | tests/test_api.py | 6 |
1 files changed, 6 insertions, 0 deletions
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" |