Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/_pytest/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
from _pytest.mark.structures import NodeKeywords
from _pytest.outcomes import fail
from _pytest.pathlib import absolutepath
from _pytest.pathlib import commonpath
from _pytest.stash import Stash
from _pytest.warning_types import PytestWarning

Expand Down Expand Up @@ -147,14 +146,14 @@ class Node(abc.ABC, metaclass=NodeMeta):
# Use __slots__ to make attribute access faster.
# Note that __dict__ is still available.
__slots__ = (
"__dict__",
"_nodeid",
"_store",
"config",
"name",
"parent",
"config",
"session",
"path",
"_nodeid",
"_store",
"__dict__",
"session",
)

def __init__(
Expand Down Expand Up @@ -550,7 +549,7 @@ def _traceback_filter(self, excinfo: ExceptionInfo[BaseException]) -> Traceback:

def _check_initialpaths_for_relpath(session: "Session", path: Path) -> Optional[str]:
for initial_path in session._initialpaths:
if commonpath(path, initial_path) == initial_path:
if path.is_relative_to(initial_path):
rel = str(path.relative_to(initial_path))
return "" if rel == "." else rel
return None
Expand Down