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.
This commit is contained in:
Vineeth Sai 2026-08-25 13:10:09 -07:00
parent cca2c71e8e
commit da727c90f4

View file

@ -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")