From 44fc0e245529332bb396eb358195105d69176a32 Mon Sep 17 00:00:00 2001 From: Yujong Lee Date: Mon, 31 Aug 2026 17:31:45 -0700 Subject: [PATCH] refactor(ocr): keep contract test in provider suite --- .../llms/mistral/ocr/test_mistral_ocr_transformation.py} | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) rename tests/{transform_contracts/test_contracts.py => test_litellm/llms/mistral/ocr/test_mistral_ocr_transformation.py} (64%) diff --git a/tests/transform_contracts/test_contracts.py b/tests/test_litellm/llms/mistral/ocr/test_mistral_ocr_transformation.py similarity index 64% rename from tests/transform_contracts/test_contracts.py rename to tests/test_litellm/llms/mistral/ocr/test_mistral_ocr_transformation.py index d60ad1ce6e6..65df58abf01 100644 --- a/tests/transform_contracts/test_contracts.py +++ b/tests/test_litellm/llms/mistral/ocr/test_mistral_ocr_transformation.py @@ -6,7 +6,9 @@ from tests.transform_contracts.loader import load_contract_cases from tests.transform_contracts.registry import run_contract_case from tests.transform_contracts.schema import JsonValue, TransformationCase, expected_output -_CONTRACT_CASES: Final = load_contract_cases() +_MISTRAL_OCR_CASES: Final = tuple(case for case in load_contract_cases() if case.operation.startswith("mistral.ocr.")) +if not _MISTRAL_OCR_CASES: + raise ValueError("no Mistral OCR transformation contract cases found") class _ContractCaseRequest(Protocol): @@ -14,13 +16,13 @@ class _ContractCaseRequest(Protocol): def param(self) -> TransformationCase: ... -@pytest.fixture(params=_CONTRACT_CASES, ids=tuple(case.id for case in _CONTRACT_CASES)) +@pytest.fixture(params=_MISTRAL_OCR_CASES, ids=tuple(case.id for case in _MISTRAL_OCR_CASES)) def contract_case(request: _ContractCaseRequest, monkeypatch: pytest.MonkeyPatch) -> TransformationCase: monkeypatch.setenv("LITELLM_LOCAL_MODEL_COST_MAP", "True") return request.param -def test_transformation_contract(contract_case: TransformationCase) -> None: +def test_mistral_ocr_transformation_contract(contract_case: TransformationCase) -> None: actual: Final[JsonValue] = run_contract_case(contract_case) expected: Final[JsonValue] = expected_output(contract_case) assert actual == expected