(
tmpdir_factory, # type: tmp.TempdirFactory
request, # type: FixtureRequest
)
| 82 | |
| 83 | @pytest.fixture |
| 84 | def 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 |
nothing calls this directly
no test coverage detected