Skip to content

Commit

Permalink
test more of kqueue
Browse files Browse the repository at this point in the history
  • Loading branch information
graingert committed Dec 20, 2024
1 parent a57247a commit 5344e71
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/trio/_core/_tests/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,12 @@ def check(
# 1 for call_soon_task
check(expected_monitors=0, expected_readers=1, expected_writers=0)

with trio.lowlevel.monitor_kevent(a1.fileno(), select.KQ_FILTER_READ):
with _core.monitor_kevent(a1.fileno(), select.KQ_FILTER_READ) as q:
with pytest.raises(_core.BusyResourceError):
_core.monitor_kevent(a1.fileno(), select.KQ_FILTER_READ)
check(expected_monitors=1, expected_readers=1, expected_writers=0)
b1.send(b"\x00")
assert len(await q.get_batch()) == 1

check(expected_monitors=0, expected_readers=1, expected_writers=0)

Expand Down

0 comments on commit 5344e71

Please sign in to comment.