Consider entry points for PYTEST_PLUGINS
and pytest_plugins
#12624
Labels
topic: config
related to config handling, argument parsing and config file
topic: reporting
related to terminal output and user-facing messages and errors
What's the problem this feature will solve?
Currently it is not possible to load plugins via
PYTEST_PLUGINS
/pytest_plugins
using their entry points. Only module names are recognized.Describe the solution you'd like
The simple add of
consider_entry_points=True
to theself.import_plugin()
call in the_import_plugin_specs()
allows to load plugins using their entry points.See also #12615 (comment)
Alternative Solutions
It is possible to use different ways to load plugins (like
-p
option), but alternatives have other drawbacks. For example list of plugins loaded using-p
is not passed down torunpytest()
calls.It is also possible to use module names in
PYTEST_PLUGINS
/pytest_plugins
, but this would need to use not so well known plugin names and it also does have a problem that plugins loaded this way are not listed in the test report (bug #12615).Additional context
N/A
The text was updated successfully, but these errors were encountered: