+\r
+@pytest.fixture(scope='function', autouse=False)\r
+def sounddevice():\r
+ """Mock sounddevice module."""\r
+ sounddevice = mock.MagicMock()\r
+ sys.modules['sounddevice'] = sounddevice\r
+ yield sounddevice\r
+ del sys.modules['sounddevice']\r
+\r
+\r
+@pytest.fixture(scope='function', autouse=False)\r
+def numpy():\r
+ """Mock numpy module."""\r
+ numpy = mock.MagicMock()\r
+ sys.modules['numpy'] = numpy\r
+ yield numpy\r
+ del sys.modules['numpy']\r