From b6a11fcc78cb453d209d151e8dde50d331e18f37 Mon Sep 17 00:00:00 2001 From: Alexsander Hamir Date: Mon, 26 Jan 2026 10:58:39 -0800 Subject: [PATCH] test: add explicit mock verification in test_provider_support - Capture mock handler with 'as mock_handler' for explicit validation - Add assert_called_once() to verify mock was actually used - Ensures test verifies no real API calls are made - Follows same pattern as test_openai_env_base validation --- tests/test_litellm/containers/test_container_integration.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_litellm/containers/test_container_integration.py b/tests/test_litellm/containers/test_container_integration.py index ee61e2f54ad..d36918c63b9 100644 --- a/tests/test_litellm/containers/test_container_integration.py +++ b/tests/test_litellm/containers/test_container_integration.py @@ -385,10 +385,12 @@ class TestContainerIntegration: name="Provider Test Container" ) - with patch.object(litellm.main.base_llm_http_handler, 'container_create_handler', return_value=mock_response): + with patch.object(litellm.main.base_llm_http_handler, 'container_create_handler', return_value=mock_response) as mock_handler: response = create_container( name="Provider Test Container", custom_llm_provider=provider ) assert response.name == "Provider Test Container" + # Verify the mock was actually called (not making real API calls) + mock_handler.assert_called_once()