From 225d01cb4f6fb5471d637e60cc606027c02858a8 Mon Sep 17 00:00:00 2001 From: mateo-berri <277851410+mateo-berri@users.noreply.github.com> Date: Fri, 1 May 2026 14:07:32 -0700 Subject: [PATCH] fix(tests): use github-hosted PDF fixture for Anthropic Files API test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Anthropic's URL fetcher intermittently returns 400 'Unable to download the file' for the Wikipedia URL the test was using. Point it at the repo's existing tests/llm_translation/fixtures/dummy.pdf via raw GitHub instead — small, deterministic, reliably fetchable. With a stable URL the test no longer needs to be opted out of VCR; remove it from the incompatible list so it can replay from cassette. --- tests/llm_translation/base_llm_unit_tests.py | 5 ++++- tests/llm_translation/conftest.py | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/llm_translation/base_llm_unit_tests.py b/tests/llm_translation/base_llm_unit_tests.py index f3b1895323c..61ae5945320 100644 --- a/tests/llm_translation/base_llm_unit_tests.py +++ b/tests/llm_translation/base_llm_unit_tests.py @@ -401,7 +401,10 @@ class BaseLLMChatTest(ABC): { "type": "file", "file": { - "file_id": "https://upload.wikimedia.org/wikipedia/commons/2/20/Re_example.pdf" + # GitHub-hosted fixture (small, deterministic, reliably + # fetchable from Anthropic's egress) instead of a Wikipedia + # URL that intermittently returns 400 "Unable to download". + "file_id": "https://raw.githubusercontent.com/BerriAI/litellm/main/tests/llm_translation/fixtures/dummy.pdf" }, }, ] diff --git a/tests/llm_translation/conftest.py b/tests/llm_translation/conftest.py index 540518124dc..afd48bb6742 100644 --- a/tests/llm_translation/conftest.py +++ b/tests/llm_translation/conftest.py @@ -63,8 +63,6 @@ _VCR_INCOMPATIBLE_NODEID_SUFFIXES = frozenset( # Provider prompt-cache propagation isn't deterministic between two # back-to-back calls; the test is flaky against the live provider. "::test_prompt_caching", - # Wikipedia URL fetch through Anthropic Files API is flaky upstream. - "::test_async_pdf_handling_with_file_id", # Bedrock Nova returns tool_call vs JSON nondeterministically; the # base assertion expects JSON. Other providers' versions of this # test are healthy, so we narrow with a class-name guard below.