code: def test_non_wrapper_generator(pm: PluginManager) -> None:
      """A hookimpl can be a generator without being a wrapper,
      meaning it returns an iterator result."""
  
      class Api:
          @hookspec
          def hello(self) -> Iterator[int]:
              raise NotImplementedError()
  
      pm.add_hookspecs(Api)
  
      class Plugin1:
          @hookimpl
          def hello(self):
              yield 1
  
      class Plugin2:
          @hookimpl
          def hello(self):
              yield 2
              yield 3
  
      class Plugin3:
          @hookimpl(wrapper=True)
          def hello(self):
              return (yield)
  
      pm.register(Plugin1())
      pm.register(Plugin2())  # wrapper
      res = pm.hook.hello()
      assert [y for x in res for y in x] == [2, 3, 1]
      pm.register(Plugin3())
      res = pm.hook.hello()
      assert [y for x in res for y in x] == [2, 3, 1]
  
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 11 for calling a global function with example usage: test_non_wrapper_generator(pm) and returns: unknown