From 6ec3302004a2293535e5c3814c1c19e2f141e972 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 7 Feb 2011 08:37:14 -0500 Subject: Don't warn about not collecting data if we never ran any code in the first place. --- test/test_process.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test/test_process.py') diff --git a/test/test_process.py b/test/test_process.py index acfb889..8a47bfc 100644 --- a/test/test_process.py +++ b/test/test_process.py @@ -275,3 +275,13 @@ class ProcessTest(CoverageTest): Coverage.py warning: Module quux was never imported. Coverage.py warning: No data was collected. """) in out) + + def test_warnings_if_never_run(self): + out = self.run_command("coverage run i_dont_exist.py") + self.assertTrue("No file to run: 'i_dont_exist.py'" in out) + self.assertTrue("warning" not in out) + + out = self.run_command("coverage run -m no_such_module") + self.assertTrue("No module named no_such_module" in out) + self.assertTrue("warning" not in out) + -- cgit v1.2.1