From fec312ed09c30a6fb59a0a67a072df2334bdafbb Mon Sep 17 00:00:00 2001 From: shortcutme Date: Wed, 3 Jul 2019 18:37:13 +0200 Subject: [PATCH] Better pytest atexit logging error workaround --- src/Test/conftest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Test/conftest.py b/src/Test/conftest.py index bc42b5e8..b4c96d0e 100644 --- a/src/Test/conftest.py +++ b/src/Test/conftest.py @@ -411,6 +411,7 @@ def crypt_bitcoin_lib(request, monkeypatch): return CryptBitcoin # Workaround for pytest>=0.4.1 bug when logging in atexit handlers (I/O operation on closed file) -@atexit.register +@pytest.fixture(scope='session', autouse=True) def disableLog(): + yield None # Wait until all test done logging.getLogger('').setLevel(logging.getLevelName(logging.CRITICAL))