def METHOD_NAME(tmp_path, keep):
    archive_path = tmp_path / "test1.zip"
    with zipfile.ZipFile(archive_path, mode="w") as fh_zip:
        fh_zip.writestr("packageA/c/a.py", "1+1")
        fh_zip.writestr("packageA/d.c", "x = 1")
    out_path = _py_compile_archive(archive_path, keep=keep)
    assert out_path == archive_path
    if keep:
        expected = {"test1.zip", "test1.zip.old"}
    else:
        expected = {"test1.zip"}
    assert set(el.name for el in tmp_path.glob("*")) == expected
    with zipfile.ZipFile(archive_path) as fh_zip:
        assert fh_zip.namelist() == ["packageA/c/a.pyc", "packageA/d.c"]