diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2013-04-21 13:38:11 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2013-04-21 13:38:11 -0400 |
commit | 129e8aea0133f173f5014a549ce372dde1fcd5b6 (patch) | |
tree | 9f1d900f5646b0a740e7f941a651a844426e4df7 /tests | |
parent | b33f839a07a6ad36464330d98822bc0341c4858f (diff) | |
download | python-coveragepy-129e8aea0133f173f5014a549ce372dde1fcd5b6.tar.gz |
Don't touch files as unexecuted if they were omitted. Fixes #218.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_api.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/test_api.py b/tests/test_api.py index 300a237..097947d 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -430,7 +430,7 @@ class OmitIncludeTestsMixin(UsingModulesMixin): self.filenames_not_in(result, "p1a p1c p2a othera osa") def test_omit_and_include(self): - result = self.coverage_usepkgs( include=["*/p1*"], omit=["*/p1a.py"]) + result = self.coverage_usepkgs(include=["*/p1*"], omit=["*/p1a.py"]) self.filenames_in(result, "p1b") self.filenames_not_in(result, "p1a p1c p2a p2b") @@ -467,6 +467,16 @@ class SourceOmitIncludeTest(OmitIncludeTestsMixin, CoverageTest): self.filenames_in(lines, "p1b") self.filenames_not_in(lines, "p1a p1c p2a p2b othera otherb osa osb") + def test_source_package_part_omitted(self): + # https://bitbucket.org/ned/coveragepy/issue/218 + # Used to be if you omitted something executed and inside the source, + # then after it was executed but not recorded, it would be found in + # the search for unexecuted files, and given a score of 0%. + lines = self.coverage_usepkgs(source=["pkg1"], omit=["pkg1/p1b.py"]) + self.filenames_in(lines, "p1a") + self.filenames_not_in(lines, "p1b") + self.assertEqual(lines['p1c'], 0) + class ReportIncludeOmitTest(OmitIncludeTestsMixin, CoverageTest): """Tests of the report include/omit functionality.""" |