MCPcopy
hub / github.com/pytest-dev/pytest / test_mktemp

Method test_mktemp

testing/test_tmpdir.py:61–70  ·  view source on GitHub ↗
(self, tmp_path: Path)

Source from the content-addressed store, hash-verified

59
60class TestTmpPathHandler:
61 def test_mktemp(self, tmp_path: Path) -> None:
62 config = cast(Config, FakeConfig(tmp_path))
63 t = TempPathFactory.from_config(config, _ispytest=True)
64 tmp = t.mktemp("world")
65 assert str(tmp.relative_to(t.getbasetemp())) == "world0"
66 tmp = t.mktemp("this")
67 assert str(tmp.relative_to(t.getbasetemp())).startswith("this")
68 tmp2 = t.mktemp("this")
69 assert str(tmp2.relative_to(t.getbasetemp())).startswith("this")
70 assert tmp2 != tmp
71
72 def test_tmppath_relative_basetemp_absolute(
73 self, tmp_path: Path, monkeypatch: MonkeyPatch

Callers

nothing calls this directly

Calls 4

FakeConfigClass · 0.70
from_configMethod · 0.45
mktempMethod · 0.45
getbasetempMethod · 0.45

Tested by

no test coverage detected