def is_ancestor(base: Path, query: Path) -> bool:
        """Return whether query is an ancestor of base."""
        if base == query:
            return True
        return query in base.parents
Return whether query is an ancestor of base.
src/_pytest/main.py