From 67c156f2134578de5bf447b453cee83fce403414 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Tue, 22 Sep 2026 19:16:17 -0700 Subject: [PATCH] test(bedrock): take the gated byte stream's chunks as an immutable Sequence --- .../test_anthropic_claude3_transformation.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_litellm/llms/bedrock/messages/invoke_transformations/test_anthropic_claude3_transformation.py b/tests/test_litellm/llms/bedrock/messages/invoke_transformations/test_anthropic_claude3_transformation.py index 208ffaa0073..f4d51d975bb 100644 --- a/tests/test_litellm/llms/bedrock/messages/invoke_transformations/test_anthropic_claude3_transformation.py +++ b/tests/test_litellm/llms/bedrock/messages/invoke_transformations/test_anthropic_claude3_transformation.py @@ -7,7 +7,7 @@ import struct import zlib from datetime import datetime from types import SimpleNamespace -from collections.abc import AsyncIterator, Mapping +from collections.abc import AsyncIterator, Mapping, Sequence from typing import Final from unittest.mock import Mock @@ -3427,7 +3427,7 @@ def _bedrock_event_frame(payload: Mapping[str, object]) -> bytes: class _GatedAsyncByteStream(httpx.AsyncByteStream): - def __init__(self, chunks: list[bytes], gate: asyncio.Event) -> None: + def __init__(self, chunks: Sequence[bytes], gate: asyncio.Event) -> None: self._chunks = chunks self._gate = gate @@ -3447,7 +3447,7 @@ async def test_get_async_streaming_response_iterator_yields_small_frame_before_u response: Final = httpx.Response( 200, stream=_GatedAsyncByteStream( - chunks=[ + chunks=( _bedrock_event_frame( { "type": "message_start", @@ -3467,7 +3467,7 @@ async def test_get_async_streaming_response_iterator_yields_small_frame_before_u "usage": {"input_tokens": 3, "output_tokens": 9}, } ), - ], + ), gate=gate, ), )