File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed
Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -83,14 +83,12 @@ async def test_stdio_server_invalid_utf8(monkeypatch: pytest.MonkeyPatch):
8383 with anyio .fail_after (5 ):
8484 async with stdio_server () as (read_stream , write_stream ):
8585 await write_stream .aclose ()
86- async with read_stream :
87- it = read_stream .__aiter__ ()
88-
86+ async with read_stream : # pragma: no branch
8987 # First line: \xff\xfe -> U+FFFD U+FFFD -> JSON parse fails -> exception in stream
90- first = await it . __anext__ ()
88+ first = await read_stream . receive ()
9189 assert isinstance (first , Exception )
9290
9391 # Second line: valid message still comes through
94- second = await it . __anext__ ()
92+ second = await read_stream . receive ()
9593 assert isinstance (second , SessionMessage )
9694 assert second .message == JSONRPCMessage (root = valid )
You can’t perform that action at this time.
0 commit comments