self.regs[0x00:0x01] = 0x0f, 0x00\r
\r
\r
+@pytest.fixture(scope='function', autouse=True)\r
+def cleanup():\r
+ yield None\r
+ try:\r
+ del sys.modules['enviroplus']\r
+ except KeyError:\r
+ pass\r
+ try:\r
+ del sys.modules['enviroplus.noise']\r
+ except KeyError:\r
+ pass\r
+ try:\r
+ del sys.modules['enviroplus.gas']\r
+ except KeyError:\r
+ pass\r
+\r
+\r
@pytest.fixture(scope='function', autouse=False)\r
def GPIO():\r
"""Mock RPi.GPIO module."""\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