summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2012-11-24 20:45:01 -0500
committerNed Batchelder <ned@nedbatchelder.com>2012-11-24 20:45:01 -0500
commite850fe70106da1fb64fa5460a2b2b25e63fe13f4 (patch)
treeb31f390f305005f33d5da3582b67ad691a08ce7c
parentf08cf696283f8c55451afa4046ca777bcfd90436 (diff)
downloadpython-coveragepy-git-e850fe70106da1fb64fa5460a2b2b25e63fe13f4.tar.gz
Add an environment variable to the sub-python test.
-rw-r--r--test/test_testing.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test_testing.py b/test/test_testing.py
index 1ea3232f..64c35e36 100644
--- a/test/test_testing.py
+++ b/test/test_testing.py
@@ -170,17 +170,22 @@ class CoverageTestTest(CoverageTest):
def test_sub_python_is_this_python(self):
# Try it with a python command.
+ os.environ['COV_FOOBAR'] = 'XYZZY'
self.make_file("showme.py", """\
import os, sys
print(sys.executable)
print(os.__file__)
+ print(os.environ['COV_FOOBAR'])
""")
out = self.run_command("python showme.py").splitlines()
self.assertEqual(out[0], sys.executable)
self.assertEqual(out[1], os.__file__)
+ self.assertEqual(out[2], 'XYZZY')
# Try it with a "coverage debug sys" command.
out = self.run_command("coverage debug sys").splitlines()
executable = [l for l in out if "executable:" in l][0]
executable = executable.split(":", 1)[1].strip()
self.assertEqual(executable, sys.executable)
+ environ = [l for l in out if "COV_FOOBAR" in l][0].strip()
+ self.assertEqual(environ, "COV_FOOBAR = XYZZY")