def METHOD_NAME(tmp_path, realizations, gives_error):
    """Test combining with the minimum-realizations filter"""
    kgo_dir = acc.kgo_root() / "combine/minimum_realizations"
    kgo_path = kgo_dir / "kgo.nc"
    temperatures = sorted(kgo_dir.glob("*temperature_at_screen_level*.nc"))
    output_path = tmp_path / "output.nc"
    args = [
        "--operation",
        "max",
        "--minimum-realizations",
        f"{realizations}",
        *temperatures,
        "--output",
        f"{output_path}",
    ]
    if gives_error:
        with pytest.raises(
            ValueError,
            match="After filtering, number of realizations 3 is less than the minimum number "
            rf"of realizations allowed \({realizations}\)",
        ):
            run_cli(args)
    else:
        run_cli(args)
        acc.compare(output_path, kgo_path)