Guard all docling-dependent tests for lightweight CI
local_converter imports docling at module level, so any test that touches it crashes when docling is not installed. Skip those tests with importorskip / skipif so the CI (which only has docling-core) passes cleanly.
This commit is contained in:
parent
41863152cb
commit
1c82a80389
1 changed files with 11 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import importlib
|
||||||
import json
|
import json
|
||||||
from unittest.mock import AsyncMock, MagicMock, patch
|
from unittest.mock import AsyncMock, MagicMock, patch
|
||||||
|
|
||||||
|
|
@ -16,6 +17,12 @@ from infra.serve_converter import (
|
||||||
_parse_response,
|
_parse_response,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _has_docling() -> bool:
|
||||||
|
"""Return True if the heavy docling library is available."""
|
||||||
|
return importlib.util.find_spec("docling") is not None
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# Unit tests — form data building
|
# Unit tests — form data building
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
@ -452,6 +459,10 @@ class TestServeConverterConvert:
|
||||||
|
|
||||||
|
|
||||||
class TestConverterWiring:
|
class TestConverterWiring:
|
||||||
|
@pytest.mark.skipif(
|
||||||
|
not _has_docling(),
|
||||||
|
reason="docling library not installed",
|
||||||
|
)
|
||||||
def test_local_engine_builds_local_converter(self):
|
def test_local_engine_builds_local_converter(self):
|
||||||
from infra.local_converter import LocalConverter
|
from infra.local_converter import LocalConverter
|
||||||
from infra.settings import Settings
|
from infra.settings import Settings
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue