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

Function subst_path_linux

testing/test_link_resolve.py:37–48  ·  view source on GitHub ↗
(filepath: Path)

Source from the content-addressed store, hash-verified

35
36@contextmanager
37def subst_path_linux(filepath: Path):
38 directory = filepath.parent
39 basename = filepath.name
40
41 target = directory / ".." / "sub2"
42 os.symlink(str(directory), str(target), target_is_directory=True)
43 try:
44 filename = target / basename
45 yield filename
46 finally:
47 # We don't need to unlink (it's all in the tempdir).
48 pass
49
50
51def test_link_resolve(pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected