Compatibility for IntEnum change in upcoming pytest 5.0

Related to pytest-dev/pytest#5420
This commit is contained in:
Bruno Oliveira
2019-06-14 11:18:14 -03:00
parent 407d6e16e2
commit fb40056950
2 changed files with 3 additions and 1 deletions

View File

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

View File

@@ -41,7 +41,8 @@ class WorkerInteractor(object):
@pytest.hookimpl(hookwrapper=True) @pytest.hookimpl(hookwrapper=True)
def pytest_sessionfinish(self, exitstatus): 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 yield
self.sendevent("workerfinished", workeroutput=self.config.workeroutput) self.sendevent("workerfinished", workeroutput=self.config.workeroutput)