MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_mktemp

Method test_mktemp

testing/test_tmpdir.py:51–60  ·  view source on GitHub ↗
(self, tmp_path)

Source from the content-addressed store, hash-verified

49
50class TestTmpPathHandler:
51 def test_mktemp(self, tmp_path):
52 config = cast(Config, FakeConfig(tmp_path))
53 t = TempPathFactory.from_config(config, _ispytest=True)
54 tmp = t.mktemp("world")
55 assert str(tmp.relative_to(t.getbasetemp())) == "world0"
56 tmp = t.mktemp("this")
57 assert str(tmp.relative_to(t.getbasetemp())).startswith("this")
58 tmp2 = t.mktemp("this")
59 assert str(tmp2.relative_to(t.getbasetemp())).startswith("this")
60 assert tmp2 != tmp
61
62 def test_tmppath_relative_basetemp_absolute(self, tmp_path, monkeypatch):
63 """#4425"""

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