code: def test_hook_tracing(he_pm):
      saveindent = []
  
      class api1(object):
          @hookimpl
          def he_method1(self):
              saveindent.append(he_pm.trace.root.indent)
  
      class api2(object):
          @hookimpl
          def he_method1(self):
              saveindent.append(he_pm.trace.root.indent)
              raise ValueError()
  
      he_pm.register(api1())
      out = []
      he_pm.trace.root.setwriter(out.append)
      undo = he_pm.enable_tracing()
      try:
          indent = he_pm.trace.root.indent
          he_pm.hook.he_method1(arg=1)
          assert indent == he_pm.trace.root.indent
          assert len(out) == 2
          assert "he_method1" in out[0]
          assert "finish" in out[1]
  
          out[:] = []
          he_pm.register(api2())
  
          with pytest.raises(ValueError):
              he_pm.hook.he_method1(arg=1)
          assert he_pm.trace.root.indent == indent
          assert saveindent[0] > indent
      finally:
          undo()
  
imports: import pytest
  import types
  from pluggy import PluginManager, PluginValidationError, HookCallError, HookimplMarker, HookspecMarker
  from pluggy.manager import importlib_metadata
label_desc: Use image node_id 23 for calling a global function with example usage: test_hook_tracing(he_pm) without return types