From 49e1ebb6209946f79768ba90579d0dabe9b6d44d Mon Sep 17 00:00:00 2001 From: Trenton H <797416+stumpylog@users.noreply.github.com> Date: Thu, 19 Mar 2026 08:34:59 -0700 Subject: [PATCH] Fix(tests): add configure() to DummyParser and missing-method parametrize ParserProtocol now requires configure(context: ParserContext) -> None. Update DummyParser in test_registry.py to implement it, and add 'missing-configure' to the test_partial_compliant_fails_isinstance parametrize list so the new method is covered by the negative test. Co-Authored-By: Claude Sonnet 4.6 --- src/paperless/tests/test_registry.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/paperless/tests/test_registry.py b/src/paperless/tests/test_registry.py index 80c686bc4..5c2d20d50 100644 --- a/src/paperless/tests/test_registry.py +++ b/src/paperless/tests/test_registry.py @@ -18,6 +18,7 @@ from unittest.mock import patch import pytest +from paperless.parsers import ParserContext from paperless.parsers import ParserProtocol from paperless.parsers.registry import ParserRegistry from paperless.parsers.registry import get_parser_registry @@ -103,6 +104,11 @@ def dummy_parser_cls() -> type: ) -> list: return [] + def configure(self, context: ParserContext) -> None: + """ + Required to exist, but doesn't need to do anything + """ + def __enter__(self) -> Self: return self @@ -144,6 +150,7 @@ class TestParserProtocol: @pytest.mark.parametrize( "missing_method", [ + pytest.param("configure", id="missing-configure"), pytest.param("parse", id="missing-parse"), pytest.param("get_text", id="missing-get_text"), pytest.param("get_thumbnail", id="missing-get_thumbnail"),