code: def test_setup_teardown_function_level_with_optional_argument(
      pytester: Pytester,
      monkeypatch,
      arg: str,
  ) -> None:
      """Parameter to setup/teardown xunit-style functions parameter is now optional (#1728)."""
      import sys
  
      trace_setups_teardowns: List[str] = []
      monkeypatch.setattr(
          sys,
          "trace_setups_teardowns",
          trace_setups_teardowns,
          raising=False,
      )
      p = pytester.makepyfile(
          """
          import pytest
          import sys
  
          trace = sys.trace_setups_teardowns.append
  
          def setup_module({arg}): trace('setup_module')
          def teardown_module({arg}): trace('teardown_module')
  
          def setup_function({arg}): trace('setup_function')
          def teardown_function({arg}): trace('teardown_function')
  
          def test_function_1(): pass
          def test_function_2(): pass
  
          class Test(object):
              def setup_method(self, {arg}): trace('setup_method')
              def teardown_method(self, {arg}): trace('teardown_method')
  
              def test_method_1(self): pass
              def test_method_2(self): pass
      """.format(
              arg=arg
          )
      )
      result = pytester.inline_run(p)
      result.assertoutcome(passed=4)
  
      expected = [
          "setup_module",
          "setup_function",
          "teardown_function",
          "setup_function",
          "teardown_function",
          "setup_method",
          "teardown_method",
          "setup_method",
          "teardown_method",
          "teardown_module",
      ]
      assert trace_setups_teardowns == expected
  
file_path: pytest/testing/test_runner_xunit.py
imports: from typing import List
  import pytest
  from _pytest.pytester import Pytester
label_desc: Use image node_id 12 for calling a global function with example usage: test_setup_teardown_function_level_with_optional_argument(pytester, monkeypatch, arg) without return types