diff --git a/_pytest/config.py b/_pytest/config.py index 0343951da..6eb2d6c5c 100644 --- a/_pytest/config.py +++ b/_pytest/config.py @@ -242,6 +242,10 @@ class PytestPluginManager(PluginManager): return opts 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) if ret: self.hook.pytest_plugin_registered.call_historic( diff --git a/testing/deprecated_test.py b/testing/deprecated_test.py index 6e1e16331..f3c40cb3d 100644 --- a/testing/deprecated_test.py +++ b/testing/deprecated_test.py @@ -99,3 +99,16 @@ def test_metafunc_addcall_deprecated(testdir): "*Metafunc.addcall is deprecated*", "*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*", + ])