Skip to content

Commit 7ebf3ec

Browse files
authored
Compatibility for IntEnum change in upcoming pytest 5.0 (#442)
Compatibility for IntEnum change in upcoming pytest 5.0
2 parents 407d6e1 + fb40056 commit 7ebf3ec

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

changelog/442.feature.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Compatibility fix for upcoming pytest 5.0: ``session.exitstatus`` is now an ``IntEnum`` object.

src/xdist/remote.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def pytest_sessionstart(self, session):
4141

4242
@pytest.hookimpl(hookwrapper=True)
4343
def pytest_sessionfinish(self, exitstatus):
44-
self.config.workeroutput["exitstatus"] = exitstatus
44+
# in pytest 5.0+, exitstatus is an IntEnum object
45+
self.config.workeroutput["exitstatus"] = int(exitstatus)
4546
yield
4647
self.sendevent("workerfinished", workeroutput=self.config.workeroutput)
4748

0 commit comments

Comments
 (0)