Skip to content

Commit 49ec2ae

Browse files
committed
change stacklevel in warnings from 2 to 3
1 parent c396557 commit 49ec2ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/_pytest/config/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ def _warn_or_fail_if_strict(self, message: str) -> None:
11861186
from _pytest.warnings import _issue_warning_captured
11871187

11881188
_issue_warning_captured(
1189-
PytestConfigWarning(message), self.hook, stacklevel=2,
1189+
PytestConfigWarning(message), self.hook, stacklevel=3,
11901190
)
11911191

11921192
def _get_unknown_ini_keys(self) -> List[str]:
@@ -1375,7 +1375,7 @@ def _warn_about_missing_assertion(self, mode: str) -> None:
13751375
"(are you using python -O?)\n"
13761376
)
13771377
_issue_warning_captured(
1378-
PytestConfigWarning(warning_text), self.hook, stacklevel=2,
1378+
PytestConfigWarning(warning_text), self.hook, stacklevel=3,
13791379
)
13801380

13811381

0 commit comments

Comments
 (0)