summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-06-12 10:31:33 -0400
committerNed Batchelder <ned@nedbatchelder.com>2016-06-12 10:31:33 -0400
commit0e21348fa26967ed1c882b19d900deca5a6521a5 (patch)
tree92e12878a4095555a18c69a787306073b165288f
parent1f4eb724612022db65e66186e6abfde4201f40e4 (diff)
downloadpython-coveragepy-git-0e21348fa26967ed1c882b19d900deca5a6521a5.tar.gz
Another use of try_execfile.py to adjust
-rw-r--r--tests/test_execfile.py7
-rw-r--r--tests/test_process.py2
2 files changed, 4 insertions, 5 deletions
diff --git a/tests/test_execfile.py b/tests/test_execfile.py
index 135240f9..889d6cfd 100644
--- a/tests/test_execfile.py
+++ b/tests/test_execfile.py
@@ -16,15 +16,14 @@ from coverage.misc import NoCode, NoSource
from tests.coveragetest import CoverageTest
-HERE = os.path.dirname(__file__)
+TRY_EXECFILE = os.path.join(os.path.dirname(__file__), "modules/process_test/try_execfile.py")
class RunFileTest(CoverageTest):
"""Test cases for `run_python_file`."""
def test_run_python_file(self):
- tryfile = os.path.join(HERE, "try_execfile.py")
- run_python_file(tryfile, [tryfile, "arg1", "arg2"])
+ run_python_file(TRY_EXECFILE, [TRY_EXECFILE, "arg1", "arg2"])
mod_globs = json.loads(self.stdout())
# The file should think it is __main__
@@ -44,7 +43,7 @@ class RunFileTest(CoverageTest):
self.assertEqual(mod_globs['__main__.DATA'], "xyzzy")
# Argv should have the proper values.
- self.assertEqual(mod_globs['argv'], [tryfile, "arg1", "arg2"])
+ self.assertEqual(mod_globs['argv'], [TRY_EXECFILE, "arg1", "arg2"])
# __builtins__ should have the right values, like open().
self.assertEqual(mod_globs['__builtins__.has_open'], True)
diff --git a/tests/test_process.py b/tests/test_process.py
index 05588440..2c7751ff 100644
--- a/tests/test_process.py
+++ b/tests/test_process.py
@@ -17,7 +17,7 @@ from coverage.misc import output_encoding
from tests.coveragetest import CoverageTest
-TRY_EXECFILE = os.path.join(os.path.dirname(__file__), "modules", "process_test", "try_execfile.py")
+TRY_EXECFILE = os.path.join(os.path.dirname(__file__), "modules/process_test/try_execfile.py")
class ProcessTest(CoverageTest):