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

Method test_symlinking

Lib/test/test_venv.py:453–470  ·  view source on GitHub ↗

Test symlinking works as expected

(self)

Source from the content-addressed store, hash-verified

451
452 @unittest.skipUnless(can_symlink(), 'Needs symlinks')
453 def test_symlinking(self):
454 """
455 Test symlinking works as expected
456 """
457 for usl in (False, True):
458 builder = venv.EnvBuilder(clear=True, symlinks=usl)
459 builder.create(self.env_dir)
460 fn = self.get_env_file(self.bindir, self.exe)
461 # Don't test when False, because e.g. 'python' is always
462 # symlinked to 'python3.3' in the env, even when symlinking in
463 # general isn't wanted.
464 if usl:
465 if self.cannot_link_exe:
466 # Symlinking is skipped when our executable is already a
467 # special app symlink
468 self.assertFalse(os.path.islink(fn))
469 else:
470 self.assertTrue(os.path.islink(fn))
471
472 # If a venv is created from a source build and that venv is used to
473 # run the test, the pyvenv.cfg in the venv created in the test will

Callers

nothing calls this directly

Calls 5

get_env_fileMethod · 0.80
assertFalseMethod · 0.80
islinkMethod · 0.80
assertTrueMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected