diff --git a/changelog/384.bugfix.rst b/changelog/384.bugfix.rst new file mode 100644 index 0000000..2ea011e --- /dev/null +++ b/changelog/384.bugfix.rst @@ -0,0 +1 @@ +Add support for pytest 4.1. diff --git a/xdist/workermanage.py b/xdist/workermanage.py index c6f0010..418a66c 100644 --- a/xdist/workermanage.py +++ b/xdist/workermanage.py @@ -345,7 +345,11 @@ class WorkerController(object): except: # noqa from _pytest._code import ExceptionInfo - excinfo = ExceptionInfo() + # ExceptionInfo API changed in pytest 4.1 + if hasattr(ExceptionInfo, "from_current"): + excinfo = ExceptionInfo.from_current() + else: + excinfo = ExceptionInfo() print("!" * 20, excinfo) self.config.notify_exception(excinfo) self.shutdown()