From cc4917efece8ff7d6d749b9711a4ff55c061dbc3 Mon Sep 17 00:00:00 2001 From: stumpylog <797416+stumpylog@users.noreply.github.com> Date: Thu, 23 Jul 2026 14:06:37 -0700 Subject: [PATCH] Test: remove test asserting Python's own compression behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit test_compressing_method_beats_stored asserted that DEFLATED produces a smaller archive than STORED — that's zlib's job, not ours. test_compression_method_is_applied_to_file_entries already covers what our code is actually responsible for: threading the requested compression method through to the zip entry's compress_type. --- src/documents/tests/export/test_sinks.py | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/documents/tests/export/test_sinks.py b/src/documents/tests/export/test_sinks.py index a19de4504..29428a6ee 100644 --- a/src/documents/tests/export/test_sinks.py +++ b/src/documents/tests/export/test_sinks.py @@ -304,30 +304,6 @@ class TestZipExportSinkCompression: info = zf.getinfo("doc.pdf") assert info.compress_type == constant - def test_compressing_method_beats_stored( - self, - tmp_path: Path, - large_source_file: Path, - ) -> None: - # Robust size invariant: a compressing method must be <= stored on - # compressible content (avoids flaky level-9-vs-level-1 comparisons). - sizes: dict[str, int] = {} - for name, constant in ( - ("stored", zipfile.ZIP_STORED), - ("deflated", zipfile.ZIP_DEFLATED), - ): - target: Path = tmp_path / name - target.mkdir() - with ZipExportSink( - target, - "export", - delete=False, - compression=constant, - ) as sink: - sink.add_file(large_source_file, "doc.pdf") - sizes[name] = (target / "export.zip").stat().st_size - assert sizes["deflated"] <= sizes["stored"] - class TestStreamContract: @pytest.fixture(params=["dir", "zip"])