MCPcopy
hub / github.com/encode/httpx / test_cannot_read_after_stream_consumed

Function test_cannot_read_after_stream_consumed

tests/models/test_responses.py:717–728  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

715
716
717def test_cannot_read_after_stream_consumed():
718 response = httpx.Response(
719 200,
720 content=streaming_body(),
721 )
722
723 content = b""
724 for part in response.iter_bytes():
725 content += part
726
727 with pytest.raises(httpx.StreamConsumed):
728 response.read()
729
730
731@pytest.mark.anyio

Callers

nothing calls this directly

Calls 3

iter_bytesMethod · 0.95
readMethod · 0.95
streaming_bodyFunction · 0.70

Tested by

no test coverage detected