-
Notifications
You must be signed in to change notification settings - Fork 136
Closed
Labels
Description
We already have support for deprecating hooks, where a warning is issued if any plugin implements a deprecated hook.
Recently in pytest 3.8 we introduced a new hook, pytest_warning_captured(warning_message, when, item).
Problem is that only later I realized that item is incompatible with xdist (pytest-dev/pytest-xdist#341) because we can't transfer pytest.Item objects between workers and master. 😓
I would like then to deprecate the item parameter by issuing a warning if a hook implementation uses it.
Given our current deprecation support of hook impls:
@hookspec(historic=True, warn_on_impl=DeprecationWarning("pytest_namespace() is deprecated"))
def pytest_namespace():
...I propose:
@hookspec(historic=True, warn_on_param_impl={'item': DeprecationWarning('item deprecated because of reasons'})
def pytest_warning_captured(warning_message, item, when):
...What do you guys think?