def configure_test_logging():
"""Add a NullHandler to root logger.
Prevents unconfigured logging from erroring, and swallows all logging,
which is usually what you want for unit tests. Unit test fixtures can
still add their own loggers to assert against log messages if needed.
"""
set_logger_class()
handler = logging.NullHandler()
add_talisker_handler(logging.NOTSET, handler)
configure_warnings(True)
评论列表
文章目录