Introduce new warning subclasses

Fix #5177
This commit is contained in:
Bruno Oliveira
2019-04-28 10:38:25 -03:00
parent 8532e991a5
commit 53cd7fd2ea
9 changed files with 104 additions and 35 deletions

View File

@@ -60,10 +60,10 @@ class Cache(object):
def warn(self, fmt, **args):
from _pytest.warnings import _issue_warning_captured
from _pytest.warning_types import PytestWarning
from _pytest.warning_types import PytestCacheWarning
_issue_warning_captured(
PytestWarning(fmt.format(**args) if args else fmt),
PytestCacheWarning(fmt.format(**args) if args else fmt),
self._config.hook,
stacklevel=3,
)