diff --git a/test/test_networking.py b/test/test_networking.py index afdd0c7aa7..e972f597b5 100644 --- a/test/test_networking.py +++ b/test/test_networking.py @@ -3,6 +3,7 @@ # Allow direct execution import os import sys +from unittest.mock import MagicMock import pytest @@ -614,8 +615,11 @@ class TestHTTPRequestHandler(TestRequestHandlerBase): @pytest.mark.skip_handler('CurlCFFI', 'not supported by curl-cffi') def test_gzip_trailing_garbage(self, handler): with handler() as rh: - data = validate_and_send(rh, Request(f'http://localhost:{self.http_port}/trailing_garbage')).read().decode() + res = validate_and_send(rh, Request(f'http://localhost:{self.http_port}/trailing_garbage')) + data = res.read().decode() assert data == '