From c5f65b39ecb4992feef28adfc7186912f398a0f7 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 28 Jan 2019 18:05:41 -0200 Subject: [PATCH 1/2] Do not implement pytest_logwarning in pytest versions where it is deprecated Fix #406 --- changelog/406.bugfix.rst | 1 + xdist/remote.py | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 changelog/406.bugfix.rst diff --git a/changelog/406.bugfix.rst b/changelog/406.bugfix.rst new file mode 100644 index 0000000..0f5e41a --- /dev/null +++ b/changelog/406.bugfix.rst @@ -0,0 +1 @@ +Do not implement deprecated ``pytest_logwarning`` hook in pytest versions where it is deprecated. diff --git a/xdist/remote.py b/xdist/remote.py index 1cde135..1ea8898 100644 --- a/xdist/remote.py +++ b/xdist/remote.py @@ -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( From 6fc02bb04a96a46c1e692155e181db5ac254a59e Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 28 Jan 2019 18:07:36 -0200 Subject: [PATCH 2/2] Release 1.26.1 --- CHANGELOG.rst | 9 +++++++++ changelog/406.bugfix.rst | 1 - 2 files changed, 9 insertions(+), 1 deletion(-) delete mode 100644 changelog/406.bugfix.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d8e230a..32b77e6 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,12 @@ +pytest-xdist 1.26.1 (2019-01-28) +================================ + +Bug Fixes +--------- + +- `#406 `_: Do not implement deprecated ``pytest_logwarning`` hook in pytest versions where it is deprecated. + + pytest-xdist 1.26.0 (2019-01-11) ================================ diff --git a/changelog/406.bugfix.rst b/changelog/406.bugfix.rst deleted file mode 100644 index 0f5e41a..0000000 --- a/changelog/406.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Do not implement deprecated ``pytest_logwarning`` hook in pytest versions where it is deprecated.