File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -410,13 +410,21 @@ def check(
410410 # 1 for call_soon_task
411411 check (expected_monitors = 0 , expected_readers = 1 , expected_writers = 0 )
412412
413- with _core .monitor_kevent (a1 .fileno (), select .KQ_FILTER_READ ):
413+ with _core .monitor_kevent (a1 .fileno (), select .KQ_FILTER_READ ) as q :
414414 with (
415415 pytest .raises (_core .BusyResourceError ),
416416 _core .monitor_kevent (a1 .fileno (), select .KQ_FILTER_READ ),
417417 ):
418418 pass # pragma: no cover
419419 check (expected_monitors = 1 , expected_readers = 1 , expected_writers = 0 )
420+ b1 .write (b"\x00 " )
421+ with trio .fail_after (1 ):
422+ await q .receive ()
423+
424+ _core .notify_closing (a1 )
425+ a1 .close ()
426+ with trio .fail_after (1 ):
427+ assert len ([v async for v in q ]) == 0
420428
421429 check (expected_monitors = 0 , expected_readers = 1 , expected_writers = 0 )
422430
You can’t perform that action at this time.
0 commit comments