Skip to content

Commit

Permalink
Fix StringIO issue in proxy adapter tests for python2.7 test environm…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
timcnicholls committed Apr 6, 2022
1 parent 4b6965a commit c3a2514
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tests/adapters/test_async_proxy_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ async def test_async_proxy_target_unknown_error(self, test_proxy_target):
async def test_async_proxy_target_traps_decode_error(self, test_proxy_target):
"""Test that a proxy target correctly traps errors decoding a non-JSON response body."""
mock_fetch = AsyncMock()
mock_fetch.return_value = HTTPResponse(Mock(), 200, buffer=StringIO("wibble"))
mock_fetch.return_value = HTTPResponse(Mock(), 200, buffer=StringIO(u"wibble"))

proxy_target = await AsyncProxyTarget(
test_proxy_target.name, test_proxy_target.url, test_proxy_target.request_timeout
Expand Down
2 changes: 1 addition & 1 deletion tests/adapters/test_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def test_proxy_target_unknown_error(self, test_proxy_target):
def test_proxy_target_traps_decode_error(self, test_proxy_target):
"""Test that a proxy target correctly traps errors decoding a non-JSON response body."""
mock_fetch = Mock()
mock_fetch.return_value = HTTPResponse(Mock(), 200, buffer=StringIO("wibble"))
mock_fetch.return_value = HTTPResponse(Mock(), 200, buffer=StringIO(u"wibble"))

proxy_target = ProxyTarget(
test_proxy_target.name, test_proxy_target.url, test_proxy_target.request_timeout
Expand Down

0 comments on commit c3a2514

Please sign in to comment.