Support new `pytest_warning_recorded` hook from pytest 6.0

This commit is contained in:
Bruno Oliveira
2020-07-08 17:51:45 -03:00
parent 77a1db27cd
commit b25757199c
3 changed files with 31 additions and 1 deletions

View File

@@ -359,6 +359,17 @@ class WorkerController(object):
when=kwargs["when"],
item=kwargs["item"],
)
elif eventname == "warning_recorded":
warning_message = unserialize_warning_message(
kwargs["warning_message_data"]
)
self.notify_inproc(
eventname,
warning_message=warning_message,
when=kwargs["when"],
nodeid=kwargs["nodeid"],
location=kwargs["location"],
)
else:
raise ValueError("unknown event: {}".format(eventname))
except KeyboardInterrupt: