From b92f9cb35224a9c27778e122ed0bd6a21eb6814d Mon Sep 17 00:00:00 2001 From: Harshit Jain <48647625+Harshit28j@users.noreply.github.com> Date: Fri, 27 Feb 2026 22:10:33 +0530 Subject: [PATCH] Update tests/pass_through_unit_tests/test_unit_test_streaming.py Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> --- .../test_unit_test_streaming.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/pass_through_unit_tests/test_unit_test_streaming.py b/tests/pass_through_unit_tests/test_unit_test_streaming.py index 8b9633a20de..f4f4f53dfe3 100644 --- a/tests/pass_through_unit_tests/test_unit_test_streaming.py +++ b/tests/pass_through_unit_tests/test_unit_test_streaming.py @@ -174,11 +174,12 @@ async def test_chunk_processor_passes_kwargs_to_logging_handler(): # Verify async_success_handler was called with kwargs containing # the API key metadata from input_kwargs - if litellm_logging_obj.async_success_handler.called: - call_kwargs = litellm_logging_obj.async_success_handler.call_args - # The handler_kwargs are spread as **kwargs, check they include response_cost - # (set by the Anthropic handler) and that litellm_params metadata was preserved - assert call_kwargs is not None, "async_success_handler was called but with no args" + assert litellm_logging_obj.async_success_handler.called, \ + "async_success_handler should have been called after streaming completed" + call_kwargs = litellm_logging_obj.async_success_handler.call_args + # The handler_kwargs are spread as **kwargs, check they include response_cost + # (set by the Anthropic handler) and that litellm_params metadata was preserved + assert call_kwargs is not None, "async_success_handler was called but with no args" def test_convert_raw_bytes_to_str_lines():