Пример #1
0
def test_parser(tmp_path, logs):
    logbook = make_logbook(tmp_path)
    for log, log_type in logs:
        logbook.write(log, log_type)
    parser = Parser()
    experiment = parser.parse(tmp_path)
    grouped_logs = group_logs_by_type(logs)
    for key in ["message", "metadata"]:
        compare_components(experiment.info[key], grouped_logs[key], key)
    key = "config"
    compare_components(experiment.configs, grouped_logs[key], key)
Пример #2
0
def test_logger_with_invalid_logs(tmp_path, logs, log_type):
    logbook = make_logbook(tmp_path)
    with pytest.raises(TypeError):
        for log in logs:
            logbook.write(log, log_type)
Пример #3
0
def test_logger_with_valid_logs(tmp_path, logs, log_type):
    logbook = make_logbook(tmp_path)
    for log in logs:
        logbook.write(log, log_type)
Пример #4
0
def test_write_valid_config_logs(tmp_path, logs):
    logbook = make_logbook(tmp_path)
    for log in logs:
        logbook.write_config(log)
Пример #5
0
def test_write_invalid_metric_logs(tmp_path, logs):
    logbook = make_logbook(tmp_path)
    with pytest.raises(TypeError):
        for log in logs:
            logbook.write_metric(log)
Пример #6
0
def test_write_valid_metric_logs(tmp_path, logs):
    logbook = make_logbook(tmp_path)
    for log in logs:
        logbook.write_metric(log)