From 9304b80b6911a17e5172bf52b6bc569df1f63b48 Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Sat, 30 Nov 2024 19:15:40 -0800 Subject: [PATCH] fix: update sounddevice mocking in voice tests --- tests/basic/test_voice.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/basic/test_voice.py b/tests/basic/test_voice.py index 7dc288a43..cfdc643ba 100644 --- a/tests/basic/test_voice.py +++ b/tests/basic/test_voice.py @@ -11,12 +11,13 @@ from aider.voice import SoundDeviceError, Voice # Mock the entire sounddevice module @pytest.fixture def mock_sounddevice(): - with patch("aider.voice.sounddevice") as mock_sd: + with patch("sounddevice") as mock_sd: mock_sd.query_devices.return_value = [ {"name": "test_device", "max_input_channels": 2}, {"name": "another_device", "max_input_channels": 1}, ] - yield mock_sd + with patch.dict("sys.modules", {"sounddevice": mock_sd}): + yield mock_sd @pytest.fixture