Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

test(anthropic): fix PT012 lint violation in upstream-error regression test

nuernbere1fece511a20
diff --git a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_streaming_iterator.py b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_streaming_iterator.py
index f0a3c7fdff0..6a1b6f417a2 100644
--- a/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_streaming_iterator.py
+++ b/tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_streaming_iterator.py
@@ -501,10 +501,14 @@ async def test_async_sse_wrapper_reraises_upstream_error_to_connected_client():
)
received = []
- with pytest.raises(_ProviderStreamError) as excinfo:
+
+ async def _drain():
async for chunk in iterator.async_sse_wrapper(_failing_stream()):
received.append(chunk)
+ with pytest.raises(_ProviderStreamError) as excinfo:
+ await _drain()
+
assert excinfo.value.status_code == 529
assert received
assert not any(c.startswith(b"event: error\n") for c in received)