summaryrefslogtreecommitdiff
path: root/test/test_process.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2011-02-07 08:37:14 -0500
committerNed Batchelder <ned@nedbatchelder.com>2011-02-07 08:37:14 -0500
commit6ec3302004a2293535e5c3814c1c19e2f141e972 (patch)
tree029b370254f2d0f387aabdd41514285af2dd4d81 /test/test_process.py
parentcd308cf6b980dd83e56c4739db298a631ed14262 (diff)
downloadpython-coveragepy-6ec3302004a2293535e5c3814c1c19e2f141e972.tar.gz
Don't warn about not collecting data if we never ran any code in the first place.
Diffstat (limited to 'test/test_process.py')
-rw-r--r--test/test_process.py10
1 files changed, 10 insertions, 0 deletions
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)
+