diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2011-03-21 17:58:09 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2011-03-21 17:58:09 -0400 |
commit | dbb18122b857053130a1bc6e39bfcd4445abec53 (patch) | |
tree | 5685bce497712c10c77a9eeca5bd6444be0c1406 | |
parent | 43037fc52ef24ede2f7237af44c56cddb9701481 (diff) | |
download | python-coveragepy-git-dbb18122b857053130a1bc6e39bfcd4445abec53.tar.gz |
A narrower way to check that empty __init__.py files show zero statements.
-rw-r--r-- | test/test_summary.py | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/test/test_summary.py b/test/test_summary.py index 6711decf..b4b99380 100644 --- a/test/test_summary.py +++ b/test/test_summary.py @@ -1,6 +1,6 @@ """Test text-based summary reporting for coverage.py""" -import os, re, sys, textwrap +import os, re, sys import coverage from coverage.backward import StringIO @@ -152,16 +152,6 @@ class SummaryTest2(CoverageTest): cov.report(file=repout, show_missing=False) report = repout.getvalue().replace('\\', '/') - self.assertMultiLineEqual(report, textwrap.dedent("""\ - Name Stmts Miss Cover - ------------------------------------------------ - test/modules/pkg1/__init__ 1 0 100% - test/modules/pkg1/p1a 3 0 100% - test/modules/pkg1/p1b 3 0 100% - test/modules/pkg2/__init__ 0 0 100% - test/modules/pkg2/p2a 3 0 100% - test/modules/pkg2/p2b 3 0 100% - test/modules/usepkgs 2 0 100% - ------------------------------------------------ - TOTAL 15 0 100% - """)) + report = re.sub(r"\s+", " ", report) + self.assert_("test/modules/pkg1/__init__ 1 0 100%" in report) + self.assert_("test/modules/pkg2/__init__ 0 0 100%" in report) |