def METHOD_NAME(self, tmp_path, keep_egg_info):
    config = "[metadata]\nname=proj\nversion=42\n"
    (tmp_path / "setup.cfg").write_text(config, encoding="utf-8")
    out = tmp_path / "__out"
    out.mkdir()
    opts = ["--keep-egg-info"] if keep_egg_info else []
    run_command("dist_info", "--output-dir", out, *opts, cwd=tmp_path)
    assert len(list(out.glob("*.dist-info"))) == 1
    assert len(list(tmp_path.glob("*.dist-info"))) == 0
    expected_egg_info = 1 if keep_egg_info else 0
    assert len(list(out.glob("*.egg-info"))) == expected_egg_info
    assert len(list(tmp_path.glob("*.egg-info"))) == 0
    assert len(list(out.glob("*.__bkp__"))) == 0
    assert len(list(tmp_path.glob("*.__bkp__"))) == 0