mindXtrain / tests /conftest.py
Gregory-L's picture
bankml: the verified CPU engine as backend, serve target and imprint probe
76258e9 verified
Raw History Blame
693 Bytes
"""Suite-wide hermeticity for the operator's backend auto-detect.
`resolve_backend_name()` probes `bankml serve` on 127.0.0.1:18093 when ollama is not
reachable. A developer box that happens to run bankml would otherwise change what the
auto-detect tests resolve to, so the probe is pinned to "absent" for every test; the
bankml tests that exercise the probe itself monkeypatch it back explicitly.
"""
from __future__ import annotations
import pytest
@pytest.fixture(autouse=True)
def _no_live_bankml_probe(monkeypatch: pytest.MonkeyPatch) -> None:
from mindxtrain.operator import app as operator_app
monkeypatch.setattr(operator_app, "_bankml_reachable", lambda *a, **k: False)