Skip to content
This repository was archived by the owner on Oct 24, 2024. It is now read-only.

Commit 1e45e3d

Browse files
committed
Fix tests
1 parent a1cdfb4 commit 1e45e3d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

datatree/tests/test_treenode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def test_ancestors(self):
9696
vito = TreeNode(children={"Michael": michael})
9797
assert tony.root is vito
9898
assert tony.parents == (michael, vito)
99-
assert tony.ancestors == (vito, michael)
99+
assert tony.ancestors == (vito, michael, tony)
100100

101101

102102
class TestGetNodes:

datatree/treenode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def ancestors(self: Tree) -> Tuple[Tree, ...]:
281281
"Please use `parents`. Example: `tuple(reversed(node.parents))`",
282282
DeprecationWarning,
283283
)
284-
return tuple(reversed(self.parents))
284+
return tuple((*reversed(self.parents), self))
285285

286286
@property
287287
def root(self: Tree) -> Tree:

0 commit comments

Comments
 (0)