diff --git a/pytest.ini b/pytest.ini index 4fefa0f77..56cd808ad 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,4 +1,5 @@ [pytest] +log_level = NOTSET addopts = --strict -rfEw --faulthandler-timeout=90 --instafail --pythonwarnings error --benchmark-columns=Min,Max,Median testpaths = tests markers = diff --git a/tests/helpers/logfail.py b/tests/helpers/logfail.py index 8eee34911..740dd4333 100644 --- a/tests/helpers/logfail.py +++ b/tests/helpers/logfail.py @@ -22,7 +22,6 @@ import logging import pytest -import _pytest.logging class LogFailHandler(logging.Handler): @@ -40,17 +39,8 @@ class LogFailHandler(logging.Handler): if logger.name == 'messagemock': return - for h in root_logger.handlers: - if isinstance(h, _pytest.logging.LogCaptureHandler): - capture_handler = h - break - else: - # The LogCaptureHandler is not available anymore during fixture - # teardown, so we ignore logging messages emitted there.. - return - if (logger.level == record.levelno or - capture_handler.level == record.levelno): + root_logger.level == record.levelno): # caplog.at_level(...) was used with the level of this message, # i.e. it was expected. return