def _mark_plugins_for_rewrite(
        self, hook: AssertionRewritingHook, disable_autoload: bool
    ) -> None:
        """Given an importhook, mark for rewrite any top-level
        modules or packages in the distribution package for
        all pytest plugins."""
        self.pluginmanager.rewrite_hook = hook

        if disable_autoload:
            # We don't autoload from distribution package entry points,
            # no need to continue.
            return

        package_files = (
            str(file)
            for dist in importlib.metadata.distributions()
            if any(ep.group == "pytest11" for ep in dist.entry_points)
            for file in dist.files or []
        )

        for name in _iter_rewritable_modules(package_files):
            hook.mark_rewrite(name)
Given an importhook, mark for rewrite any top-level
        modules or packages in the distribution package for
        all pytest plugins.
src/_pytest/config/__init__.py