From 02b97fbaaf85d0ea01a544d7a1291ad6cf4fd6db Mon Sep 17 00:00:00 2001 From: stumpylog <797416+stumpylog@users.noreply.github.com> Date: Wed, 22 Jul 2026 15:38:55 -0700 Subject: [PATCH] Fix: de-duplicate source_file fixture across sink test classes TestDirectoryExportSink and TestZipExportSink each defined an identical source_file fixture; hoist it to module scope. --- src/documents/tests/export/test_sinks.py | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/documents/tests/export/test_sinks.py b/src/documents/tests/export/test_sinks.py index a61b3bb84..2425c816a 100644 --- a/src/documents/tests/export/test_sinks.py +++ b/src/documents/tests/export/test_sinks.py @@ -13,6 +13,14 @@ from documents.export.sinks import ZipExportSink from documents.export.sinks import _dumps +@pytest.fixture() +def source_file(tmp_path: Path) -> Path: + src: Path = tmp_path / "src" / "doc.pdf" + src.parent.mkdir(parents=True) + src.write_bytes(b"PDF-CONTENT") + return src + + class TestDumps: def test_dumps_is_indented_unicode_json(self) -> None: result: str = _dumps({"a": "é", "b": 1}) @@ -38,13 +46,6 @@ class TestStreamingManifestWriter: class TestDirectoryExportSink: - @pytest.fixture() - def source_file(self, tmp_path: Path) -> Path: - src: Path = tmp_path / "src" / "doc.pdf" - src.parent.mkdir(parents=True) - src.write_bytes(b"PDF-CONTENT") - return src - def test_add_file_copies_to_relative_arcname( self, tmp_path: Path, @@ -174,13 +175,6 @@ class TestDirectoryExportSink: class TestZipExportSink: - @pytest.fixture() - def source_file(self, tmp_path: Path) -> Path: - src: Path = tmp_path / "src" / "doc.pdf" - src.parent.mkdir(parents=True) - src.write_bytes(b"PDF-CONTENT") - return src - def test_round_trip_files_json_and_stream( self, tmp_path: Path,