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

Function open_always_permission_error

tests/test_filelock.py:1077–1080  ·  view source on GitHub ↗
(path: str, flags: int, mode: int = 0o777, *, dir_fd: int | None = None)

Source from the content-addressed store, hash-verified

1075 real_open = os.open
1076
1077 def open_always_permission_error(path: str, flags: int, mode: int = 0o777, *, dir_fd: int | None = None) -> int:
1078 if "test.lock" in path:
1079 raise PermissionError(13, "Permission denied", path)
1080 return real_open(path, flags, mode) if dir_fd is None else real_open(path, flags, mode, dir_fd=dir_fd)
1081
1082 mocker.patch("os.open", side_effect=open_always_permission_error)
1083 with pytest.raises(PermissionError, match="Permission denied"):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…