nerserver / tests /conftest.py
Robin
refactor: remove httpx proxy, call GLiNER model directly
bfeb704
raw
history blame contribute delete
354 Bytes
"""
Mock gliner and torch before any app module is imported.
Prevents torch's BLAS FPE check from crashing on Windows during unit tests.
"""
import sys
from unittest.mock import MagicMock
for mod in ("torch", "gliner", "gliner.model"):
sys.modules.setdefault(mod, MagicMock())
_gliner_stub = sys.modules["gliner"]
_gliner_stub.GLiNER = MagicMock()