def METHOD_NAME(install_mockery, mock_fetch, monkeypatch):
    """Test that installed packages that have been removed are still loadable"""
    spec = Spec("trivial-install-test-package").concretized()
    spec.package.do_install()
    def find_nothing(*args):
        raise spack.repo.UnknownPackageError("Repo package access is disabled for test")
    # Mock deletion of the package
    spec._package = None
    monkeypatch.setattr(spack.repo.PATH, "get", find_nothing)
    with pytest.raises(spack.repo.UnknownPackageError):
        spec.package
    module_path = spack.modules.common.get_module("tcl", spec, True)
    assert module_path
    spack.package_base.PackageBase.uninstall_by_spec(spec)