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

Function lstat_then_act

tests/conftest.py:168–173  ·  view source on GitHub ↗
(path: str | os.PathLike[str], *, dir_fd: int | None = None)

Source from the content-addressed store, hash-verified

166 return process_alive(pid)
167
168 def lstat_then_act(path: str | os.PathLike[str], *, dir_fd: int | None = None) -> os.stat_result:
169 found: Final[os.stat_result] = lstat(path, dir_fd=dir_fd)
170 if state == ["judged"] and os.fspath(path) == os.fspath(lock):
171 state.append("acted")
172 action()
173 return found
174
175 mocker.patch("filelock._identity._process.process_alive", side_effect=judged, autospec=True)
176 mocker.patch.object(os, "lstat", new=lstat_then_act)

Callers

nothing calls this directly

Calls 1

lstatFunction · 0.50

Tested by

no test coverage detected