(pytester: Pytester, monkeypatch)
| 119 | |
| 120 | |
| 121 | def test_tmp_path_always_is_realpath(pytester: Pytester, monkeypatch) -> None: |
| 122 | # the reason why tmp_path should be a realpath is that |
| 123 | # when you cd to it and do "os.getcwd()" you will anyway |
| 124 | # get the realpath. Using the symlinked path can thus |
| 125 | # easily result in path-inequality |
| 126 | # XXX if that proves to be a problem, consider using |
| 127 | # os.environ["PWD"] |
| 128 | realtemp = pytester.mkdir("myrealtemp") |
| 129 | linktemp = pytester.path.joinpath("symlinktemp") |
| 130 | attempt_symlink_to(linktemp, str(realtemp)) |
| 131 | monkeypatch.setenv("PYTEST_DEBUG_TEMPROOT", str(linktemp)) |
| 132 | pytester.makepyfile( |
| 133 | """ |
| 134 | def test_1(tmp_path): |
| 135 | assert tmp_path.resolve() == tmp_path |
| 136 | """ |
| 137 | ) |
| 138 | reprec = pytester.inline_run() |
| 139 | reprec.assertoutcome(passed=1) |
| 140 | |
| 141 | |
| 142 | def test_tmp_path_too_long_on_parametrization(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected