code: def test_only_kwargs(pm: PluginManager) -> None:
      class Api:
          @hookspec
          def hello(self, arg):
              "api hook 1"
  
      pm.add_hookspecs(Api)
      with pytest.raises(TypeError) as exc:
          pm.hook.hello(3)  # type: ignore[call-arg]
  
      message = (
          "__call__() takes 1 positional argument but 2 were given"
      )
      assert message in str(exc.value)
  
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 2 for calling a global function with example usage: test_only_kwargs(pm) without return types