(pytester: Pytester, basename: str, is_ok: bool)
| 306 | |
| 307 | @pytest.mark.parametrize("basename, is_ok", testdata) |
| 308 | def test_mktemp(pytester: Pytester, basename: str, is_ok: bool) -> None: |
| 309 | mytemp = pytester.mkdir("mytemp") |
| 310 | p = pytester.makepyfile( |
| 311 | f""" |
| 312 | def test_abs_path(tmp_path_factory): |
| 313 | tmp_path_factory.mktemp('{basename}', numbered=False) |
| 314 | """ |
| 315 | ) |
| 316 | |
| 317 | result = pytester.runpytest(p, f"--basetemp={mytemp}") |
| 318 | if is_ok: |
| 319 | assert result.ret == 0 |
| 320 | assert mytemp.joinpath(basename).exists() |
| 321 | else: |
| 322 | assert result.ret == 1 |
| 323 | result.stdout.fnmatch_lines("*ValueError*") |
| 324 | |
| 325 | |
| 326 | def test_tmp_path_always_is_realpath(pytester: Pytester, monkeypatch) -> None: |
nothing calls this directly
no test coverage detected