From 642fc999680c5de4f37733c9b6fa8b7d7b4aee7c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 6 Feb 2025 10:27:02 -0600 Subject: [PATCH] Disable writelines for test_write_large_payload_deflate_compression_data_in_eof (#10423) (cherry picked from commit 51daf7190e7674773c22011a4e443df8b5e66437) --- CHANGES/10423.packaging.rst | 1 + tests/test_http_writer.py | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100644 CHANGES/10423.packaging.rst diff --git a/CHANGES/10423.packaging.rst b/CHANGES/10423.packaging.rst new file mode 100644 index 00000000000..6cf58c5a10b --- /dev/null +++ b/CHANGES/10423.packaging.rst @@ -0,0 +1 @@ +Fixed test ``test_write_large_payload_deflate_compression_data_in_eof_writelines`` failing with Python 3.12.9+ or 3.13.2+ -- by :user:`bdraco`. diff --git a/tests/test_http_writer.py b/tests/test_http_writer.py index 677b5bc9678..c39fe3c7251 100644 --- a/tests/test_http_writer.py +++ b/tests/test_http_writer.py @@ -19,6 +19,12 @@ def enable_writelines() -> Generator[None, None, None]: yield +@pytest.fixture +def disable_writelines() -> Generator[None, None, None]: + with mock.patch("aiohttp.http_writer.SKIP_WRITELINES", True): + yield + + @pytest.fixture def force_writelines_small_payloads() -> Generator[None, None, None]: with mock.patch("aiohttp.http_writer.MIN_PAYLOAD_FOR_WRITELINES", 1): @@ -104,6 +110,7 @@ async def test_write_payload_length(protocol, transport, loop) -> None: assert b"da" == content.split(b"\r\n\r\n", 1)[-1] +@pytest.mark.usefixtures("disable_writelines") async def test_write_large_payload_deflate_compression_data_in_eof( protocol: BaseProtocol, transport: asyncio.Transport,