summaryrefslogtreecommitdiff
path: root/test/test_api.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2011-04-25 22:00:36 -0400
committerNed Batchelder <ned@nedbatchelder.com>2011-04-25 22:00:36 -0400
commitbbf745190a4efc6a040c656f1288ff67114edc8f (patch)
treeff124eb55d0e91b99a66e04851def600bbebcbb4 /test/test_api.py
parent4adf9b46ce958c33aaede3bb1b9521cea6b1eb53 (diff)
downloadpython-coveragepy-git-bbf745190a4efc6a040c656f1288ff67114edc8f.tar.gz
Since people make this mistake, and it's mysterious: accept a single string for omit and include.
Diffstat (limited to 'test/test_api.py')
-rw-r--r--test/test_api.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/test_api.py b/test/test_api.py
index 31d8988b..0a0aabfd 100644
--- a/test/test_api.py
+++ b/test/test_api.py
@@ -388,6 +388,15 @@ class SourceOmitIncludeTest(CoverageTest):
"p1b.py p1c.py p2b.py otherb.py osb.py"
)
+ def test_include_as_string(self):
+ lines = self.coverage_usepkgs_summary(include="*a.py")
+ self.filenames_in_summary(lines,
+ "p1a.py p2a.py othera.py osa.py"
+ )
+ self.filenames_not_in_summary(lines,
+ "p1b.py p1c.py p2b.py otherb.py osb.py"
+ )
+
def test_omit(self):
lines = self.coverage_usepkgs_summary(omit=["*/p1a.py"])
self.filenames_in_summary(lines,
@@ -406,6 +415,15 @@ class SourceOmitIncludeTest(CoverageTest):
"p1a.py p1c.py p2a.py othera.py osa.py"
)
+ def test_omit_as_string(self):
+ lines = self.coverage_usepkgs_summary(omit="*a.py")
+ self.filenames_in_summary(lines,
+ "p1b.py p2b.py otherb.py osb.py"
+ )
+ self.filenames_not_in_summary(lines,
+ "p1a.py p1c.py p2a.py othera.py osa.py"
+ )
+
def test_omit_and_include(self):
lines = self.coverage_usepkgs_summary(
include=["*/p1*"], omit=["*/p1a.py"]