code: def test_register(pm: PluginManager) -> None:
      class MyPlugin:
          @hookimpl
          def he_method1(self):
              ...
  
      my = MyPlugin()
      pm.register(my)
      assert pm.get_plugins() == {my}
      my2 = MyPlugin()
      pm.register(my2)
      assert pm.get_plugins() == {my, my2}
  
      assert pm.is_registered(my)
      assert pm.is_registered(my2)
      pm.unregister(my)
      assert not pm.is_registered(my)
      assert pm.get_plugins() == {my2}
  
      with pytest.raises(AssertionError, match=r"not registered"):
          pm.unregister(my)
  
imports: import sys
  from typing import Any
  from typing import List
  import pytest
  from pluggy import HookCallError
  from pluggy import HookimplMarker
  from pluggy import HookspecMarker
  from pluggy import PluginManager
  from pluggy import PluginValidationError
label_desc: Use image node_id 11 for calling a global function with example usage: test_register(pm) without return types