code: def test_recwarn_functional(pytester: Pytester) -> None:
      pytester.makepyfile(
          """
          import warnings
          def test_method(recwarn):
              warnings.warn("hello")
              warn = recwarn.pop()
              assert isinstance(warn.message, UserWarning)
      """
      )
      reprec = pytester.inline_run()
      reprec.assertoutcome(passed=1)
  
imports: import warnings
  from typing import List
  from typing import Optional
  from typing import Type
  import pytest
  from _pytest.pytester import Pytester
  from _pytest.recwarn import WarningsRecorder
label_desc: Use image node_id 2 for calling a global function with example usage: test_recwarn_functional(pytester) without return types