Skip to content

Commit

Permalink
[7.1.x] Increase stacklevel to point at user's code
Browse files Browse the repository at this point in the history
  • Loading branch information
hugovk authored and pytestbot committed Apr 20, 2022
1 parent 0ec5886 commit ddbb998
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
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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 ddbb998

Please sign in to comment.