From 56ba15d2e09700621e09a3156167da0d1c69f031 Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Mon, 16 Nov 2026 09:15:38 -0800 Subject: [PATCH] Chore: remove unused test helpers Drops the shared_samples_dir fixture, MailAttachmentMock, _SHORT_TEXT and _make_extract_text, none of which any test used. --- src/conftest.py | 6 ------ src/paperless/tests/parsers/test_mail_parser_live.py | 7 ------- src/paperless/tests/parsers/test_parse_modes.py | 10 ---------- 3 files changed, 23 deletions(-) diff --git a/src/conftest.py b/src/conftest.py index 91f5635a2f..5f53c25a6f 100644 --- a/src/conftest.py +++ b/src/conftest.py @@ -153,12 +153,6 @@ def fake_progress_manager( return FakeProgressManager -@pytest.fixture(scope="session") -def shared_samples_dir() -> Path: - """Directory of sample files used by more than one app's tests.""" - return samples.SHARED_SAMPLES_DIR - - @pytest.fixture(scope="session") def simple_digital_pdf_file() -> Path: """One-page PDF with a text layer.""" diff --git a/src/paperless/tests/parsers/test_mail_parser_live.py b/src/paperless/tests/parsers/test_mail_parser_live.py index a91b25ec30..6125a71929 100644 --- a/src/paperless/tests/parsers/test_mail_parser_live.py +++ b/src/paperless/tests/parsers/test_mail_parser_live.py @@ -37,13 +37,6 @@ def extract_text(pdf_path: Path) -> str: return tmp.read() -class MailAttachmentMock: - def __init__(self, payload: bytes, content_id: str) -> None: - self.payload = payload - self.content_id = content_id - self.content_type = "image/png" - - @pytest.mark.live @pytest.mark.nginx @pytest.mark.skipif( diff --git a/src/paperless/tests/parsers/test_parse_modes.py b/src/paperless/tests/parsers/test_parse_modes.py index 1c1f4bd48e..7f86eae885 100644 --- a/src/paperless/tests/parsers/test_parse_modes.py +++ b/src/paperless/tests/parsers/test_parse_modes.py @@ -29,16 +29,6 @@ if TYPE_CHECKING: # --------------------------------------------------------------------------- _LONG_TEXT = "This is a test document with enough text. " * 5 # >50 chars -_SHORT_TEXT = "Hi." # <50 chars - - -def _make_extract_text(text: str | None): - """Return a side_effect function for ``extract_text`` that returns *text*.""" - - def _extract(sidecar_file, pdf_file): - return text - - return _extract # ---------------------------------------------------------------------------