Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
Fix how we test fallback to latin-1 reason encoding
Browse files Browse the repository at this point in the history
This was terribly broken and found while merging master into proposed/3.0.0
  • Loading branch information
sigmavirus24 committed Sep 6, 2016
1 parent 87f9693 commit 42d4eaf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,13 +1026,13 @@ def test_response_reason_unicode_fallback(self):
# check raise_status falls back to ISO-8859-1
r = requests.Response()
r.url = 'some url'
reason = u'Komponenttia ei löydy'
r.reason = reason.encode('latin-1')
reason = b'Komponenttia ei l\xf6ydy'
r.reason = reason
r.status_code = 500
r.encoding = None
with pytest.raises(requests.exceptions.HTTPError) as e:
r.raise_for_status()
assert reason in str(e)
assert reason.decode('latin-1') in str(e)

def test_response_chunk_size_type(self):
"""Ensure that chunk_size is passed as None or an integer, otherwise
Expand Down

0 comments on commit 42d4eaf

Please sign in to comment.