Skip to content

Commit

Permalink
[7.1.x] Increase stacklevel to point at user's code (#9870)
Browse files Browse the repository at this point in the history
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
  • Loading branch information
nicoddemus and hugovk committed Apr 20, 2022
2 parents 0ec5886 + ddbb998 commit 6d75333
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelog/9869.bugfix.rst
@@ -0,0 +1,2 @@
Increase ``stacklevel`` for the ``NODE_CTOR_FSPATH_ARG`` deprecation to point to the
user's code, not pytest.
2 changes: 1 addition & 1 deletion src/_pytest/nodes.py
Expand Up @@ -111,7 +111,7 @@ def _imply_path(
NODE_CTOR_FSPATH_ARG.format(
node_type_name=node_type.__name__,
),
stacklevel=3,
stacklevel=6,
)
if path is not None:
if fspath is not None:
Expand Down

0 comments on commit 6d75333

Please sign in to comment.