MCPcopy Create free account
hub / github.com/pytest-dev/pytest / CapturedWarnings

Class CapturedWarnings

testing/test_warnings.py:659–666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

657 @pytest.fixture
658 def capwarn(self, pytester: Pytester):
659 class CapturedWarnings:
660 captured: List[
661 Tuple[warnings.WarningMessage, Optional[Tuple[str, int, str]]]
662 ] = []
663
664 @classmethod
665 def pytest_warning_recorded(cls, warning_message, when, nodeid, location):
666 cls.captured.append((warning_message, location))
667
668 pytester.plugins = [CapturedWarnings()]
669

Callers 1

capwarnMethod · 0.85

Calls

no outgoing calls

Tested by 1

capwarnMethod · 0.68