Check that the warnings section is displayed.
(pytester: Pytester, pyfile_with_warnings)
| 40 | |
| 41 | @pytest.mark.filterwarnings("default::UserWarning", "default::RuntimeWarning") |
| 42 | def test_normal_flow(pytester: Pytester, pyfile_with_warnings) -> None: |
| 43 | """Check that the warnings section is displayed.""" |
| 44 | result = pytester.runpytest(pyfile_with_warnings) |
| 45 | result.stdout.fnmatch_lines( |
| 46 | [ |
| 47 | "*== %s ==*" % WARNINGS_SUMMARY_HEADER, |
| 48 | "test_normal_flow.py::test_func", |
| 49 | "*normal_flow_module.py:3: UserWarning: user warning", |
| 50 | '* warnings.warn(UserWarning("user warning"))', |
| 51 | "*normal_flow_module.py:4: RuntimeWarning: runtime warning", |
| 52 | '* warnings.warn(RuntimeWarning("runtime warning"))', |
| 53 | "* 1 passed, 2 warnings*", |
| 54 | ] |
| 55 | ) |
| 56 | |
| 57 | |
| 58 | @pytest.mark.filterwarnings("always::UserWarning") |
nothing calls this directly
no test coverage detected