Adapt test_response_decode_text_using_autodetect for chardet 6.0 (#3773)

This commit is contained in:
Ben Beasley 2026-02-23 10:40:42 +00:00 committed by GitHub
parent ae1b9f6623
commit b5addb64f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1011,7 +1011,10 @@ def test_response_decode_text_using_autodetect():
assert response.status_code == 200 assert response.status_code == 200
assert response.reason_phrase == "OK" 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 assert response.text == text