Fixes #4653 - tmp_path provides real path
This commit is contained in:
@@ -121,6 +121,22 @@ def test_tmpdir_always_is_realpath(testdir):
|
||||
assert not result.ret
|
||||
|
||||
|
||||
def test_tmp_path_always_is_realpath(testdir, monkeypatch):
|
||||
# for reasoning see: test_tmpdir_always_is_realpath test-case
|
||||
realtemp = testdir.tmpdir.mkdir("myrealtemp")
|
||||
linktemp = testdir.tmpdir.join("symlinktemp")
|
||||
attempt_symlink_to(linktemp, str(realtemp))
|
||||
monkeypatch.setenv("PYTEST_DEBUG_TEMPROOT", str(linktemp))
|
||||
testdir.makepyfile(
|
||||
"""
|
||||
def test_1(tmp_path):
|
||||
assert tmp_path.resolve() == tmp_path
|
||||
"""
|
||||
)
|
||||
reprec = testdir.inline_run()
|
||||
reprec.assertoutcome(passed=1)
|
||||
|
||||
|
||||
def test_tmpdir_too_long_on_parametrization(testdir):
|
||||
testdir.makepyfile(
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user