diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2012-11-24 17:20:30 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-11-24 17:20:30 -0500 |
commit | 450b191950fba173de99ad46b4f34e39576c4f65 (patch) | |
tree | 73c47ae0751327c2f58aa97bf8f9158064cab522 /test/test_testing.py | |
parent | aa49bd6b32a29c78a41f8ddcfae6bfb376e8baa0 (diff) | |
download | python-coveragepy-450b191950fba173de99ad46b4f34e39576c4f65.tar.gz |
'coverage debug sys' shows the python executable, and there's a test that our subprocesses use the same one we do.
Diffstat (limited to 'test/test_testing.py')
-rw-r--r-- | test/test_testing.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_testing.py b/test/test_testing.py index 9943b65..1ea3232 100644 --- a/test/test_testing.py +++ b/test/test_testing.py @@ -167,3 +167,20 @@ class CoverageTestTest(CoverageTest): AssertionError, self.assert_doesnt_exist, "whoville.txt" ) self.assertRaises(AssertionError, self.assert_exists, "shadow.txt") + + def test_sub_python_is_this_python(self): + # Try it with a python command. + self.make_file("showme.py", """\ + import os, sys + print(sys.executable) + print(os.__file__) + """) + out = self.run_command("python showme.py").splitlines() + self.assertEqual(out[0], sys.executable) + self.assertEqual(out[1], os.__file__) + + # 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) |