From 5c676aa685e15465ff58a8b5078e0f8c93174ebe Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Thu, 4 Apr 2024 16:49:00 +0300 Subject: [PATCH] dsession,workermanage: drop handling of `pytest_captured_warning` Since d153e0a4c4b764c821da9907ba3d2cac31bc3884 the remote doesn't send events for this hook at all (I think perhaps wrongly, but it's history by now), so no point in handling it in the coordinator side. --- src/xdist/dsession.py | 7 ------- src/xdist/workermanage.py | 10 ---------- 2 files changed, 17 deletions(-) diff --git a/src/xdist/dsession.py b/src/xdist/dsession.py index 941e44b..6590707 100644 --- a/src/xdist/dsession.py +++ b/src/xdist/dsession.py @@ -317,13 +317,6 @@ class DSession: assert not rep.passed self._failed_worker_collectreport(node, rep) - def worker_warning_captured(self, warning_message, when, item): - """Emitted when a node calls the pytest_warning_captured hook (deprecated in 6.0).""" - # This hook as been removed in pytest 7.1, and we can remove support once we only - # support pytest >=7.1. - kwargs = dict(warning_message=warning_message, when=when, item=item) - self.config.hook.pytest_warning_captured.call_historic(kwargs=kwargs) - def worker_warning_recorded(self, warning_message, when, nodeid, location): """Emitted when a node calls the pytest_warning_recorded hook.""" kwargs = dict( diff --git a/src/xdist/workermanage.py b/src/xdist/workermanage.py index d2f790f..d7b12f9 100644 --- a/src/xdist/workermanage.py +++ b/src/xdist/workermanage.py @@ -374,16 +374,6 @@ class WorkerController: nodeid=kwargs["nodeid"], fslocation=kwargs["nodeid"], ) - elif eventname == "warning_captured": - warning_message = unserialize_warning_message( - kwargs["warning_message_data"] - ) - self.notify_inproc( - eventname, - warning_message=warning_message, - when=kwargs["when"], - item=kwargs["item"], - ) elif eventname == "warning_recorded": warning_message = unserialize_warning_message( kwargs["warning_message_data"]