fix: normalize streamed test chunks for mypy

This commit is contained in:
9qeklajc
2026-09-29 20:33:08 +02:00
parent b03d06bf5f
commit 9b07b4a7c8
+6 -1
View File
@@ -213,7 +213,12 @@ async def test_responses_idle_timeout_does_not_emit_completed(
result = await provider.handle_streaming_responses_completion(
response, key, 100, reservation_snapshot=MagicMock()
)
emitted = b"".join([chunk async for chunk in result.body_iterator])
emitted = b"".join(
[
chunk.encode() if isinstance(chunk, str) else bytes(chunk)
async for chunk in result.body_iterator
]
)
assert b'"type": "response.failed"' in emitted
assert b'"code": "UPSTREAM_TIMEOUT"' in emitted