We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4d93014 commit 1e022abCopy full SHA for 1e022ab
1 file changed
tests/server/test_stdio.py
@@ -83,14 +83,12 @@ async def test_stdio_server_invalid_utf8(monkeypatch: pytest.MonkeyPatch):
83
with anyio.fail_after(5):
84
async with stdio_server() as (read_stream, write_stream):
85
await write_stream.aclose()
86
- async with read_stream:
87
- it = read_stream.__aiter__()
88
-
+ async with read_stream: # pragma: no branch
89
# First line: \xff\xfe -> U+FFFD U+FFFD -> JSON parse fails -> exception in stream
90
- first = await it.__anext__()
+ first = await read_stream.receive()
91
assert isinstance(first, Exception)
92
93
# Second line: valid message still comes through
94
- second = await it.__anext__()
+ second = await read_stream.receive()
95
assert isinstance(second, SessionMessage)
96
assert second.message == valid
0 commit comments