From e1fece511a20298f16926a8b595850a093cfe34f Mon Sep 17 00:00:00 2001 From: nuernber Date: Mon, 31 Aug 2026 09:11:51 -0700 Subject: [PATCH] test(anthropic): fix PT012 lint violation in upstream-error regression test --- .../messages/test_streaming_iterator.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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)