(fd: int)
| 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 |
| 74 | # under test. An unrelated close inside a GC finalizer would escape as an unraisable exception. |
| 75 | if fd == locked_fd: |
| 76 | raise release_error |
| 77 | real_close(fd) # pragma: no cover # only an unrelated close (e.g. a GC finalizer) reaches here |
| 78 | |
| 79 | yield capture, release_error, release_cause |
| 80 | if locked_fd is not None: # pragma: no branch # every consumer calls capture, so this is always set |
nothing calls this directly
no outgoing calls
no test coverage detected