(pytester: Pytester, basename: str, is_ok: bool)
| 99 | |
| 100 | @pytest.mark.parametrize("basename, is_ok", testdata) |
| 101 | def test_mktemp(pytester: Pytester, basename: str, is_ok: bool) -> None: |
| 102 | mytemp = pytester.mkdir("mytemp") |
| 103 | p = pytester.makepyfile( |
| 104 | """ |
| 105 | def test_abs_path(tmp_path_factory): |
| 106 | tmp_path_factory.mktemp('{}', numbered=False) |
| 107 | """.format( |
| 108 | basename |
| 109 | ) |
| 110 | ) |
| 111 | |
| 112 | result = pytester.runpytest(p, "--basetemp=%s" % mytemp) |
| 113 | if is_ok: |
| 114 | assert result.ret == 0 |
| 115 | assert mytemp.joinpath(basename).exists() |
| 116 | else: |
| 117 | assert result.ret == 1 |
| 118 | result.stdout.fnmatch_lines("*ValueError*") |
| 119 | |
| 120 | |
| 121 | def test_tmp_path_always_is_realpath(pytester: Pytester, monkeypatch) -> None: |
nothing calls this directly
no test coverage detected