code: def test_hookrecorder_basic(holder) -> None:
      pm = PytestPluginManager()
      pm.add_hookspecs(holder)
      rec = HookRecorder(pm, _ispytest=True)
      pm.hook.pytest_xyz(arg=123)
      call = rec.popcall("pytest_xyz")
      assert call.arg == 123
      assert call._name == "pytest_xyz"
      pytest.raises(pytest.fail.Exception, rec.popcall, "abc")
      pm.hook.pytest_xyz_noarg()
      call = rec.popcall("pytest_xyz_noarg")
      assert call._name == "pytest_xyz_noarg"
  
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 9 for calling a global function with example usage: test_hookrecorder_basic(holder) without return types