From ff2f693e0c6f0f6112ac8b158bdc9b1926a66b4a Mon Sep 17 00:00:00 2001 From: Jordan Cook Date: Mon, 15 May 2023 13:15:07 -0500 Subject: Add compatibility with urllib3 2.0 --- tests/integration/base_cache_test.py | 13 ++++--------- tests/unit/models/test_raw_response.py | 1 - 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'tests') diff --git a/tests/integration/base_cache_test.py b/tests/integration/base_cache_test.py index 3e4d230..44d45eb 100644 --- a/tests/integration/base_cache_test.py +++ b/tests/integration/base_cache_test.py @@ -261,21 +261,16 @@ class BaseCacheTest: assert response.from_cache is True assert response.is_expired is False - @pytest.mark.parametrize('stream', [True, False]) - def test_decode_gzip_response(self, stream): - """Test that gzip-compressed raw responses (including streamed responses) can be manually - decompressed with `decode_content=True` - """ + def test_decode_gzip_response(self): + """Test that gzip-compressed responses read decompressed content with decode_content=True""" session = self.init_session() - response = session.get(httpbin('gzip'), stream=stream) + response = session.get(httpbin('gzip')) assert b'gzipped' in response.content - if stream is True: - assert b'gzipped' in response.raw.read(None, decode_content=True) response.raw._fp = BytesIO(response.content) cached_response = CachedResponse.from_response(response) assert b'gzipped' in cached_response.content - assert b'gzipped' in cached_response.raw.read(None, decode_content=True) + assert b'gzipped' in cached_response.raw.read(amt=None, decode_content=True) @pytest.mark.parametrize('decode_content', [True, False]) @pytest.mark.parametrize('url', [MOCKED_URL_JSON, MOCKED_URL_JSON_LIST]) diff --git a/tests/unit/models/test_raw_response.py b/tests/unit/models/test_raw_response.py index 9ec1591..ea80e57 100644 --- a/tests/unit/models/test_raw_response.py +++ b/tests/unit/models/test_raw_response.py @@ -16,7 +16,6 @@ def test_from_response(mock_session): if hasattr(response.raw, '_request_url'): assert response.raw._request_url is raw.request_url is None assert response.raw.status == raw.status == 200 - assert response.raw.strict == raw.strict == 0 assert response.raw.version == raw.version == 0 -- cgit v1.2.1