mirror of
https://github.com/tiennm99/DocsGPT.git
synced 2026-10-14 20:16:48 +00:00
docling separation
This commit is contained in:
1 parent
e101c0a7f1
commit
d7a7d4d084
12 files changed
+100
-13
No files matched your search
@@ -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
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -12,3 +12,6 @@ jupyter-client>=8.0
|
||||
# (python-pptx and openpyxl already ship in application/requirements.txt).
|
||||
python-docx>=1.1
|
||||
reportlab>=4.0,<5
|
||||
# The optional docling engine stays installed in the test env so its parser
|
||||
# paths keep CI coverage even though production installs it on demand.
|
||||
-r ../application/requirements-docling.txt
|
||||
Reference in new issue
Block a user