diff --git a/tests/helpers/logfail.py b/tests/helpers/logfail.py index 3435018e0..96e74a94c 100644 --- a/tests/helpers/logfail.py +++ b/tests/helpers/logfail.py @@ -46,6 +46,9 @@ class LogFailHandler(logging.Handler): logger = logging.getLogger(record.name) root_logger = logging.getLogger() + if logger.name == 'messagemock': + return + for h in root_logger.handlers: if isinstance(h, catchlog_mod.LogCaptureHandler): catchlog_handler = h diff --git a/tests/helpers/messagemock.py b/tests/helpers/messagemock.py index cf27cb8f1..531586cab 100644 --- a/tests/helpers/messagemock.py +++ b/tests/helpers/messagemock.py @@ -62,9 +62,7 @@ class MessageMock: } log_level = log_levels[level] - with self._caplog.at_level(log_level): # needed so we don't fail - logging.getLogger('message').log(log_level, text) - + logging.getLogger('messagemock').log(log_level, text) self.messages.append(Message(level, win_id, text, immediately)) def _handle_error(self, *args, **kwargs):