Merge pull request #2682 from pelme/getfuncargvalue-fix

Use the correct stacklevel for getfuncargvalue() deprecation warning.
This commit is contained in:
Ronny Pfannschmidt 2017-08-13 18:24:39 +02:00 committed by GitHub
commit 5c0c1977e3
2 changed files with 3 additions and 1 deletions

View File

@ -432,7 +432,8 @@ class FixtureRequest(FuncargnamesCompatAttr):
from _pytest import deprecated
warnings.warn(
deprecated.GETFUNCARGVALUE,
DeprecationWarning)
DeprecationWarning,
stacklevel=2)
return self.getfixturevalue(argname)
def _get_active_fixturedef(self, argname):

1
changelog/2681.bugfix Normal file
View File

@ -0,0 +1 @@
Calling the deprecated `request.getfuncargvalue()` now shows the source of the call.