def test_normal_flow(pytester: Pytester, pyfile_with_warnings) -> None:
    """Check that the warnings section is displayed."""
    result = pytester.runpytest(pyfile_with_warnings)
    result.stdout.fnmatch_lines(
        [
            f"*== {WARNINGS_SUMMARY_HEADER} ==*",
            "test_normal_flow.py::test_func",
            "*normal_flow_module.py:3: UserWarning: user warning",
            '*  warnings.warn(UserWarning("user warning"))',
            "*normal_flow_module.py:4: RuntimeWarning: runtime warning",
            '*  warnings.warn(RuntimeWarning("runtime warning"))',
            "* 1 passed, 2 warnings*",
        ]
    )
Check that the warnings section is displayed.
testing/test_warnings.py