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 | f7b61f17203857bc70f3c8bdc2b0890aeb9c43b7 (patch) | |
tree | b94cef33dbb54d42ed8210c2aed4f7d4848145f9 | |
parent | 89ec8f6da41555dce7bee84b47cfa2b7f2e0213e (diff) | |
download | python-coveragepy-f7b61f17203857bc70f3c8bdc2b0890aeb9c43b7.tar.gz |
Test omitted plugin-measured files.
-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 190096b..9f56c6d 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()) |