ProbabilityRAG / tests /conftest.py
Piero7's picture
Add unit test suite (40 tests) + fix requirements for fresh installs
3d62c28
Raw
History Blame Contribute Delete
591 Bytes
"""Make src/ importable and stub the heavy native deps when absent.
src/store.py imports torch + FlagEmbedding at module load purely to fix native-lib
load order on Windows; the pure functions under test never call into them. Stubbing
them when missing lets this suite run on a CI box without the CUDA wheels.
"""
import sys
import types
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
sys.path.insert(0, str(ROOT))
for name in ("torch", "FlagEmbedding"):
try:
__import__(name)
except ImportError:
sys.modules[name] = types.ModuleType(name)