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

Function capture

tests/conftest.py:67–70  ·  view source on GitHub ↗
(fd: int)

Source from the content-addressed store, hash-verified

65 real_close = os.close
66
67 def capture(fd: int) -> None:
68 nonlocal locked_fd
69 locked_fd = fd
70 mocker.patch("filelock._api.os.close", side_effect=close)
71
72 def close(fd: int) -> None:
73 # filelock._api.os is the os module, so this patches os.close process-wide. Raise only for the descriptor

Callers 2

failFunction · 0.85
failFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected