docling separation

This commit is contained in:
Pavel committed 2026-08-27 17:36:38 +04:00
1 parent e101c0a7f1
commit d7a7d4d084
12 files changed
+100 -13

No files matched your search

+12
View File
@@ -910,6 +910,12 @@ class TestApplyInferenceSettings:
and buys nothing for one-shot parses.
"""
@pytest.fixture(autouse=True)
def _requires_docling(self):
# These tests reach into docling.datamodel.settings for real; a base
# install (docling is an optional extra) skips them.
pytest.importorskip("docling")
def test_disables_torch_compile_by_default(self, monkeypatch):
from application.parser.file.docling_parser import _apply_inference_settings
@@ -1412,6 +1418,12 @@ class TestOCRDropoutHelpers:
class TestForceFullPageOCRWiring:
"""``force_full_page_ocr`` must reach the pipeline for any OCR engine."""
@pytest.fixture(autouse=True)
def _requires_docling(self):
# Builds real ``docling.datamodel.pipeline_options``; a base install
# (docling is an optional extra) skips these.
pytest.importorskip("docling")
def _pipeline_options(self, monkeypatch, **kwargs):
import docling.datamodel.pipeline_options as dpo
+4
View File
@@ -158,6 +158,10 @@ def test_threshold_sends_sparse_text_to_fallback(tmp_path, parser_cls):
@pytest.fixture
def docling_engine(monkeypatch):
# The wiring assertions below expect the docling map; on a base install
# (docling is an optional extra) the engine degrades to the legacy
# parsers and these tests do not apply.
pytest.importorskip("docling")
from application.core.settings import settings
monkeypatch.setattr(settings, "DOC_PARSER_ENGINE", "docling")