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)
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)
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)
def test_write_valid_config_logs(tmp_path, logs): logbook = make_logbook(tmp_path) for log in logs: logbook.write_config(log)
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)
def test_write_valid_metric_logs(tmp_path, logs): logbook = make_logbook(tmp_path) for log in logs: logbook.write_metric(log)