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

Method tmpdir

src/_pytest/legacypath.py:303–317  ·  view source on GitHub ↗

Return a temporary directory path object which is unique to each test function invocation, created as a sub directory of the base temporary directory. By default, a new base temporary directory is created each test session, and old bases are removed after 3 sessions,

(tmp_path: Path)

Source from the content-addressed store, hash-verified

301 @staticmethod
302 @fixture
303 def tmpdir(tmp_path: Path) -> LEGACY_PATH:
304 """Return a temporary directory path object which is unique to each test
305 function invocation, created as a sub directory of the base temporary
306 directory.
307
308 By default, a new base temporary directory is created each test session,
309 and old bases are removed after 3 sessions, to aid in debugging. If
310 ``--basetemp`` is used then it is cleared each session. See :ref:`base
311 temporary directory`.
312
313 The returned object is a `legacy_path`_ object.
314
315 .. _legacy_path: https://py.readthedocs.io/en/latest/path.html
316 """
317 return legacy_path(tmp_path)
318
319
320def Cache_makedir(self: Cache, name: str) -> LEGACY_PATH:

Callers

nothing calls this directly

Calls 1

legacy_pathFunction · 0.90

Tested by

no test coverage detected