diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2010-08-28 18:53:10 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2010-08-28 18:53:10 -0400 |
commit | 0ce75ec8c128cc8c2e54e1f9053dd471ac48f2a7 (patch) | |
tree | a65404808e5423edef37a85c401d0a215567caaa /test/test_summary.py | |
parent | f0bbf65bfadf3eeafc9823efdd02d6bca10e445e (diff) | |
download | python-coveragepy-0ce75ec8c128cc8c2e54e1f9053dd471ac48f2a7.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.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_summary.py b/test/test_summary.py index db440f8..fcc2612 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): |