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

Function test_tmpdir_always_is_realpath

testing/test_legacypath.py:68–81  ·  view source on GitHub ↗
(pytester: pytest.Pytester)

Source from the content-addressed store, hash-verified

66
67
68def test_tmpdir_always_is_realpath(pytester: pytest.Pytester) -> None:
69 # See test_tmp_path_always_is_realpath.
70 realtemp = pytester.mkdir("myrealtemp")
71 linktemp = pytester.path.joinpath("symlinktemp")
72 attempt_symlink_to(str(linktemp), str(realtemp))
73 p = pytester.makepyfile(
74 """
75 def test_1(tmpdir):
76 import os
77 assert os.path.realpath(str(tmpdir)) == str(tmpdir)
78 """
79 )
80 result = pytester.runpytest("-s", p, "--basetemp=%s/bt" % linktemp)
81 assert not result.ret
82
83
84def test_cache_makedir(cache: pytest.Cache) -> None:

Callers

nothing calls this directly

Calls 4

attempt_symlink_toFunction · 0.70
mkdirMethod · 0.45
makepyfileMethod · 0.45
runpytestMethod · 0.45

Tested by

no test coverage detected