Workaround for pytest 0.4.1+ atexit logging errors

This commit is contained in:
shortcutme 2019-07-01 16:25:45 +02:00
parent fb2cf5f04d
commit f979ed133f
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -409,3 +409,8 @@ def crypt_bitcoin_lib(request, monkeypatch):
monkeypatch.setattr(CryptBitcoin, "lib_verify_best", request.param)
CryptBitcoin.loadLib(request.param)
return CryptBitcoin
# Workaround for pytest>=0.4.1 bug when logging in atexit handlers (I/O operation on closed file)
@atexit.register
def disableLog():
logging.getLogger('').setLevel(logging.getLevelName(logging.CRITICAL))