Skip to content
Myr

fix the tests for python 3

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Shivaram Lingamneni · committed by Shivaram Lingamneni · parent 000c105 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+2 added−2 removed

  • tests:+2 added−2 removed

1 file+2 added−2 removed

modified:tests/test_requests.py+2 added-2 removed
984 unmodified lines
985 # prefetch should persist across the redirect; if it doesn't,986 # this attempt to iterate will crash because the content has already987 # been read.988 first_line = next(res.iter_lines())989 self.assertTrue(first_line.strip().startswith('{'))989 self.assertTrue(first_line.strip().decode('utf-8').startswith('{'))990991 def test_prefetch_return_response_interaction(self):992 """Test that prefetch can be overridden as a kwarg to `send`."""993 req = requests.get(httpbin('get'), return_response=False)994 req.send(prefetch=False)995 # content should not have been prefetched, and iter_lines should succeed996 first_line = next(req.response.iter_lines())997 self.assertTrue(first_line.strip().startswith('{'))997 self.assertTrue(first_line.strip().decode('utf-8').startswith('{'))998999if __name__ == '__main__':1000 unittest.main()