From 17eef0aded5124871b57548379c8eb6909300418 Mon Sep 17 00:00:00 2001 From: Stu Alexander Date: Sat, 7 Nov 2026 12:46:01 +0000 Subject: [PATCH] test(asr): stub faster_whisper so the service tests run without CUDA wheels The Faster-Whisper service tests replace the transcriber with a fake, but importing the service still imported faster_whisper, which CI does not install (its dependency group pulls in the NVIDIA CUDA wheels). Collection failed with ModuleNotFoundError and stopped the whole ASR test job. Co-Authored-By: Claude Opus 5.5 --- .../tests/test_faster_whisper_service.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/extras/asr-services/tests/test_faster_whisper_service.py b/extras/asr-services/tests/test_faster_whisper_service.py index be30b9efe..91730b62c 100644 --- a/extras/asr-services/tests/test_faster_whisper_service.py +++ b/extras/asr-services/tests/test_faster_whisper_service.py @@ -1,10 +1,21 @@ """Readiness and environment contracts for the Faster-Whisper provider.""" import asyncio +import sys +import types from unittest.mock import Mock import pytest -from providers.faster_whisper import service as module + +# These tests replace the transcriber with a fake, so the real faster_whisper +# package (and its CUDA wheels) is never used. A stub module lets the service +# import without installing that provider's dependency group in CI. +if "faster_whisper" not in sys.modules: + _stub = types.ModuleType("faster_whisper") + _stub.WhisperModel = object + sys.modules["faster_whisper"] = _stub + +from providers.faster_whisper import service as module # noqa: E402 @pytest.mark.parametrize(