Capture warnings during `pytest_configure`

Fix #5115
This commit is contained in:
dmitry.dygalo
2019-08-12 07:47:40 +02:00
committed by Bruno Oliveira
parent a295a3ddaf
commit 7183335e62
3 changed files with 22 additions and 1 deletions

View File

@@ -642,7 +642,9 @@ class Config:
def _do_configure(self):
assert not self._configured
self._configured = True
self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
with warnings.catch_warnings():
warnings.simplefilter("default")
self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
def _ensure_unconfigure(self):
if self._configured: