Skip to content

Commit b5addb6

Browse files
Adapt test_response_decode_text_using_autodetect for chardet 6.0 (#3773)
1 parent ae1b9f6 commit b5addb6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/models/test_responses.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,10 @@ def test_response_decode_text_using_autodetect():
10111011

10121012
assert response.status_code == 200
10131013
assert response.reason_phrase == "OK"
1014-
assert response.encoding == "ISO-8859-1"
1014+
# The encoded byte string is consistent with either ISO-8859-1 or
1015+
# WINDOWS-1252. Versions <6.0 of chardet claim the former, while chardet
1016+
# 6.0 detects the latter.
1017+
assert response.encoding in ("ISO-8859-1", "WINDOWS-1252")
10151018
assert response.text == text
10161019

10171020

0 commit comments

Comments
 (0)