mirror of
https://github.com/Aider-AI/aider
synced 2026-05-03 12:51:58 +02:00
fix: correct sounddevice module mocking in voice tests
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user