From 1373debd61bc4db444906e1b8a3b7508a2637d48 Mon Sep 17 00:00:00 2001 From: Emerson Gomes Date: Mon, 2 Feb 2026 17:08:29 -0300 Subject: [PATCH] Update tests/test_litellm/litellm_core_utils/test_streaming_handler.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../test_litellm/litellm_core_utils/test_streaming_handler.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_litellm/litellm_core_utils/test_streaming_handler.py b/tests/test_litellm/litellm_core_utils/test_streaming_handler.py index 3c74d73288f..3448c5e4acf 100644 --- a/tests/test_litellm/litellm_core_utils/test_streaming_handler.py +++ b/tests/test_litellm/litellm_core_utils/test_streaming_handler.py @@ -1753,4 +1753,8 @@ async def test_custom_stream_wrapper_anext_does_not_block_event_loop_for_sync_it finally: if not anext_task.done(): anext_task.cancel() + try: + await anext_task + except asyncio.CancelledError: + pass await bg_task