code: def test_make_hook_recorder(pytester: Pytester) -> None:
      item = pytester.getitem("def test_func(): pass")
      recorder = pytester.make_hook_recorder(item.config.pluginmanager)
      assert not recorder.getfailures()
  
      # (The silly condition is to fool mypy that the code below this is reachable)
      if 1 + 1 == 2:
          pytest.xfail("internal reportrecorder tests need refactoring")
  
      class rep:
          excinfo = None
          passed = False
          failed = True
          skipped = False
          when = "call"
  
      recorder.hook.pytest_runtest_logreport(report=rep)  # type: ignore[attr-defined]
      failures = recorder.getfailures()
      assert failures == [rep]  # type: ignore[comparison-overlap]
      failures = recorder.getfailures()
      assert failures == [rep]  # type: ignore[comparison-overlap]
  
      class rep2:
          excinfo = None
          passed = False
          failed = False
          skipped = True
          when = "call"
  
      rep2.passed = False
      rep2.skipped = True
      recorder.hook.pytest_runtest_logreport(report=rep2)  # type: ignore[attr-defined]
  
      modcol = pytester.getmodulecol("")
      rep3 = modcol.config.hook.pytest_make_collect_report(
          collector=modcol
      )
      rep3.passed = False
      rep3.failed = True
      rep3.skipped = False
      recorder.hook.pytest_collectreport(report=rep3)  # type: ignore[attr-defined]
  
      passed, skipped, failed = recorder.listoutcomes()
      assert not passed and skipped and failed
  
      numpassed, numskipped, numfailed = recorder.countoutcomes()
      assert numpassed == 0
      assert numskipped == 1
      assert numfailed == 1
      assert len(recorder.getfailedcollections()) == 1
  
      recorder.unregister()  # type: ignore[attr-defined]
      recorder.clear()
      recorder.hook.pytest_runtest_logreport(report=rep3)  # type: ignore[attr-defined]
      pytest.raises(ValueError, recorder.getfailures)
  
imports: import os
  import subprocess
  import sys
  import time
  from types import ModuleType
  from typing import List
  import _pytest.pytester
  import pytest
  from _pytest.config import ExitCode
  from _pytest.config import PytestPluginManager
  from _pytest.monkeypatch import MonkeyPatch
  from _pytest.pytester import HookRecorder
  from _pytest.pytester import LineMatcher
  from _pytest.pytester import Pytester
  from _pytest.pytester import SysModulesSnapshot
  from _pytest.pytester import SysPathsSnapshot
label_desc: Use image node_id 1 for calling a global function with example usage: test_make_hook_recorder(pytester) without return types