nose-devs/nose — pull request #591 by jszakmeister (2012-12-21 10:55:32+00:00)
Title: Fix #134: Stop xunit from completely dying if it encounters an error

Since Python 3 has completely dropped supporting strings as exceptions,
the traceback.format_exception() function now dies when passed a string
as an exception value when the function attempts to access the
__context__ attribute.

The issue is that we can get a string for the exception value because of
the formatError() api. The capture and logcapture plugins turn the
exception object into a string, add some data, and return the string.
Since that feels like part of the api that we offer, we'll teach xunit
to cope with strings as exception objects, even in Python 3, by having
our own custom format_exception. This allows us to keep the nice
traceback, while still coping with exception value being a string.