From bf37cd221a9dc110361fbde6c334acf09d58b8f8 Mon Sep 17 00:00:00 2001 From: MarkXian Date: Fri, 28 Aug 2026 14:40:21 +0800 Subject: [PATCH] test: satisfy pytest raises lint rule --- tests/test_litellm/test_router.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/test_litellm/test_router.py b/tests/test_litellm/test_router.py index ea475c3277f..d61bd5f64f2 100644 --- a/tests/test_litellm/test_router.py +++ b/tests/test_litellm/test_router.py @@ -10709,11 +10709,16 @@ async def test_anthropic_messages_double_failure_holds_back_fallback_lifecycle_f response=primary_stream, initial_kwargs={"model": "primary"}, ) + collected = [] - with pytest.raises(litellm.APIError) as exc_info: + + async def collect_chunks(): async for chunk in wrapped: collected.append(chunk) + with pytest.raises(litellm.APIError) as exc_info: + await collect_chunks() + assert collected == [] assert exc_info.value is fallback_error