(pytester: Pytester)
| 613 | |
| 614 | @pytest.mark.filterwarnings("always::UserWarning") |
| 615 | def test_group_warnings_by_message_summary(pytester: Pytester) -> None: |
| 616 | pytester.copy_example("warnings/test_group_warnings_by_message_summary") |
| 617 | pytester.syspathinsert() |
| 618 | result = pytester.runpytest() |
| 619 | result.stdout.fnmatch_lines( |
| 620 | [ |
| 621 | "*== %s ==*" % WARNINGS_SUMMARY_HEADER, |
| 622 | "test_1.py: 21 warnings", |
| 623 | "test_2.py: 1 warning", |
| 624 | " */test_1.py:7: UserWarning: foo", |
| 625 | " warnings.warn(UserWarning(msg))", |
| 626 | "", |
| 627 | "test_1.py: 20 warnings", |
| 628 | " */test_1.py:7: UserWarning: bar", |
| 629 | " warnings.warn(UserWarning(msg))", |
| 630 | "", |
| 631 | "-- Docs: *", |
| 632 | "*= 42 passed, 42 warnings *", |
| 633 | ], |
| 634 | consecutive=True, |
| 635 | ) |
| 636 | |
| 637 | |
| 638 | def test_pytest_configure_warning(pytester: Pytester, recwarn) -> None: |
nothing calls this directly
no test coverage detected