Merge pull request #407 from nicoddemus/pytest-logwarning-deprecation

Handle pytest_logwarning deprecation better and prepare next release
This commit is contained in:
Bruno Oliveira
2019-01-28 18:52:09 -02:00
committed by GitHub
2 changed files with 13 additions and 2 deletions

View File

@@ -1,3 +1,12 @@
pytest-xdist 1.26.1 (2019-01-28)
================================
Bug Fixes
---------
- `#406 <https://github.com/pytest-dev/pytest-xdist/issues/406>`_: Do not implement deprecated ``pytest_logwarning`` hook in pytest versions where it is deprecated.
pytest-xdist 1.26.0 (2019-01-11)
================================

View File

@@ -115,8 +115,10 @@ class WorkerInteractor(object):
data = serialize_report(report)
self.sendevent("collectreport", data=data)
# the pytest_logwarning hook was removed in pytest 4.1
if hasattr(_pytest.hookspec, "pytest_logwarning"):
# the pytest_logwarning hook was deprecated since pytest 4.0
if hasattr(
_pytest.hookspec, "pytest_logwarning"
) and not _pytest.hookspec.pytest_logwarning.pytest_spec.get("warn_on_impl"):
def pytest_logwarning(self, message, code, nodeid, fslocation):
self.sendevent(