From 23c27fc3050f25a65629fe6578915e8011fe68d9 Mon Sep 17 00:00:00 2001 From: Milan Date: Fri, 8 May 2026 15:19:57 +0300 Subject: [PATCH] test: move safe_deep_copy import to module scope Co-authored-by: Cursor --- tests/local_testing/test_router_fallback_handlers.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/local_testing/test_router_fallback_handlers.py b/tests/local_testing/test_router_fallback_handlers.py index f2fbdceb672..1ab872efbe2 100644 --- a/tests/local_testing/test_router_fallback_handlers.py +++ b/tests/local_testing/test_router_fallback_handlers.py @@ -15,6 +15,7 @@ from unittest.mock import AsyncMock, MagicMock, patch import litellm from litellm import Router from litellm.integrations.custom_logger import CustomLogger +from litellm.litellm_core_utils.core_helpers import safe_deep_copy from typing import Any, Dict, List from litellm.router_utils.fallback_event_handlers import ( @@ -329,10 +330,6 @@ async def test_fallback_kwargs_not_mutated(): `safe_deep_copy` call is removed, only a shallow reference is passed and `safe_deep_copy` is never called — causing this test to fail. """ - from litellm.litellm_core_utils.core_helpers import ( - safe_deep_copy as _real_safe_deep_copy, - ) - router = Router( model_list=[ { @@ -396,7 +393,7 @@ async def test_fallback_kwargs_not_mutated(): with patch( "litellm.router_utils.fallback_event_handlers.safe_deep_copy", - wraps=_real_safe_deep_copy, + wraps=safe_deep_copy, ) as mock_sdc: with pytest.raises(Exception): await run_async_fallback(