From da727c90f4cd1322752d5f1be2f3ca44b432f083 Mon Sep 17 00:00:00 2001 From: Vineeth Sai Date: Tue, 25 Aug 2026 13:10:09 -0700 Subject: [PATCH] chore(tests): match the ValueError message in the fallback assertion PT011: a bare pytest.raises(ValueError) is too broad. Match the message the fallback actually raises so the test cannot pass on some unrelated ValueError. --- .../test_litellm_core_utils_prompt_templates_common_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_common_utils.py b/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_common_utils.py index 398e0c1c994..3b5b420be98 100644 --- a/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_common_utils.py +++ b/tests/test_litellm/litellm_core_utils/prompt_templates/test_litellm_core_utils_prompt_templates_common_utils.py @@ -1060,5 +1060,5 @@ class TestInferContentTypeQueryString: def test_a_url_with_no_usable_extension_still_raises(self): # The fallback is unchanged: non-image bytes with no known extension # have nothing left to infer from. - with pytest.raises(ValueError): + with pytest.raises(ValueError, match="Unable to determine content type from URL"): self._infer("https://cdn.example.com/download?id=1.2", b"not-an-image")