MCPcopy Create free account
hub / github.com/tox-dev/filelock / lock_path_in_shared_tmp

Function lock_path_in_shared_tmp

tests/conftest.py:237–243  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

235
236@pytest.fixture
237def lock_path_in_shared_tmp() -> Iterator[Path]: # pragma: needs foreign-sticky-tmp
238 # /tmp itself, where every account can create names, rather than this test's own directory.
239 lock_path = Path("/tmp", f"filelock-{secrets.token_hex(8)}.lock") # ruff:ignore[hardcoded-temp-file] # the subject
240 yield lock_path
241 for derived in (Path(f"{lock_path}.filelock"), Path(f"{lock_path}.rw")):
242 shutil.rmtree(derived, ignore_errors=True)
243 lock_path.unlink(missing_ok=True)
244
245
246@pytest.fixture

Callers

nothing calls this directly

Calls 1

unlinkMethod · 0.45

Tested by

no test coverage detected