From 6d497f2c77a6aac70611bcdf0c968e23d166935e Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Tue, 4 Sep 2018 16:50:24 -0300 Subject: [PATCH] Fix stacklevel for warning about Metafunc.addcall --- src/_pytest/python.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 3ce70064e..9d6e23840 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1107,8 +1107,7 @@ class Metafunc(fixtures.FuncargnamesCompatAttr): :arg param: a parameter which will be exposed to a later fixture function invocation through the ``request.param`` attribute. """ - if self.config: - self.definition.warn(deprecated.METAFUNC_ADD_CALL) + warnings.warn(deprecated.METAFUNC_ADD_CALL, stacklevel=2) assert funcargs is None or isinstance(funcargs, dict) if funcargs is not None: