code: def test_option_precedence_cmdline_over_ini(
      pytester: Pytester, ignore_on_cmdline
  ) -> None:
      """Filters defined in the command-line should take precedence over filters in ini files (#3946)."""
      pytester.makeini(
          """
          [pytest]
          filterwarnings = error::UserWarning
      """
      )
      pytester.makepyfile(
          """
          import warnings
          def test():
              warnings.warn(UserWarning('hello'))
      """
      )
      args = ["-W", "ignore"] if ignore_on_cmdline else []
      result = pytester.runpytest(*args)
      if ignore_on_cmdline:
          result.stdout.fnmatch_lines(["* 1 passed in*"])
      else:
          result.stdout.fnmatch_lines(["* 1 failed 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 15 for calling a global function with example usage: test_option_precedence_cmdline_over_ini(pytester, ignore_on_cmdline) without return types