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

Function attempt_symlink_to

testing/test_tmpdir.py:401–407  ·  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

399
400
401def attempt_symlink_to(path, to_path):
402 """Try to make a symlink from "path" to "to_path", skipping in case this platform
403 does not support it or we don't have sufficient privileges (common on Windows)."""
404 try:
405 Path(path).symlink_to(Path(to_path))
406 except OSError:
407 pytest.skip("could not create symbolic link")
408
409
410def test_basetemp_with_read_only_files(pytester: Pytester) -> None:

Calls

no outgoing calls

Tested by

no test coverage detected