diff --git a/tests/unit/router_utils/test_fallback_event_handlers.py b/tests/unit/router_utils/test_fallback_event_handlers.py index 70b15e85c13..72477279c5e 100644 --- a/tests/unit/router_utils/test_fallback_event_handlers.py +++ b/tests/unit/router_utils/test_fallback_event_handlers.py @@ -1224,9 +1224,9 @@ class TestRunAsyncFallbackTriggersCooldown: async def async_function_with_fallbacks(self, *args, **kwargs): raise RuntimeError("fallback model also failed") - def _logging_obj(self, has_logged_async_failure: bool) -> MagicMock: - logging_obj = MagicMock() - logging_obj.model_call_details = {"has_logged_async_failure": has_logged_async_failure} + def _logging_obj(self, has_logged_async_failure: bool) -> Logging: + logging_obj: Final = _request_logging_obj() + logging_obj.model_call_details["has_logged_async_failure"] = has_logged_async_failure return logging_obj @pytest.mark.asyncio