fix #4386 - restructure construction and partial state of ExceptionInfo

This commit is contained in:
Ronny Pfannschmidt
2018-11-22 12:20:14 +01:00
parent 6e85febf20
commit 88bf01a31e
12 changed files with 113 additions and 59 deletions

View File

@@ -450,7 +450,7 @@ class Module(nodes.File, PyCollector):
mod = self.fspath.pyimport(ensuresyspath=importmode)
except SyntaxError:
raise self.CollectError(
_pytest._code.ExceptionInfo().getrepr(style="short")
_pytest._code.ExceptionInfo.from_current().getrepr(style="short")
)
except self.fspath.ImportMismatchError:
e = sys.exc_info()[1]
@@ -466,7 +466,7 @@ class Module(nodes.File, PyCollector):
except ImportError:
from _pytest._code.code import ExceptionInfo
exc_info = ExceptionInfo()
exc_info = ExceptionInfo.from_current()
if self.config.getoption("verbose") < 2:
exc_info.traceback = exc_info.traceback.filter(filter_traceback)
exc_repr = (