Skip to content

Commit 5c0c197

Browse files
Merge pull request #2682 from pelme/getfuncargvalue-fix
Use the correct stacklevel for getfuncargvalue() deprecation warning.
2 parents 021fba4 + 3933185 commit 5c0c197

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

_pytest/fixtures.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,8 @@ def getfuncargvalue(self, argname):
432432
from _pytest import deprecated
433433
warnings.warn(
434434
deprecated.GETFUNCARGVALUE,
435-
DeprecationWarning)
435+
DeprecationWarning,
436+
stacklevel=2)
436437
return self.getfixturevalue(argname)
437438

438439
def _get_active_fixturedef(self, argname):

changelog/2681.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Calling the deprecated `request.getfuncargvalue()` now shows the source of the call.

0 commit comments

Comments
 (0)