(self, pytester: Pytester)
| 656 | class TestStackLevel: |
| 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 | |
| 670 | return CapturedWarnings |
| 671 | |
| 672 | def test_issue4445_rewrite(self, pytester: Pytester, capwarn) -> None: |
| 673 | """#4445: Make sure the warning points to a reasonable location |
nothing calls this directly
no test coverage detected