Skip to content

Commit 6d75333

Browse files
nicoddemushugovk
andauthored
[7.1.x] Increase stacklevel to point at user's code (#9870)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2 parents 0ec5886 + ddbb998 commit 6d75333

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

changelog/9869.bugfix.rst

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Increase ``stacklevel`` for the ``NODE_CTOR_FSPATH_ARG`` deprecation to point to the
2+
user's code, not pytest.

src/_pytest/nodes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def _imply_path(
111111
NODE_CTOR_FSPATH_ARG.format(
112112
node_type_name=node_type.__name__,
113113
),
114-
stacklevel=3,
114+
stacklevel=6,
115115
)
116116
if path is not None:
117117
if fspath is not None:

0 commit comments

Comments
 (0)