diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-02-08 12:25:08 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-02-08 12:25:08 -0500 |
commit | 04c1a2491307fc1c42b6c5aa2bf24b454a8d7154 (patch) | |
tree | 9c24aaac0d0b75b68bd717a77723f52313067253 /tests/test_plugins.py | |
parent | c16eb3ec0d917d8f5c6320a01ea6965665a1f607 (diff) | |
download | python-coveragepy-git-04c1a2491307fc1c42b6c5aa2bf24b454a8d7154.tar.gz |
Test omitted plugin-measured files.
Diffstat (limited to 'tests/test_plugins.py')
-rw-r--r-- | tests/test_plugins.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/tests/test_plugins.py b/tests/test_plugins.py index 190096bd..9f56c6d5 100644 --- a/tests/test_plugins.py +++ b/tests/test_plugins.py @@ -257,9 +257,12 @@ class FileTracerTest(CoverageTest): assert helper(42) == 43 assert render("bar_4.html", 2) == "[bar_4.html @ 2]" assert helper(76) == 77 + + # quux_5.html will be omitted from the results. + assert render("quux_5.html", 3) == "[quux_5.html @ 3]" """) - cov = coverage.Coverage() + cov = coverage.Coverage(omit=["*quux*"]) should_trace_hook = CheckUniqueFilenames.hook(cov, '_should_trace') check_include_hook = CheckUniqueFilenames.hook(cov, '_check_include_omit_etc') cov.config["run:plugins"] = ["tests.plugin2"] @@ -272,6 +275,11 @@ class FileTracerTest(CoverageTest): _, statements, missing, _ = cov.analysis("foo_7.html") self.assertEqual(statements, [1, 2, 3, 4, 5, 6, 7]) self.assertEqual(missing, [1, 2, 3, 6, 7]) + self.assertIn("foo_7.html", cov.data.summary()) + _, statements, missing, _ = cov.analysis("bar_4.html") self.assertEqual(statements, [1, 2, 3, 4]) self.assertEqual(missing, [1, 4]) + self.assertIn("bar_4.html", cov.data.summary()) + + self.assertNotIn("quux_5.html", cov.data.summary()) |