From bf30d26dd13466e05682ad6906611359b8372cd6 Mon Sep 17 00:00:00 2001 From: Kimi Agent Date: Sat, 14 Mar 2026 18:24:56 -0400 Subject: [PATCH] test: skip voice_loop tests gracefully when numpy unavailable Wrap numpy and voice_loop imports in try/except with pytestmark skipif. Tests skip cleanly instead of ImportError when numpy not in dev deps. Closes #48 --- tests/timmy/test_voice_loop.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/tests/timmy/test_voice_loop.py b/tests/timmy/test_voice_loop.py index 26d83c8..e888699 100644 --- a/tests/timmy/test_voice_loop.py +++ b/tests/timmy/test_voice_loop.py @@ -7,9 +7,20 @@ Whisper model, or Piper installation — all I/O is mocked. from pathlib import Path from unittest.mock import MagicMock, patch -import numpy as np +import pytest + +try: + import numpy as np +except ImportError: + np = None + +try: + from timmy.voice_loop import VoiceConfig, VoiceLoop, _strip_markdown +except ImportError: + pass # pytestmark will skip all tests anyway + +pytestmark = pytest.mark.skipif(np is None, reason="numpy not installed") -from timmy.voice_loop import VoiceConfig, VoiceLoop, _strip_markdown # ── VoiceConfig tests ──────────────────────────────────────────────────────