From 9a43626aa650bef34eecdccf2fc06841acbe04cc Mon Sep 17 00:00:00 2001 From: shortcutme Date: Mon, 25 Nov 2019 14:35:16 +0100 Subject: [PATCH] When testing don't register shutdown functions --- src/Test/conftest.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Test/conftest.py b/src/Test/conftest.py index 0b7e97e9..e86c3314 100644 --- a/src/Test/conftest.py +++ b/src/Test/conftest.py @@ -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):