diff --git a/tests/httpx2/client/test_client.py b/tests/httpx2/client/test_client.py index 7ad44a3f..96730e5b 100644 --- a/tests/httpx2/client/test_client.py +++ b/tests/httpx2/client/test_client.py @@ -429,7 +429,10 @@ def cp1252_but_no_content_type(request: httpx2.Request) -> httpx2.Response: assert response.status_code == 200 assert response.reason_phrase == "OK" - assert response.encoding == "ISO-8859-1" + # The encoded byte string is consistent with either ISO-8859-1 or + # WINDOWS-1252. Versions <6.0 of chardet claim the former, while + # chardet 6.0 detects the latter. + assert response.encoding in ("ISO-8859-1", "WINDOWS-1252") assert response.text == text @@ -456,5 +459,8 @@ def cp1252_but_no_content_type(request: httpx2.Request) -> httpx2.Response: assert response.status_code == 200 assert response.reason_phrase == "OK" - assert response.encoding == "ISO-8859-1" + # The encoded byte string is consistent with either ISO-8859-1 or + # WINDOWS-1252. Versions <6.0 of chardet claim the former, while + # chardet 6.0 detects the latter. + assert response.encoding in ("ISO-8859-1", "WINDOWS-1252") assert response.text == text