code: def test_hook_conflict(pm: PluginManager) -> None:
      class Api1:
          @hookspec
          def conflict(self) -> None:
              """Api1 hook"""
  
      class Api2:
          @hookspec
          def conflict(self) -> None:
              """Api2 hook"""
  
      pm.add_hookspecs(Api1)
      with pytest.raises(ValueError) as exc:
          pm.add_hookspecs(Api2)
      assert str(exc.value) == (
          "Hook 'conflict' is already registered within namespace "
          "<class '__tests__.test_hookcaller.test_hook_conflict.<locals>.Api1'>"
      )
  
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 17 for calling a global function with example usage: test_hook_conflict(pm) without return types