generalized reprcrash assignment in code.py

This commit is contained in:
acjreno 2023-04-15 17:51:02 -04:00
parent e4964ff580
commit a6bafe8298
2 changed files with 2 additions and 4 deletions

View File

@ -977,9 +977,7 @@ class FormattedExcinfo:
)
else:
reprtraceback = self.repr_traceback(excinfo_)
reprcrash: Optional[ReprFileLocation] = (
excinfo_._getreprcrash() if self.style != "value" else None
)
reprcrash = excinfo_._getreprcrash()
else:
# Fallback to native repr if the exception doesn't have a traceback:
# ExceptionInfo objects require a full traceback to work.

View File

@ -445,7 +445,7 @@ class Node(metaclass=NodeMeta):
if isinstance(excinfo.value, ConftestImportFailure):
excinfo = ExceptionInfo.from_exc_info(excinfo.value.excinfo)
if isinstance(excinfo.value, fail.Exception):
if not excinfo.value.pytrace and style != "line":
if not excinfo.value.pytrace:
style = "value"
if isinstance(excinfo.value, FixtureLookupError):
return excinfo.value.formatrepr()