Fix random test failures

This commit is contained in:
Matthias 2023-06-14 20:34:18 +02:00
parent bc4d1c5326
commit 11d7e7925e

View File

@ -135,15 +135,16 @@ def test_set_loggers_journald_importerror(import_fails):
def test_reduce_verbosity():
setup_logging_pre()
reduce_verbosity_for_bias_tester()
prior_level = logging.getLogger('freqtrade').getEffectiveLevel()
assert logging.getLogger('freqtrade.resolvers').getEffectiveLevel() is logging.WARNING
assert logging.getLogger('freqtrade.strategy.hyper').getEffectiveLevel() is logging.WARNING
assert logging.getLogger('freqtrade.resolvers').getEffectiveLevel() == logging.WARNING
assert logging.getLogger('freqtrade.strategy.hyper').getEffectiveLevel() == logging.WARNING
# base level wasn't changed
assert logging.getLogger('freqtrade').getEffectiveLevel() is logging.INFO
assert logging.getLogger('freqtrade').getEffectiveLevel() == prior_level
restore_verbosity_for_bias_tester()
assert logging.getLogger('freqtrade.resolvers').getEffectiveLevel() is logging.INFO
assert logging.getLogger('freqtrade.strategy.hyper').getEffectiveLevel() is logging.INFO
assert logging.getLogger('freqtrade').getEffectiveLevel() is logging.INFO
assert logging.getLogger('freqtrade.resolvers').getEffectiveLevel() == prior_level
assert logging.getLogger('freqtrade.strategy.hyper').getEffectiveLevel() == prior_level
assert logging.getLogger('freqtrade').getEffectiveLevel() == prior_level
# base level wasn't changed