diff --git a/tests/basic/test_voice.py b/tests/basic/test_voice.py index cfdc643ba..00ec1d79d 100644 --- a/tests/basic/test_voice.py +++ b/tests/basic/test_voice.py @@ -11,13 +11,13 @@ from aider.voice import SoundDeviceError, Voice # Mock the entire sounddevice module @pytest.fixture def mock_sounddevice(): - 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}, - ] - with patch.dict("sys.modules", {"sounddevice": mock_sd}): - yield mock_sd + mock_sd = MagicMock() + mock_sd.query_devices.return_value = [ + {"name": "test_device", "max_input_channels": 2}, + {"name": "another_device", "max_input_channels": 1}, + ] + with patch.dict("sys.modules", {"sounddevice": mock_sd}): + yield mock_sd @pytest.fixture