diff --git a/tests/unit/proxy/pass_through_endpoints/test_streaming_handler.py b/tests/unit/proxy/pass_through_endpoints/test_streaming_handler.py index d943b3cc433..bee4fec4771 100644 --- a/tests/unit/proxy/pass_through_endpoints/test_streaming_handler.py +++ b/tests/unit/proxy/pass_through_endpoints/test_streaming_handler.py @@ -182,6 +182,9 @@ async def test_interrupted_anthropic_stream_recovers_output_tokens_off_the_event logging_obj.get_router_model_id.return_value = None logging_obj.dispatch_success_handlers = AsyncMock() logging_obj.dispatch_failure_handlers = AsyncMock() + logging_obj.dispatch_attempt_failure_handlers = AsyncMock( + side_effect=logging_obj.dispatch_failure_handlers + ) _, took, lags = await timed_with_loop_lags( lambda: PassThroughStreamingHandler._route_streaming_logging_to_handler( @@ -198,6 +201,7 @@ async def test_interrupted_anthropic_stream_recovers_output_tokens_off_the_event ) logging_obj.dispatch_success_handlers.assert_not_awaited() + logging_obj.dispatch_attempt_failure_handlers.assert_awaited_once() logging_obj.dispatch_failure_handlers.assert_awaited_once() logged_usage = logging_obj.record_partial_usage_for_failure.call_args.kwargs["usage"] assert logged_usage.completion_tokens > 100_000