Do not implement pytest_logwarning in pytest versions where it is deprecated
Fix #406
This commit is contained in:
1
changelog/406.bugfix.rst
Normal file
1
changelog/406.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Do not implement deprecated ``pytest_logwarning`` hook in pytest versions where it is deprecated.
|
||||||
@@ -115,8 +115,10 @@ class WorkerInteractor(object):
|
|||||||
data = serialize_report(report)
|
data = serialize_report(report)
|
||||||
self.sendevent("collectreport", data=data)
|
self.sendevent("collectreport", data=data)
|
||||||
|
|
||||||
# the pytest_logwarning hook was removed in pytest 4.1
|
# the pytest_logwarning hook was deprecated since pytest 4.0
|
||||||
if hasattr(_pytest.hookspec, "pytest_logwarning"):
|
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):
|
def pytest_logwarning(self, message, code, nodeid, fslocation):
|
||||||
self.sendevent(
|
self.sendevent(
|
||||||
|
|||||||
Reference in New Issue
Block a user