Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions tests/test_strict_soft.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,9 @@ def fail_sentinel_inspection(fd: int) -> os.stat_result:
with pytest.raises(OSError, match="sentinel inspection failed"):
lock.acquire()
assert inspected_fd is not None
# A closed descriptor reports EBADF on every platform, but the message differs (Windows says "handle is invalid").
with pytest.raises(OSError, match=r"Bad file descriptor|handle is invalid") as closed:
# The error message depends on the OS language; the closed-descriptor errno is stable.
with pytest.raises(OSError, check=lambda error: error.errno == EBADF):
real_fstat(inspected_fd)
assert closed.value.errno == EBADF
assert (lock.is_locked, lock.lock_counter, lock.claims) == (False, 0, ())


Expand Down
Loading