change stacklevel in warnings from 2 to 3

This commit is contained in:
Gleb Nikonorov 2020-06-28 10:48:33 -04:00
parent c39655725a
commit 49ec2aed0f
1 changed files with 2 additions and 2 deletions

View File

@ -1186,7 +1186,7 @@ class Config:
from _pytest.warnings import _issue_warning_captured
_issue_warning_captured(
PytestConfigWarning(message), self.hook, stacklevel=2,
PytestConfigWarning(message), self.hook, stacklevel=3,
)
def _get_unknown_ini_keys(self) -> List[str]:
@ -1375,7 +1375,7 @@ class Config:
"(are you using python -O?)\n"
)
_issue_warning_captured(
PytestConfigWarning(warning_text), self.hook, stacklevel=2,
PytestConfigWarning(warning_text), self.hook, stacklevel=3,
)