diff --git a/tests/test_litellm/test_main.py b/tests/test_litellm/test_main.py index bc630fc5b81..70664827253 100644 --- a/tests/test_litellm/test_main.py +++ b/tests/test_litellm/test_main.py @@ -1335,6 +1335,8 @@ def test_anthropic_text_disable_url_suffix_env_var(): def test_image_edit_merges_headers_and_extra_headers(): + from litellm.images.main import base_llm_http_handler + combined_headers = { "x-test-header-one": "value-1", "x-test-header-two": "value-2", @@ -1351,8 +1353,9 @@ def test_image_edit_merges_headers_and_extra_headers(): "litellm.images.main.ProviderConfigManager.get_provider_image_edit_config", return_value=mock_image_edit_config, ) as mock_config, - patch( - "litellm.images.main.base_llm_http_handler.image_edit_handler", + patch.object( + base_llm_http_handler, + "image_edit_handler", return_value="ok", ) as mock_handler, ): diff --git a/tests/test_litellm/vector_stores/test_vector_store_registry.py b/tests/test_litellm/vector_stores/test_vector_store_registry.py index 50177584245..ef8afe31c65 100644 --- a/tests/test_litellm/vector_stores/test_vector_store_registry.py +++ b/tests/test_litellm/vector_stores/test_vector_store_registry.py @@ -133,14 +133,10 @@ def test_add_vector_store_to_registry(): -@respx.mock def test_search_uses_registry_credentials(): """search() should pull credentials from vector_store_registry when available""" - # Import the actual instance to patch it correctly - from litellm.vector_stores.main import base_llm_http_handler - - # Block all HTTP requests at the network level to prevent real API calls - respx.route().mock(return_value=httpx.Response(200, json={"object": "list", "data": []})) + # Import the module to get the actual handler instance + import litellm.vector_stores.main as vector_stores_main vector_store = LiteLLM_ManagedVectorStore( vector_store_id="vs1", @@ -172,7 +168,7 @@ def test_search_uses_registry_credentials(): "litellm.vector_stores.main.ProviderConfigManager.get_provider_vector_stores_config", return_value=MagicMock(), ), patch.object( - base_llm_http_handler, + vector_stores_main.base_llm_http_handler, "vector_store_search_handler", return_value=mock_search_response, ) as mock_handler: