From 2b41123004ae907aea4bdba50e0447c7b9218b50 Mon Sep 17 00:00:00 2001 From: Sadra Barikbin Date: Sun, 17 Sep 2023 16:59:23 +0330 Subject: [PATCH] A tiny improvement --- src/_pytest/python.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_pytest/python.py b/src/_pytest/python.py index 52f4a8881..ca679ab73 100644 --- a/src/_pytest/python.py +++ b/src/_pytest/python.py @@ -1668,7 +1668,7 @@ class DeprecatingFuncArgs(Dict[str, object]): def __getitem__(self, key: str) -> object: if key not in self.initialnames: - warnings.warn(ITEM_FUNCARGS_MEMBERS) + warnings.warn(ITEM_FUNCARGS_MEMBERS, stacklevel=2) return super().__getitem__(key)