When testing don't register shutdown functions

This commit is contained in:
shortcutme 2019-11-25 14:35:16 +01:00
parent c14e722303
commit 9a43626aa6
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -17,6 +17,8 @@ import gevent.event
from gevent import monkey
monkey.patch_all(thread=False, subprocess=False)
atexit_register = atexit.register
atexit.register = lambda func: "" # Don't register shutdown functions to avoid IO error on exit
def pytest_addoption(parser):
parser.addoption("--slow", action='store_true', default=False, help="Also run slow tests")
@ -118,7 +120,7 @@ def cleanup():
if os.path.isfile(file_path):
os.unlink(file_path)
atexit.register(cleanup)
atexit_register(cleanup)
@pytest.fixture(scope="session")
def resetSettings(request):