code: def test_module_and_function_setup(pytester: Pytester) -> None:
      reprec = pytester.inline_runsource(
          """
          modlevel = []
          def setup_module(module):
              assert not modlevel
              module.modlevel.append(42)
  
          def teardown_module(module):
              modlevel.pop()
  
          def setup_function(function):
              function.answer = 17
  
          def teardown_function(function):
              del function.answer
  
          def test_modlevel():
              assert modlevel[0] == 42
              assert test_modlevel.answer == 17
  
          class TestFromClass(object):
              def test_module(self):
                  assert modlevel[0] == 42
                  assert not hasattr(test_modlevel, 'answer')
      """
      )
      rep = reprec.matchreport("test_modlevel")
      assert rep.passed
      rep = reprec.matchreport("test_module")
      assert rep.passed
  
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 1 for calling a global function with example usage: test_module_and_function_setup(pytester) without return types