def METHOD_NAME(self):
    class X(Exception):
        def __str__(self):
            1/0
    err = traceback.format_exception_only(X, X())
    self.assertEqual(len(err), 1)
    str_value = '<unprintable %s object>' % X.__name__
    self.assertEqual(err[0], X.__name__ + ': ' + str_value + '\n')