conftest.py 400 B

1234567891011121314151617
  1. """Root-level conftest to patch ctranslate2 before tests import app.main."""
  2. import sys
  3. class _MockModels:
  4. class WhisperGenerationResult:
  5. pass
  6. class _MockCTranslate2:
  7. StorageView = type("StorageView", (), {})
  8. models = _MockModels()
  9. # Install mock before any real import of ctranslate2
  10. if "ctranslate2" not in sys.modules:
  11. sys.modules["ctranslate2"] = _MockCTranslate2()