summaryrefslogtreecommitdiff
path: root/test/test_summary.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_summary.py')
-rw-r--r--test/test_summary.py20
1 files changed, 6 insertions, 14 deletions
diff --git a/test/test_summary.py b/test/test_summary.py
index 5a689129..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
@@ -141,6 +141,8 @@ class SummaryTest2(CoverageTest):
sys.path.append(self.nice_file(os.path.dirname(__file__), 'modules'))
def test_empty_files(self):
+ # Shows that empty files like __init__.py are listed as having zero
+ # statements, not one statement.
cov = coverage.coverage()
cov.start()
import usepkgs # pylint: disable=F0401,W0612
@@ -150,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)