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

Method fake_venv

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

Source from the content-addressed store, hash-verified

287
288 @contextlib.contextmanager
289 def fake_venv(self):
290 venv = Path.cwd() / "Scripts"
291 venv.mkdir(exist_ok=True, parents=True)
292 venv_exe = (venv / ("python_d.exe" if DEBUG_BUILD else "python.exe"))
293 venv_exe.touch()
294 try:
295 yield venv_exe, {"VIRTUAL_ENV": str(venv.parent)}
296 finally:
297 shutil.rmtree(venv)
298
299
300class TestLauncher(unittest.TestCase, RunPyMixin):

Callers 3

Calls 4

strFunction · 0.85
cwdMethod · 0.45
mkdirMethod · 0.45
touchMethod · 0.45

Tested by

no test coverage detected