code: def test_parse_hookimpl_override() -> None:
      class MyPluginManager(PluginManager):
          def parse_hookimpl_opts(self, module_or_class, name):
              opts = PluginManager.parse_hookimpl_opts(
                  self, module_or_class, name
              )
              if opts is None:
                  if name.startswith("x1"):
                      opts = {}  # type: ignore[assignment]
              return opts
  
      class Plugin:
          def x1meth(self):
              pass
  
          @hookimpl(hookwrapper=True, tryfirst=True)
          def x1meth2(self):
              yield  # pragma: no cover
  
          @hookimpl(wrapper=True, trylast=True)
          def x1meth3(self):
              return (yield)  # pragma: no cover
  
      class Spec:
          @hookspec
          def x1meth(self):
              pass
  
          @hookspec
          def x1meth2(self):
              pass
  
          @hookspec
          def x1meth3(self):
              pass
  
      pm = MyPluginManager(hookspec.project_name)
      pm.register(Plugin())
      pm.add_hookspecs(Spec)
  
      hookimpls = pm.hook.x1meth.get_hookimpls()
      assert len(hookimpls) == 1
      assert not hookimpls[0].hookwrapper
      assert not hookimpls[0].wrapper
      assert not hookimpls[0].tryfirst
      assert not hookimpls[0].trylast
      assert not hookimpls[0].optionalhook
  
      hookimpls = pm.hook.x1meth2.get_hookimpls()
      assert len(hookimpls) == 1
      assert hookimpls[0].hookwrapper
      assert not hookimpls[0].wrapper
      assert hookimpls[0].tryfirst
  
      hookimpls = pm.hook.x1meth3.get_hookimpls()
      assert len(hookimpls) == 1
      assert not hookimpls[0].hookwrapper
      assert hookimpls[0].wrapper
      assert not hookimpls[0].tryfirst
      assert hookimpls[0].trylast
  
file_path: catboost/contrib/python/pluggy/py3/tests/test_details.py
imports: import pytest
  from pluggy import HookimplMarker
  from pluggy import HookspecMarker
  from pluggy import PluginManager
label_desc: Use image node_id 1 for calling a global function with example usage: test_parse_hookimpl_override() and returns: opts, unknown