pluginmanager.consider_preparse: add exclude_only kwarg (#6443)

Plugins specified with ``-p`` are now loaded after internal plugins, which
results in their hooks being called *before* the internal ones.

This makes the ``-p`` behavior consistent with ``PYTEST_PLUGINS``.

* fix/adjust test_disable_plugin_autoload
* adjust test_plugin_loading_order
This commit is contained in:
Daniel Hahler
2020-02-03 14:10:54 +01:00
committed by GitHub
parent 8ec4d03c91
commit 75714ee707
4 changed files with 21 additions and 8 deletions

View File

@@ -679,10 +679,7 @@ class TestStackLevel:
# with stacklevel=2 the warning should originate from
# config.PytestPluginManager.import_plugin is thrown by a skipped plugin
# During config parsing the the pluginargs are checked in a while loop
# that as a result of the argument count runs import_plugin twice, hence
# two identical warnings are captured (is this intentional?).
assert len(capwarn.captured) == 2
assert len(capwarn.captured) == 1
warning, location = capwarn.captured.pop()
file, _, func = location