Skip to content

Commit 95de11a

Browse files
committed
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.
1 parent 05cfdcc commit 95de11a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

_pytest/config.py

+4
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ def parse_hookspec_opts(self, module_or_class, name):
242242
return opts
243243

244244
def register(self, plugin, name=None):
245+
if name == 'pytest_catchlog':
246+
self._warn('pytest-catchlog plugin has been merged into the core, '
247+
'please remove it from your requirements.')
248+
return
245249
ret = super(PytestPluginManager, self).register(plugin, name)
246250
if ret:
247251
self.hook.pytest_plugin_registered.call_historic(

testing/deprecated_test.py

+13
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,16 @@ def test_func(i):
9999
"*Metafunc.addcall is deprecated*",
100100
"*2 passed, 2 warnings*",
101101
])
102+
103+
104+
def test_pytest_catchlog_deprecated(testdir):
105+
testdir.makepyfile("""
106+
def test_func(pytestconfig):
107+
pytestconfig.pluginmanager.register(None, 'pytest_catchlog')
108+
""")
109+
res = testdir.runpytest()
110+
assert res.ret == 0
111+
res.stdout.fnmatch_lines([
112+
"*pytest-catchlog plugin has been merged into the core*",
113+
"*1 passed, 1 warnings*",
114+
])

0 commit comments

Comments
 (0)