Skip to content

Commit

Permalink
WIP: fix relative path finding when parent.path == self.path
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyPfannschmidt committed Feb 7, 2021
1 parent 436932e commit 6393893
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/_pytest/nodes.py
Expand Up @@ -536,9 +536,9 @@ def __init__(
) -> None:
path, fspath = _imply_path(path, fspath=fspath)
name = fspath.basename
if parent is not None:
if parent is not None and parent.path != path:
try:
rel = Path(fspath).relative_to(parent.path)
rel = path.relative_to(parent.path)
except ValueError:
pass
else:
Expand Down

0 comments on commit 6393893

Please sign in to comment.