Merge pull request #389 from nicoddemus/excinfo-fix-384
Fix ExceptionInfo usage for pytest 4.1
This commit is contained in:
1
changelog/384.bugfix.rst
Normal file
1
changelog/384.bugfix.rst
Normal file
@@ -0,0 +1 @@
|
||||
Add support for pytest 4.1.
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user