summaryrefslogtreecommitdiff
path: root/test/test_execfile.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-10-25 12:09:05 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-10-25 12:09:05 -0400
commit25bc0029962412ecb259bc081a16240ac7a13878 (patch)
tree28b5940da390ea77b9a03fc2d2568dfd6dd8cbfb /test/test_execfile.py
parent04977bf740f64060717a50757ecbf195a5ead60c (diff)
downloadpython-coveragepy-git-25bc0029962412ecb259bc081a16240ac7a13878.tar.gz
Report errors finding source files to execute more nicely. Fixes issue #23.
Diffstat (limited to 'test/test_execfile.py')
-rw-r--r--test/test_execfile.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/test_execfile.py b/test/test_execfile.py
index 1dde7054..5e9f4fd5 100644
--- a/test/test_execfile.py
+++ b/test/test_execfile.py
@@ -3,6 +3,7 @@
import os, sys
from coverage.execfile import run_python_file
+from coverage.misc import NoSource
sys.path.insert(0, os.path.split(__file__)[0]) # Force relative import for Py3k
from coveragetest import CoverageTest
@@ -59,3 +60,5 @@ class RunTest(CoverageTest):
run_python_file('nl.py', ['nl.py'])
self.assertEqual(self.stdout(), "Hello, world!\n"*3)
+ def test_no_such_file(self):
+ self.assertRaises(NoSource, run_python_file, "xyzzy.py", [])