From 685e52ec30f87cd968fea28addf985925631b703 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Mon, 1 Jan 2024 23:09:33 +0200 Subject: [PATCH] nodes: fix attribute name `fspath` -> `path` in `get_fslocation_from_item` --- src/_pytest/nodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_pytest/nodes.py b/src/_pytest/nodes.py index 4cf6768e6..112f9a149 100644 --- a/src/_pytest/nodes.py +++ b/src/_pytest/nodes.py @@ -488,7 +488,7 @@ def get_fslocation_from_item(node: "Node") -> Tuple[Union[str, Path], Optional[i * "location": a pair (path, lineno) * "obj": a Python object that the node wraps. - * "fspath": just a path + * "path": just a path :rtype: A tuple of (str|Path, int) with filename and 0-based line number. """ @@ -499,7 +499,7 @@ def get_fslocation_from_item(node: "Node") -> Tuple[Union[str, Path], Optional[i obj = getattr(node, "obj", None) if obj is not None: return getfslineno(obj) - return getattr(node, "fspath", "unknown location"), -1 + return getattr(node, "path", "unknown location"), -1 class Collector(Node, abc.ABC):