def METHOD_NAME(tmp_path):
    test_model_filepath = str(tmp_path / "test_model.h5")
    save_freq = "invalid_save_freq"
    with pytest.raises(ValueError, match="Unrecognized save_freq"):
        AverageModelCheckpoint(
            update_weights=True, filepath=test_model_filepath, save_freq=save_freq
        )