X-Git-Url: https://zdv2.bktei.com/gitweb/EVA-2020-02-2.git/blobdiff_plain/e9c93677beeb6c6416d8f15aa2bd29ce3cd4b726..47f1b58f2dd003bfc7780bf6e52072b45e5d56b0:/library/tests/conftest.py diff --git a/library/tests/conftest.py b/library/tests/conftest.py index b026172..8a5c54c 100644 --- a/library/tests/conftest.py +++ b/library/tests/conftest.py @@ -14,6 +14,23 @@ class SMBusFakeDevice(MockSMBus): self.regs[0x00:0x01] = 0x0f, 0x00 +@pytest.fixture(scope='function', autouse=True) +def cleanup(): + yield None + try: + del sys.modules['enviroplus'] + except KeyError: + pass + try: + del sys.modules['enviroplus.noise'] + except KeyError: + pass + try: + del sys.modules['enviroplus.gas'] + except KeyError: + pass + + @pytest.fixture(scope='function', autouse=False) def GPIO(): """Mock RPi.GPIO module."""