Skip to content

Fix distribution tracking for declined entry points - #809

Merged
RonnyPfannschmidt merged 1 commit into
pytest-dev:mainfrom
SIBTAIN-ASAD:fix-entrypoint-declined-distributions
Oct 21, 2026
Merged

RonnyPfannschmidt merged 1 commit into
pytest-dev:mainfrom
SIBTAIN-ASAD:fix-entrypoint-declined-distributions

Conversation

@SIBTAIN-ASAD

Copy link
Copy Markdown
Contributor

Closes #807.

I now use the name returned by register() when recording an entry point distribution. If registration declines the plugin and returns None, the entry point is not counted or added to _name2dist, so distribution listing cannot reference a missing plugin.

The regression test covers both a None entry point and a PluginManager subclass that declines registration. It also checks that a manager-provided registered name is used for the distribution mapping.

Verification:

  • uv run pytest (226 passed)
  • uv run pre-commit run -a
  • git diff --check

@RonnyPfannschmidt RonnyPfannschmidt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@RonnyPfannschmidt
RonnyPfannschmidt merged commit 49c0736 into pytest-dev:main Oct 21, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

list_plugin_distributions() raises KeyError for entry points that register() declined (regression from #767)

2 participants