Skip to content

Commit

Permalink
add config to all builders and providers [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
iammosespaulr committed Nov 18, 2024
1 parent 56e0f7a commit 5df6001
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 5df6001

Please sign in to comment.