Example #1
0
def disabled_test_create_loggers_with_file_params(capsys, tmpdir):
    file_name = tmpdir.join("log.txt")

    log = create_loggers(file_name=file_name,
                         module_wide_log_file=True,
                         app_wide_log_file=False)

    log.info("Test info")
    # _, captured = capsys.readouterr()
    # assert captured == ''

    # with open(file_name, 'r') as f:
    #     flog = f.read()
    #     assert flog.endswith('INFO - Test info\n')

    log.warning("Test message")
Example #2
0
def test_create_loggers_with_default_params(capsys):
    log = create_loggers()

    log.info("Test info")
    _, captured = capsys.readouterr()
    assert captured == ""