diff --git a/_pytest/fixtures.py b/_pytest/fixtures.py index b588c312a..4386500f4 100644 --- a/_pytest/fixtures.py +++ b/_pytest/fixtures.py @@ -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): diff --git a/changelog/2681.bugfix b/changelog/2681.bugfix new file mode 100644 index 000000000..a29c31fb7 --- /dev/null +++ b/changelog/2681.bugfix @@ -0,0 +1 @@ +Calling the deprecated `request.getfuncargvalue()` now shows the source of the call.