Skip to content

Commit

Permalink
Improve coverage.
Browse files Browse the repository at this point in the history
  • Loading branch information
c0fec0de committed Mar 13, 2017
1 parent 81fe7de commit cfffcf5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions anytree/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,13 @@ def walk(self, start, end):
([Node('/f')], [])
>>> w.walk(h, e)
([Node('/f/g/i'), Node('/f/g'), Node('/f')], [Node('/f/b'), Node('/f/b/d'), Node('/f/b/d/e')])
For a proper walking the nodes need to be part of the same tree:
>>> w.walk(Node("a"), Node("b"))
Traceback (most recent call last):
...
anytree.WalkError: Node('/a') and Node('/b') are not part of the same tree.
"""
s = start.path
e = end.path
Expand Down

0 comments on commit cfffcf5

Please sign in to comment.