Block pytest-catchlog and issue a warning
Trying to install pytest-3.3 and pytest-catchlog will result in an option conflicts because both declare the same options.
This commit is contained in:
parent
05cfdcc8cb
commit
95de11a44e
|
@ -242,6 +242,10 @@ class PytestPluginManager(PluginManager):
|
||||||
return opts
|
return opts
|
||||||
|
|
||||||
def register(self, plugin, name=None):
|
def register(self, plugin, name=None):
|
||||||
|
if name == 'pytest_catchlog':
|
||||||
|
self._warn('pytest-catchlog plugin has been merged into the core, '
|
||||||
|
'please remove it from your requirements.')
|
||||||
|
return
|
||||||
ret = super(PytestPluginManager, self).register(plugin, name)
|
ret = super(PytestPluginManager, self).register(plugin, name)
|
||||||
if ret:
|
if ret:
|
||||||
self.hook.pytest_plugin_registered.call_historic(
|
self.hook.pytest_plugin_registered.call_historic(
|
||||||
|
|
|
@ -99,3 +99,16 @@ def test_metafunc_addcall_deprecated(testdir):
|
||||||
"*Metafunc.addcall is deprecated*",
|
"*Metafunc.addcall is deprecated*",
|
||||||
"*2 passed, 2 warnings*",
|
"*2 passed, 2 warnings*",
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
def test_pytest_catchlog_deprecated(testdir):
|
||||||
|
testdir.makepyfile("""
|
||||||
|
def test_func(pytestconfig):
|
||||||
|
pytestconfig.pluginmanager.register(None, 'pytest_catchlog')
|
||||||
|
""")
|
||||||
|
res = testdir.runpytest()
|
||||||
|
assert res.ret == 0
|
||||||
|
res.stdout.fnmatch_lines([
|
||||||
|
"*pytest-catchlog plugin has been merged into the core*",
|
||||||
|
"*1 passed, 1 warnings*",
|
||||||
|
])
|
||||||
|
|
Loading…
Reference in New Issue