| 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 |