MCPcopy Index your code
hub / github.com/python/cpython / test_virtualenv_with_env

Method test_virtualenv_with_env

Lib/test/test_launcher.py:556–565  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

554 self.fail("did not find active venv entry")
555
556 def test_virtualenv_with_env(self):
557 with self.fake_venv() as (venv_exe, env):
558 data1 = self.run_py([], env={**env, "PY_PYTHON": "PythonTestSuite/3"})
559 data2 = self.run_py(["-V:PythonTestSuite/3"], env={**env, "PY_PYTHON": "PythonTestSuite/3"})
560 # Compare stdout, because stderr goes via ascii
561 self.assertEqual(data1["stdout"].strip(), quote(venv_exe))
562 self.assertEqual(data1["SearchInfo.lowPriorityTag"], "True")
563 # Ensure passing the argument doesn't trigger the same behaviour
564 self.assertNotEqual(data2["stdout"].strip(), quote(venv_exe))
565 self.assertNotEqual(data2["SearchInfo.lowPriorityTag"], "True")
566
567 def test_py_shebang(self):
568 with self.py_ini(TEST_PY_DEFAULTS):

Callers

nothing calls this directly

Calls 6

fake_venvMethod · 0.80
run_pyMethod · 0.80
assertNotEqualMethod · 0.80
quoteFunction · 0.70
assertEqualMethod · 0.45
stripMethod · 0.45

Tested by

no test coverage detected