code: def test_non_string_warning_argument(pytester: Pytester) -> None:
      """Non-str argument passed to warning breaks pytest (#2956)"""
      pytester.makepyfile(
          """\
          import warnings
          import pytest
  
          def test():
              warnings.warn(UserWarning(1, 'foo'))
          """
      )
      result = pytester.runpytest("-W", "always::UserWarning")
      result.stdout.fnmatch_lines(["*= 1 passed, 1 warning in *"])
  
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 9 for calling a global function with example usage: test_non_string_warning_argument(pytester) without return types