Skip to content

Commit ca03269

Browse files
authored
Merge pull request #407 from nicoddemus/pytest-logwarning-deprecation
Handle pytest_logwarning deprecation better and prepare next release
2 parents f00f9ec + 6fc02bb commit ca03269

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

CHANGELOG.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
pytest-xdist 1.26.1 (2019-01-28)
2+
================================
3+
4+
Bug Fixes
5+
---------
6+
7+
- `#406 <https://github.com/pytest-dev/pytest-xdist/issues/406>`_: Do not implement deprecated ``pytest_logwarning`` hook in pytest versions where it is deprecated.
8+
9+
110
pytest-xdist 1.26.0 (2019-01-11)
211
================================
312

xdist/remote.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,10 @@ def pytest_collectreport(self, report):
115115
data = serialize_report(report)
116116
self.sendevent("collectreport", data=data)
117117

118-
# the pytest_logwarning hook was removed in pytest 4.1
119-
if hasattr(_pytest.hookspec, "pytest_logwarning"):
118+
# the pytest_logwarning hook was deprecated since pytest 4.0
119+
if hasattr(
120+
_pytest.hookspec, "pytest_logwarning"
121+
) and not _pytest.hookspec.pytest_logwarning.pytest_spec.get("warn_on_impl"):
120122

121123
def pytest_logwarning(self, message, code, nodeid, fslocation):
122124
self.sendevent(

0 commit comments

Comments
 (0)