From 39e8c0d96f2ea9563fc2bc42d5e0aaf61aa29370 Mon Sep 17 00:00:00 2001 From: Nate Prewitt Date: Tue, 6 Sep 2016 13:02:15 -0600 Subject: [PATCH] reverting 3357 and comparing properly encoded strings --- tests/test_requests.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_requests.py b/tests/test_requests.py index e77e024a..24f296f0 100755 --- a/tests/test_requests.py +++ b/tests/test_requests.py @@ -1026,13 +1026,13 @@ class TestRequests: # check raise_status falls back to ISO-8859-1 r = requests.Response() r.url = 'some url' - reason = b'Komponenttia ei l\xf6ydy' - r.reason = reason + reason = u'Komponenttia ei löydy' + r.reason = reason.encode('latin-1') r.status_code = 500 r.encoding = None with pytest.raises(requests.exceptions.HTTPError) as e: r.raise_for_status() - assert reason.decode('latin-1') in str(e) + assert reason in e.value.args[0] def test_response_chunk_size_type(self): """Ensure that chunk_size is passed as None or an integer, otherwise