From dbb18122b857053130a1bc6e39bfcd4445abec53 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 21 Mar 2011 17:58:09 -0400 Subject: A narrower way to check that empty __init__.py files show zero statements. --- test/test_summary.py | 18 ++++-------------- 1 file 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) -- cgit v1.2.1