Propagate internal errors to the master node

This should help users diagnose internal errors in workers like
exceptions from hooks or in pytest itself.
This commit is contained in:
Bruno Oliveira
2020-12-12 11:34:57 -03:00
parent 948f13730d
commit 16d636391b
5 changed files with 36 additions and 1 deletions

View File

@@ -33,8 +33,10 @@ class WorkerInteractor:
self.channel.send((name, kwargs))
def pytest_internalerror(self, excrepr):
for line in str(excrepr).split("\n"):
formatted_error = str(excrepr)
for line in formatted_error.split("\n"):
self.log("IERROR>", line)
interactor.sendevent("internal_error", formatted_error=formatted_error)
def pytest_sessionstart(self, session):
self.session = session