From 58fd3ea5a8f04a6f9ba88a95ab4790ec2195b493 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 20 Mar 2026 17:05:42 +0000 Subject: [PATCH] test: isolate anthropic missing-api-key case from env creds Co-authored-by: Ishaan Jaff --- .../anthropic/test_anthropic_files_and_batches.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/test_litellm/llms/anthropic/test_anthropic_files_and_batches.py b/tests/test_litellm/llms/anthropic/test_anthropic_files_and_batches.py index 47571220175..08719c50a0b 100644 --- a/tests/test_litellm/llms/anthropic/test_anthropic_files_and_batches.py +++ b/tests/test_litellm/llms/anthropic/test_anthropic_files_and_batches.py @@ -337,11 +337,12 @@ class TestAnthropicFilesHandler: } with patch.object(handler.anthropic_model_info, "get_api_key", return_value=None): - with pytest.raises(ValueError, match="Missing Anthropic API Key"): - await handler.afile_content( - file_content_request=file_content_request, - api_key=None - ) + with patch.object(handler.anthropic_model_info, "get_auth_header", return_value=None): + with pytest.raises(ValueError, match="Missing Anthropic API Key"): + await handler.afile_content( + file_content_request=file_content_request, + api_key=None + ) @pytest.mark.asyncio async def test_afile_content_missing_file_id(self, handler):