From 0a76a22f7e6fe998e7ac1958ac7d2f3312456f62 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