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

Method test_executable_symlinks

Lib/test/test_venv.py:489–499  ·  view source on GitHub ↗

Test that the sys.executable value is as expected.

(self)

Source from the content-addressed store, hash-verified

487
488 @unittest.skipUnless(can_symlink(), 'Needs symlinks')
489 def test_executable_symlinks(self):
490 """
491 Test that the sys.executable value is as expected.
492 """
493 rmtree(self.env_dir)
494 builder = venv.EnvBuilder(clear=True, symlinks=True)
495 builder.create(self.env_dir)
496 envpy = self.envpy(real_env_dir=True)
497 out, err = check_output([envpy, '-c',
498 'import sys; print(sys.executable)'])
499 self.assertEqual(out.strip(), envpy.encode())
500
501 # gh-124651: test quoted strings
502 @unittest.skipIf(os.name == 'nt', 'contains invalid characters on Windows')

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected