code: def test_load_setuptools_instantiation(
      monkeypatch, pm: PluginManager
  ) -> None:
      class EntryPoint:
          name = "myname"
          group = "hello"
          value = "myname:foo"
  
          def load(self):
              class PseudoPlugin:
                  x = 42
  
              return PseudoPlugin()
  
      class Distribution:
          entry_points = (EntryPoint(),)
  
      dist = Distribution()
  
      def my_distributions():
          return (dist,)
  
      monkeypatch.setattr(
          importlib_metadata, "distributions", my_distributions
      )
      num = pm.load_setuptools_entrypoints("hello")
      assert num == 1
      plugin = pm.get_plugin("myname")
      assert plugin is not None
      assert plugin.x == 42
      ret = pm.list_plugin_distinfo()
      # poor man's `assert ret == [(plugin, mock.ANY)]`
      assert len(ret) == 1
      assert len(ret[0]) == 2
      assert ret[0][0] == plugin
      assert ret[0][1]._dist == dist  # type: ignore[comparison-overlap]
      num = pm.load_setuptools_entrypoints("hello")
      assert num == 0
  
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 25 for calling a global function with example usage: test_load_setuptools_instantiation(monkeypatch, pm) and returns: dist, PseudoPlugin