Consider entry points for PYTEST_PLUGINS and pytest_plugins#14752
Merged
Conversation
The PYTEST_PLUGINS environment variable and the pytest_plugins global variable previously accepted only importable module names, while the -p command-line option also accepted entry point names of installed plugins. Pass consider_entry_points=True when importing plugin specs so that all three mechanisms behave consistently (pytest-dev#12624). As a side effect, plugins specified by entry point name through these mechanisms now show up in the 'plugins:' line of the terminal header and in --traceconfig output, since entry-point loading records distribution info (pytest-dev#12615). Based on the original implementation by Marcel Telka in pytest-dev#12616. Co-authored-by: Marcel Telka <marcel@telka.sk> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Zac-HD
enabled auto-merge (squash)
July 21, 2026 21:03
RonnyPfannschmidt
approved these changes
Jul 22, 2026
pld-gitsync
pushed a commit
to pld-linux/python3-pytest
that referenced
this pull request
Jul 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
PYTEST_PLUGINSenvironment variable and thepytest_pluginsglobal variable previously accepted only importable module names, while the-pcommand-line option also accepted entry point names of installed plugins.Pass
consider_entry_points=Truewhen importing plugin specs so that all three mechanisms behave consistently (fixes #12624). As a side effect, plugins specified by entry point name through these mechanisms now show up in the 'plugins:' line of the terminal header and in --traceconfig output, since entry-point loading records distribution info (fixes #12615).Based on the original implementation by Marcel Telka, and thus closes #12616.