Better pytest atexit logging error workaround

This commit is contained in:
shortcutme 2019-07-03 18:37:13 +02:00
parent eb2627721e
commit fec312ed09
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -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))