code: def test_hookrelay_registration_by_specname(
      pm: PluginManager,
  ) -> None:
      """Verify hook caller instances may also be registered by specifying a
      specname option to the hookimpl"""
  
      class Api:
          @hookspec
          def hello(self, arg: object) -> None:
              "api hook 1"
  
      pm.add_hookspecs(Api)
      hook = pm.hook
      assert hasattr(hook, "hello")
      assert len(pm.hook.hello.get_hookimpls()) == 0
  
      class Plugin:
          @hookimpl(specname="hello")
          def foo(self, arg: int) -> int:
              return arg + 1
  
      plugin = Plugin()
      pm.register(plugin)
      out = hook.hello(arg=3)
      assert out == [4]
  
imports: from typing import Callable
  from typing import List
  from typing import Sequence
  from typing import TypeVar
  import pytest
  from pluggy import HookimplMarker
  from pluggy import HookspecMarker
  from pluggy import PluginManager
  from pluggy import PluginValidationError
  from pluggy._hooks import _HookCaller
  from pluggy._hooks import HookImpl
label_desc: Use image node_id 15 for calling a global function with example usage: test_hookrelay_registration_by_specname(pm) and returns: unknown