Moses Paul R commited on
Commit
72d2813
·
1 Parent(s): 1aa3752

add config to all builders and providers [skip ci]

Browse files
Files changed (1) hide show
  1. tests/conftest.py +7 -4
tests/conftest.py CHANGED
@@ -65,9 +65,12 @@ def pdf_provider(request):
65
 
66
 
67
  @pytest.fixture(scope="function")
68
- def pdf_document(pdf_provider, layout_model, recognition_model, detection_model) -> Document:
69
- layout_builder = LayoutBuilder(layout_model)
70
- ocr_builder = OcrBuilder(detection_model, recognition_model)
71
- builder = DocumentBuilder()
 
 
 
72
  document = builder(pdf_provider, layout_builder, ocr_builder)
73
  return document
 
65
 
66
 
67
  @pytest.fixture(scope="function")
68
+ def pdf_document(request, pdf_provider, layout_model, recognition_model, detection_model) -> Document:
69
+ config_mark = request.node.get_closest_marker("config")
70
+ config = config_mark.args[0] if config_mark else None
71
+
72
+ layout_builder = LayoutBuilder(layout_model, config)
73
+ ocr_builder = OcrBuilder(detection_model, recognition_model, config)
74
+ builder = DocumentBuilder(config)
75
  document = builder(pdf_provider, layout_builder, ocr_builder)
76
  return document