From dd98bb1ebb687e4ff22e255ee97ec8e8cca5e1f6 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 1 Sep 2019 21:34:20 -0400 Subject: Reporting methods shouldn't permanently change the configuration --- tests/test_api.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/test_api.py b/tests/test_api.py index 301257dc..4f248441 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -918,3 +918,14 @@ class TestRunnerPluginTest(CoverageTest): def test_pytestcov_parallel_append(self): self.pretend_to_be_pytestcov(append=True) + + +class ImmutableConfigTest(CoverageTest): + """Check that reporting methods don't permanently change the configuration.""" + def test_config_doesnt_change(self): + self.make_file("simple.py", "a = 1") + cov = coverage.Coverage() + self.start_import_stop(cov, "simple") + self.assertEqual(cov.get_option("report:show_missing"), False) + cov.report(show_missing=True) + self.assertEqual(cov.get_option("report:show_missing"), False) -- cgit v1.2.1