code: def test_firstresult_force_result_hookwrapper(
      pm: PluginManager,
  ) -> None:
      """Verify forcing a result in a wrapper."""
  
      class Api:
          @hookspec(firstresult=True)
          def hello(self, arg):
              "api hook 1"
  
      pm.add_hookspecs(Api)
  
      class Plugin1:
          @hookimpl
          def hello(self, arg):
              return arg + 1
  
      class Plugin2:
          @hookimpl(hookwrapper=True)
          def hello(self, arg):
              assert arg == 3
              outcome = yield
              assert outcome.get_result() == 4
              outcome.force_result(0)
  
      class Plugin3:
          @hookimpl
          def hello(self, arg):
              return None
  
      pm.register(Plugin1())
      pm.register(Plugin2())  # wrapper
      pm.register(Plugin3())  # ignored since returns None
      res = pm.hook.hello(arg=3)
      assert res == 0
  
file_path: catboost/contrib/python/pluggy/py3/tests/test_invocations.py
imports: from typing import Iterator
  import pytest
  from pluggy import HookimplMarker
  from pluggy import HookspecMarker
  from pluggy import PluginManager
  from pluggy import PluginValidationError
label_desc: Use image node_id 6 for calling a global function with example usage: test_firstresult_force_result_hookwrapper(pm) and returns: unknown, None