(pytester: Pytester, monkeypatch)
| 324 | |
| 325 | |
| 326 | def test_tmp_path_always_is_realpath(pytester: Pytester, monkeypatch) -> None: |
| 327 | # the reason why tmp_path should be a realpath is that |
| 328 | # when you cd to it and do "os.getcwd()" you will anyway |
| 329 | # get the realpath. Using the symlinked path can thus |
| 330 | # easily result in path-inequality |
| 331 | # XXX if that proves to be a problem, consider using |
| 332 | # os.environ["PWD"] |
| 333 | realtemp = pytester.mkdir("myrealtemp") |
| 334 | linktemp = pytester.path.joinpath("symlinktemp") |
| 335 | attempt_symlink_to(linktemp, str(realtemp)) |
| 336 | monkeypatch.setenv("PYTEST_DEBUG_TEMPROOT", str(linktemp)) |
| 337 | pytester.makepyfile( |
| 338 | """ |
| 339 | def test_1(tmp_path): |
| 340 | assert tmp_path.resolve() == tmp_path |
| 341 | """ |
| 342 | ) |
| 343 | reprec = pytester.inline_run() |
| 344 | reprec.assertoutcome(passed=1) |
| 345 | |
| 346 | |
| 347 | def test_tmp_path_too_long_on_parametrization(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…