Skip to content

Commit 2787185

Browse files
committed
tests: mark unreachable zero-iteration branch in POLLHUP monitor loop
The while loop at line 144 always executes at least once — POLLHUP fires after the write end is closed, not before. The zero-iteration branch (condition False on first check) is structurally unreachable in this test but triggers a coverage miss under branch coverage. Mark with pragma: no branch, consistent with the pattern used elsewhere in the test suite (e.g. test_notification_response.py).
1 parent c8b9983 commit 2787185

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/server/test_stdio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ async def test_stdin_eof_monitor_ignores_pollin_events():
141141

142142
# Wait for the monitor to detect POLLHUP and cancel.
143143
with anyio.fail_after(5):
144-
while not tg.cancel_scope.cancel_called:
144+
while not tg.cancel_scope.cancel_called: # pragma: no branch
145145
await anyio.sleep(0.05)
146146
finally:
147147
os.close(read_fd)

0 commit comments

Comments
 (0)