Add test to branch

This commit is contained in:
Fabien ZARIFIAN 2018-11-05 00:14:35 +01:00 committed by GitHub
parent c55ca155e9
commit a447dc86fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 17 additions and 0 deletions

View File

@ -380,3 +380,20 @@ class TestPytestPluginManagerBootstrapming(object):
pytestpm.consider_preparse(["xyz", "-p", "no:abc"])
l2 = pytestpm.get_plugins()
assert 42 not in l2
def test_plugin_prevent_register_stepwise_on_cacheprovider_unregister(self, pytestpm):
""" From PR #4304 : The only way to unregister a module is documented at
the end of https://docs.pytest.org/en/latest/plugins.html.
When unregister cacheprovider, then unregister stepwise too
"""
pytestpm.register(42, name="cacheprovider")
pytestpm.register(43, name="stepwise")
l1 = pytestpm.get_plugins()
assert 42 in l1
assert 43 in l1
pytestpm.consider_preparse(["xyz", "-p", "no:cacheprovider"])
l2 = pytestpm.get_plugins()
assert 42 not in l2
assert 43 not in l2