summaryrefslogtreecommitdiff
path: root/test/test_process.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2010-06-23 22:30:35 -0400
committerNed Batchelder <ned@nedbatchelder.com>2010-06-23 22:30:35 -0400
commit8ecf012d6bc4061cca7471b32f86ef5efa871ac0 (patch)
treed2915ecafaa9deca02b4822bae3b2538783671f9 /test/test_process.py
parentd0755b95a5f3c1745a20644d4c0703bc639e518d (diff)
downloadpython-coveragepy-8ecf012d6bc4061cca7471b32f86ef5efa871ac0.tar.gz
Move the warnings to get them in more cases, and test one of those cases.
Diffstat (limited to 'test/test_process.py')
-rw-r--r--test/test_process.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_process.py b/test/test_process.py
index d59d072..684a5de 100644
--- a/test/test_process.py
+++ b/test/test_process.py
@@ -243,3 +243,20 @@ class ProcessTest(CoverageTest):
data = coverage.CoverageData()
data.read_file(".coverage")
self.assertEqual(data.summary()['fork.py'], 9)
+
+ def test_warnings(self):
+ self.make_file("hello.py", """\
+ import sys, os
+ print("Hello")
+ """)
+ out = self.run_command("coverage run --source=sys,xyzzy hello.py")
+
+ # This output is not in the same order it appears in real command line
+ # output, but this is how it appears in the combined stdout/stderr that
+ # run_command gives us.
+ self.assertMultiLineEqual(out, textwrap.dedent("""\
+ Hello
+ Coverage.py warning: Module sys has no python source.
+ Coverage.py warning: Source module xyzzy was never encountered.
+ Coverage.py warning: No data was collected.
+ """))