qin / pymox

Automatically exported from code.google.com/p/pymox
Apache License 2.0
0 stars 0 forks source link

SwallowedExceptionError's _str__ method prints out one character per line when used with nose #48

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Similar to Issue 34

This fixed the problems for me:

    def __str__(self):
        if isinstance(self._previous_exceptions, basestring):
            exceptions = self._previous_exceptions
        else:
            exceptions = "\n".join(["%3d.  %s: %s" % (i, e.__class__.__name__, e)
                                    for i, e in enumerate(self._previous_exceptions)])
        return "Previous exceptions thrown:\n%s" % (exceptions,)

Original issue reported on code.google.com by kunalpar...@gmail.com on 28 Jul 2012 at 2:26