馃 Written by Claude Opus 5.5 via Claude Code for the pluggy maintainers; I prompted it, it did the work, I read it.
load_setuptools_entrypoints() appends to _plugin_distinfo, but unregister() never removes those entries. After unregistering, list_plugin_distinfo() and list_plugin_distributions() still list the plugin, and that list feeds pytest's "plugins:" header. Re-registering through entry points then adds a duplicate entry.
Confirmed by reading the code and a synthetic repro, not by a real entry-point load.
Proposal: drop the plugin's entries in unregister().
Found while working on #759.
馃 Written by Claude Opus 5.5 via Claude Code for the pluggy maintainers; I prompted it, it did the work, I read it.
load_setuptools_entrypoints()appends to_plugin_distinfo, butunregister()never removes those entries. After unregistering,list_plugin_distinfo()andlist_plugin_distributions()still list the plugin, and that list feeds pytest's "plugins:" header. Re-registering through entry points then adds a duplicate entry.Confirmed by reading the code and a synthetic repro, not by a real entry-point load.
Proposal: drop the plugin's entries in
unregister().Found while working on #759.