def test_debug_file_logging(caplog, info_logger_with_file, debug_file, debug_messages):
 [file_handler, stream_handler] = info_logger_with_file.handlers
 assert isinstance(file_handler, logging.FileHandler)
 assert isinstance(stream_handler, logging.StreamHandler)
 assert (stream_handler.level == logging.INFO)
 assert (file_handler.level == logging.DEBUG)
 create_log_records()
 assert debug_file.exists()
 assert (debug_file.readlines(cr=False) == (debug_messages + ['']))

def test_debug_file_logging ( caplog , info_logger_with_file , debug_file , debug_messages ) : [ file_handler , stream_handler ] = info_logger_with_file . handlers assert isinstance ( file_handler , logging . FileHandler ) assert isinstance ( stream_handler , logging . StreamHandler ) assert ( stream_handler . level == logging . INFO ) assert ( file_handler . level == logging . DEBUG ) create_log_records ( ) assert debug_file . exists ( ) assert ( debug_file . readlines ( cr = False ) == ( debug_messages + [ '' ] ) )
test that logging to stdout uses a different format and level than the the file handler .