From 5df6001ec4cf6656990ec46bf8798b0e18bf9f7a Mon Sep 17 00:00:00 2001 From: Moses Paul R Date: Mon, 18 Nov 2024 15:58:21 +0000 Subject: [PATCH] add config to all builders and providers [skip ci] --- tests/conftest.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 41485628..178470a6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -65,9 +65,12 @@ def pdf_provider(request): @pytest.fixture(scope="function") -def pdf_document(pdf_provider, layout_model, recognition_model, detection_model) -> Document: - layout_builder = LayoutBuilder(layout_model) - ocr_builder = OcrBuilder(detection_model, recognition_model) - builder = DocumentBuilder() +def pdf_document(request, pdf_provider, layout_model, recognition_model, detection_model) -> Document: + config_mark = request.node.get_closest_marker("config") + config = config_mark.args[0] if config_mark else None + + layout_builder = LayoutBuilder(layout_model, config) + ocr_builder = OcrBuilder(detection_model, recognition_model, config) + builder = DocumentBuilder(config) document = builder(pdf_provider, layout_builder, ocr_builder) return document