summaryrefslogtreecommitdiff
path: root/test/test_summary.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-08-28 18:53:10 -0400
committerNed Batchelder <ned@nedbatchelder.com>2010-08-28 18:53:10 -0400
commitc91ab2a64249971c598e52d66b3b2c9b877140c2 (patch)
tree725a4be41ea35640b440d45ee4ea7c8e8e1cd484 /test/test_summary.py
parent895fa1bac33cc6f9850e027af1c6abc2014fd4dc (diff)
downloadpython-coveragepy-git-c91ab2a64249971c598e52d66b3b2c9b877140c2.tar.gz
Refactor the --omit and --include support during reporting, and add a test for --include.
Diffstat (limited to 'test/test_summary.py')
-rw-r--r--test/test_summary.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_summary.py b/test/test_summary.py
index db440f85..fcc26125 100644
--- a/test/test_summary.py
+++ b/test/test_summary.py
@@ -90,6 +90,22 @@ class SummaryTest(CoverageTest):
self.assertTrue("mycode " in report)
self.assertEqual(self.last_line_squeezed(report), "mycode 4 0 100%")
+ def test_report_including(self):
+ # Try reporting while including some modules
+ self.run_command("coverage run mycode.py")
+ report = self.report_from_command("coverage report --include=mycode*")
+
+ # Name Stmts Miss Cover
+ # ----------------------------
+ # mycode 4 0 100%
+
+ self.assertEqual(self.line_count(report), 3)
+ self.assertFalse("/coverage/" in report)
+ self.assertFalse("/test/modules/covmod1 " in report)
+ self.assertFalse("/test/zipmods.zip/covmodzip1 " in report)
+ self.assertTrue("mycode " in report)
+ self.assertEqual(self.last_line_squeezed(report), "mycode 4 0 100%")
+
def test_report_branches(self):
self.make_file("mybranch.py", """\
def branch(x):