MCPcopy
hub / github.com/pytest-dev/pytest / attempt_symlink_to

Function attempt_symlink_to

testing/test_tmpdir.py:608–614  ·  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, to_path)

Source from the content-addressed store, hash-verified

606
607
608def attempt_symlink_to(path, to_path):
609 """Try to make a symlink from "path" to "to_path", skipping in case this platform
610 does not support it or we don't have sufficient privileges (common on Windows)."""
611 try:
612 Path(path).symlink_to(Path(to_path))
613 except OSError:
614 pytest.skip("could not create symbolic link")
615
616
617def test_basetemp_with_read_only_files(pytester: Pytester) -> None:

Calls

no outgoing calls

Tested by

no test coverage detected