Commit 7baead1c authored by Tim Peters's avatar Tim Peters

FancyTestResult.addError(): The showAll branch of this didn't allow

for that the passed-in err[0] may be a string, and when it was died
with an AttributeError in excname().  The verbose_on_error branch does
cater to err[0] being a string, so copied that logic into the showAll
branch.
parent 3627680b
......@@ -237,7 +237,10 @@ class FancyTestResult(unittest._TextTestResult):
def addError(self, test, err):
unittest.TestResult.addError(self, test, err)
if self.showAll:
self.stream.writeln(excname(err[0]))
if isinstance(err[0], str):
self.stream.writeln(err[0])
else:
self.stream.writeln(excname(err[0]))
elif self.verbose_on_error:
if not self.have_blank_line:
self.stream.writeln()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment