-
Notifications
You must be signed in to change notification settings - Fork 92
Open
Description
Is there a way to stream a response body? I need to mock an OpenAI-compatible API streaming call. I can do this mock quite easily with pytest-httpx, but I need to add an aiohttp-powered backend to my application, so I now need to do that mock in a way that aiohttp can use it.
It looks like #271 will add support for streaming requests, but I don't see a corresponding way of mocking streaming responses. I see that internally, aioresponses creates a stream reader, but then feeds the body directly into the stream and closes it. Unfortunately, because body is str|bytes, I don't see a way of forcing the stream to return chunks.
Is there a way to stream a mocked response body?
Metadata
Metadata
Assignees
Labels
No labels