Remove compat for pytest < 6

This commit is contained in:
Zac-HD
2020-08-06 15:44:56 +10:00
parent ba8398478e
commit d153e0a4c4
3 changed files with 12 additions and 35 deletions

View File

@@ -379,11 +379,7 @@ class WorkerController:
except: # noqa
from _pytest._code import ExceptionInfo
# ExceptionInfo API changed in pytest 4.1
if hasattr(ExceptionInfo, "from_current"):
excinfo = ExceptionInfo.from_current()
else:
excinfo = ExceptionInfo()
excinfo = ExceptionInfo.from_current()
print("!" * 20, excinfo)
self.config.notify_exception(excinfo)
self.shutdown()