diff --git a/changelog/442.feature.rst b/changelog/442.feature.rst new file mode 100644 index 00000000..700b012e --- /dev/null +++ b/changelog/442.feature.rst @@ -0,0 +1 @@ +Compatibility fix for upcoming pytest 5.0: ``session.exitstatus`` is now an ``IntEnum`` object. diff --git a/src/xdist/remote.py b/src/xdist/remote.py index d87ff4cf..d06096cb 100644 --- a/src/xdist/remote.py +++ b/src/xdist/remote.py @@ -41,7 +41,8 @@ def pytest_sessionstart(self, session): @pytest.hookimpl(hookwrapper=True) def pytest_sessionfinish(self, exitstatus): - self.config.workeroutput["exitstatus"] = exitstatus + # in pytest 5.0+, exitstatus is an IntEnum object + self.config.workeroutput["exitstatus"] = int(exitstatus) yield self.sendevent("workerfinished", workeroutput=self.config.workeroutput)