MCPcopy Create free account
hub / github.com/pytest-dev/pytest / attempt_symlink_to

Function attempt_symlink_to

testing/test_legacypath.py:46–52  ·  view source on GitHub ↗

Try to make a symlink from "path" to "to_path", skipping in case this platform does not support it or we don't have sufficient privileges (common on Windows).

(path: str, to_path: str)

Source from the content-addressed store, hash-verified

44
45
46def attempt_symlink_to(path: str, to_path: str) -> None:
47 """Try to make a symlink from "path" to "to_path", skipping in case this platform
48 does not support it or we don't have sufficient privileges (common on Windows)."""
49 try:
50 Path(path).symlink_to(Path(to_path))
51 except OSError:
52 pytest.skip("could not create symbolic link")
53
54
55def test_tmpdir_factory(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected