MCPcopy
hub / github.com/pex-tool/pex / tmpdir

Function tmpdir

tests/conftest.py:84–97  ·  view source on GitHub ↗
(
    tmpdir_factory,  # type: tmp.TempdirFactory
    request,  # type: FixtureRequest
)

Source from the content-addressed store, hash-verified

82
83@pytest.fixture
84def tmpdir(
85 tmpdir_factory, # type: tmp.TempdirFactory
86 request, # type: FixtureRequest
87):
88 # type: (...) -> Iterator[tmp.Tempdir]
89 temp_directory = tmpdir_factory.mktemp(name=request.node.name)
90 try:
91 yield temp_directory
92 finally:
93 if (
94 tmpdir_factory.retention_policy is tmp.RetentionPolicy.FAILED
95 and track_status_hook.passed(request.node)
96 ) or tmpdir_factory.retention_policy is tmp.RetentionPolicy.NONE:
97 temp_directory.safe_remove()
98
99
100@pytest.fixture

Callers

nothing calls this directly

Calls 2

mktempMethod · 0.80
safe_removeMethod · 0.80

Tested by

no test coverage detected