(async_client: AsyncOpenAI)
| 109 | |
| 110 | @pytest.mark.asyncio |
| 111 | async def test_async_response_parse_custom_stream(async_client: AsyncOpenAI) -> None: |
| 112 | response = AsyncAPIResponse( |
| 113 | raw=httpx.Response(200, content=b"foo"), |
| 114 | client=async_client, |
| 115 | stream=True, |
| 116 | stream_cls=None, |
| 117 | cast_to=str, |
| 118 | options=FinalRequestOptions.construct(method="get", url="/foo"), |
| 119 | ) |
| 120 | |
| 121 | stream = await response.parse(to=Stream[int]) |
| 122 | assert stream._cast_to == int |
| 123 | |
| 124 | |
| 125 | class CustomModel(BaseModel): |
nothing calls this directly
no test coverage detected