code: def test_with_callbacks_immediately_executed(pm):
      class Hooks(object):
          @hookspec(historic=True)
          def he_method1(self, arg):
              pass
  
      pm.add_hookspecs(Hooks)
  
      class Plugin1(object):
          @hookimpl
          def he_method1(self, arg):
              return arg * 10
  
      class Plugin2(object):
          @hookimpl
          def he_method1(self, arg):
              return arg * 20
  
      class Plugin3(object):
          @hookimpl
          def he_method1(self, arg):
              return arg * 30
  
      out = []
      pm.register(Plugin1())
      pm.register(Plugin2())
  
      he_method1 = pm.hook.he_method1
      he_method1.call_historic(lambda res: out.append(res), dict(arg=1))
      assert out == [20, 10]
      pm.register(Plugin3())
      assert out == [20, 10, 30]
  
imports: import pytest
  import types
  from pluggy import PluginManager, PluginValidationError, HookCallError, HookimplMarker, HookspecMarker
  from pluggy.manager import importlib_metadata
label_desc: Use image node_id 13 for calling a global function with example usage: test_with_callbacks_immediately_executed(pm) and returns: unknown, unknown, unknown