summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2012-12-29 09:17:13 -0500
committerNed Batchelder <ned@nedbatchelder.com>2012-12-29 09:17:13 -0500
commit62489d0ee3376e6c86f0589b2419d743df21e401 (patch)
treee90feeab27933640ce62c76ed01c94835174c046
parent080108130f381d2289c15b26b3a49d22049aa925 (diff)
downloadpython-coveragepy-git-62489d0ee3376e6c86f0589b2419d743df21e401.tar.gz
A test to prove that the fix for #224 causes problems of its own.
-rw-r--r--test/test_process.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/test_process.py b/test/test_process.py
index 563c2c2e..83cbc0f3 100644
--- a/test/test_process.py
+++ b/test/test_process.py
@@ -396,6 +396,27 @@ class ProcessTest(CoverageTest):
Coverage.py warning: No data was collected.
"""), out)
+ def test_warnings_during_reporting(self):
+ # While fixing issue #224, the warnings were being printed far too
+ # often. Make sure they're not any more.
+ self.make_file("hello.py", """\
+ import sys, os, the_other
+ print("Hello")
+ """)
+ self.make_file("the_other.py", """\
+ print("What?")
+ """)
+ self.make_file(".coveragerc", """\
+ [run]
+ source =
+ .
+ xyzzy
+ """)
+
+ self.run_command("coverage run hello.py")
+ out = self.run_command("coverage html")
+ self.assertEqual(out.count("Module xyzzy was never imported."), 0)
+
def test_warnings_if_never_run(self):
out = self.run_command("coverage run i_dont_exist.py")
self.assertIn("No file to run: 'i_dont_exist.py'", out)