code: def test_group_warnings_by_message_summary(
      pytester: Pytester,
  ) -> None:
      pytester.copy_example(
          "warnings/test_group_warnings_by_message_summary"
      )
      pytester.syspathinsert()
      result = pytester.runpytest()
      result.stdout.fnmatch_lines(
          [
              "*== %s ==*" % WARNINGS_SUMMARY_HEADER,
              "test_1.py: 21 warnings",
              "test_2.py: 1 warning",
              "  */test_1.py:7: UserWarning: foo",
              "    warnings.warn(UserWarning(msg))",
              "",
              "test_1.py: 20 warnings",
              "  */test_1.py:7: UserWarning: bar",
              "    warnings.warn(UserWarning(msg))",
              "",
              "-- Docs: *",
              "*= 42 passed, 42 warnings *",
          ],
          consecutive=True,
      )
  
imports: import os
  import sys
  import warnings
  from typing import List
  from typing import Optional
  from typing import Tuple
  import pytest
  from _pytest.fixtures import FixtureRequest
  from _pytest.pytester import Pytester
label_desc: Use image node_id 20 for calling a global function with example usage: test_group_warnings_by_message_summary(pytester) without return types