Handle -p plug after -p no:plug.

This can be used to override a blocked plugin (e.g. in "addopts") from the
command line etc.
This commit is contained in:
Daniel Hahler
2019-03-16 15:29:27 +01:00
parent c1e01c2992
commit 15fe8c6e90
3 changed files with 19 additions and 0 deletions

View File

@@ -346,3 +346,10 @@ class TestPytestPluginManagerBootstrapming(object):
l2 = pytestpm.get_plugins()
assert 42 not in l2
assert 43 not in l2
def test_blocked_plugin_can_be_used(self, pytestpm):
pytestpm.consider_preparse(["xyz", "-p", "no:abc", "-p", "abc"])
assert pytestpm.has_plugin("abc")
assert not pytestpm.is_blocked("abc")
assert not pytestpm.is_blocked("pytest_abc")