Merge pull request #57 from pimoroni/test-tweaks-and-linting
[EVA-2020-02-2.git] / library / tests / conftest.py
index 8a3ffb44b4f670bab3d5e2fb072f59eef4784b73..b026172cb589e582056dd62ed84dc13bf6b791cf 100644 (file)
@@ -54,3 +54,20 @@ def atexit():
     yield atexit\r
     del sys.modules['atexit']\r
 \r
     yield atexit\r
     del sys.modules['atexit']\r
 \r
+\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