Problem
backend/tests/test_ocr.py and backend/tests/test_ocr_variants.py both open with:
pytest.importorskip("paddleocr")
pytest.importorskip("paddle")
paddleocr and paddlepaddle live in the cpu and nvidia optional-dependency extras, not in [dependency-groups].dev. backend-check runs uv sync --group dev --locked, so neither is installed and every OCR test skips on every run.
The skips are silent — pytest -q reports them in the same summary line as any other skip, so the suite looks green while a whole module is inert.
Surfaced while reviewing #364, which adds 177 lines of variant-selection and fallback tests that will never execute as things stand. Not that PR's fault; the gap predates it.
Options
a. Add paddleocr + paddlepaddle to the dev group. Simplest, and the tests then run for real. Costs install time and image size on every backend-check — paddlepaddle is a heavy wheel, so this needs measuring before committing to it.
b. Add a separate CI job that syncs the cpu extra and runs only the ML-tagged tests, gated on backend/src/find_api/ml/** changes. Keeps the main job fast and only pays the cost when ML code moves.
c. Mock the paddle import surface so the variant-selection logic (which is pure Python — PP_OCR_MODELS, _normalize_variant, cache keys, status publishing) is testable without the real package, and keep importorskip for the tests that genuinely need inference.
(b) or (c) look right; (c) covers most of what #364's tests actually assert, since very little of it needs a real model.
Also worth checking
Whether any other module has the same problem — grep -rn importorskip backend/tests/ is the quick version. If a test can be skipped into irrelevance without anyone noticing, it isn't providing the coverage it looks like it is.
Problem
backend/tests/test_ocr.pyandbackend/tests/test_ocr_variants.pyboth open with:paddleocrandpaddlepaddlelive in thecpuandnvidiaoptional-dependency extras, not in[dependency-groups].dev.backend-checkrunsuv sync --group dev --locked, so neither is installed and every OCR test skips on every run.The skips are silent —
pytest -qreports them in the same summary line as any other skip, so the suite looks green while a whole module is inert.Surfaced while reviewing #364, which adds 177 lines of variant-selection and fallback tests that will never execute as things stand. Not that PR's fault; the gap predates it.
Options
a. Add
paddleocr+paddlepaddleto the dev group. Simplest, and the tests then run for real. Costs install time and image size on everybackend-check— paddlepaddle is a heavy wheel, so this needs measuring before committing to it.b. Add a separate CI job that syncs the
cpuextra and runs only the ML-tagged tests, gated onbackend/src/find_api/ml/**changes. Keeps the main job fast and only pays the cost when ML code moves.c. Mock the paddle import surface so the variant-selection logic (which is pure Python —
PP_OCR_MODELS,_normalize_variant, cache keys, status publishing) is testable without the real package, and keepimportorskipfor the tests that genuinely need inference.(b) or (c) look right; (c) covers most of what #364's tests actually assert, since very little of it needs a real model.
Also worth checking
Whether any other module has the same problem —
grep -rn importorskip backend/tests/is the quick version. If a test can be skipped into irrelevance without anyone noticing, it isn't providing the coverage it looks like it is.