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

Method test_executable

Lib/test/test_venv.py:477–486  ·  view source on GitHub ↗

Test that the sys.executable value is as expected.

(self)

Source from the content-addressed store, hash-verified

475 # to the source build - so Python can't initialise properly.
476 @requireVenvCreate
477 def test_executable(self):
478 """
479 Test that the sys.executable value is as expected.
480 """
481 rmtree(self.env_dir)
482 self.run_with_capture(venv.create, self.env_dir)
483 envpy = self.envpy(real_env_dir=True)
484 out, err = check_output([envpy, '-c',
485 'import sys; print(sys.executable)'])
486 self.assertEqual(out.strip(), envpy.encode())
487
488 @unittest.skipUnless(can_symlink(), 'Needs symlinks')
489 def test_executable_symlinks(self):

Callers

nothing calls this directly

Calls 7

rmtreeFunction · 0.90
run_with_captureMethod · 0.80
envpyMethod · 0.80
check_outputFunction · 0.70
assertEqualMethod · 0.45
stripMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected