human
I wrote the below code

    def _mock(pkg_name, spec, deptypes=spack.alldeps):
        'Alters    dependence    information    for    a    package.\n\n                                Adds    a    dependency    on    <spec>    to    pkg.    Use    this    to    mock    up    constraints.\n                                '
        spec = Spec(spec)
        pkg = spack.repo.get(pkg_name)
        if (pkg_name not in saved_deps):
            saved_deps[pkg_name] = (pkg, pkg.dependencies.copy())
        pkg.dependencies[spec.name] = {Spec(pkg_name): spec}
        pkg.dependency_types[spec.name] = set(deptypes)
    return _mock

What's a good function header?
assistant
#Here's a good function header.

@pytest.fixture()
def set_dependency(saved_deps):