def test_debug_stdout_logging(caplog, debug_logger, debug_messages):
 [stream_handler] = debug_logger.handlers
 assert isinstance(stream_handler, logging.StreamHandler)
 assert (stream_handler.level == logging.DEBUG)
 create_log_records()
 stream_messages = [stream_handler.format(r) for r in caplog.records if (r.levelno >= stream_handler.level)]
 assert (stream_messages == debug_messages)

def test_debug_stdout_logging ( caplog , debug_logger , debug_messages ) : [ stream_handler ] = debug_logger . handlers assert isinstance ( stream_handler , logging . StreamHandler ) assert ( stream_handler . level == logging . DEBUG ) create_log_records ( ) stream_messages = [ stream_handler . format ( r ) for r in caplog . records if ( r . levelno >= stream_handler . level ) ] assert ( stream_messages == debug_messages )
test that stdout logs use debug format and level .