Skip to content

Commit

Permalink
Do not implement pytest_logwarning in pytest versions where it is dep…
Browse files Browse the repository at this point in the history
…recated

Fix #406
  • Loading branch information
nicoddemus committed Jan 28, 2019
1 parent f00f9ec commit c5f65b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions changelog/406.bugfix.rst
@@ -0,0 +1 @@
Do not implement deprecated ``pytest_logwarning`` hook in pytest versions where it is deprecated.
6 changes: 4 additions & 2 deletions xdist/remote.py
Expand Up @@ -115,8 +115,10 @@ def pytest_collectreport(self, report):
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(
Expand Down

0 comments on commit c5f65b3

Please sign in to comment.