(path: str, flags: int, mode: int = 0o777, *, dir_fd: int | None = None)
| 1054 | call_count = 0 |
| 1055 | |
| 1056 | def open_no_creat(path: str, flags: int, mode: int = 0o777, *, dir_fd: int | None = None) -> int: |
| 1057 | nonlocal call_count |
| 1058 | call_count += 1 |
| 1059 | if call_count == 1 and flags & os.O_CREAT: |
| 1060 | raise PermissionError(13, "Permission denied", path) |
| 1061 | return real_open(path, flags, mode) if dir_fd is None else real_open(path, flags, mode, dir_fd=dir_fd) |
| 1062 | |
| 1063 | mocker.patch("os.open", side_effect=open_no_creat) |
| 1064 | lock.acquire() |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…