Skip to content

Commit

Permalink
Increase stacklevel to point at user's code
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk committed Apr 20, 2022
1 parent 045dbc8 commit c4e9300
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 c4e9300

Please sign in to comment.