From 62489d0ee3376e6c86f0589b2419d743df21e401 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 29 Dec 2012 09:17:13 -0500 Subject: A test to prove that the fix for #224 causes problems of its own. --- test/test_process.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test/test_process.py') 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) -- cgit v1.2.1