Lines Matching refs:exception
115 self.raise_catch(Exception, "Exception")
117 except Exception, e: pass
120 # make sure the right exception message is raised for each of
152 # test that setting an exception at the C level works even if the
153 # exception object can't be constructed.
169 self.fail("Expected exception")
183 self.fail("Expected exception")
204 # test that exception attributes are happy
293 'exception "%s", attribute "%s"' %
333 e = Exception("foo")
334 f = Exception("foo")
344 # Test that you can slice an exception directly instead of requiring
352 # test that builtin exception don't take keyword args,
391 self.assertTrue(str(Exception))
392 self.assertTrue(unicode(Exception))
393 self.assertTrue(str(Exception('a')))
394 self.assertTrue(unicode(Exception(u'a')))
395 self.assertTrue(unicode(Exception(u'\xe1')))
435 # Bug #2542: if issubclass(e, MyException) raises an exception,
441 class MyException(Exception):
449 self.fail("exception should not be a MyException")
469 class MyException(Exception):
496 class ExcWithOverriddenStr(Exception):
497 """Subclass of Exception that accepts a keyword 'msg' arg that is
528 for exception in exceptions:
529 self.assertEqual(str(exception), unicode(exception))
532 """Check same msg for Exception with 0 args"""
533 # str() and unicode() on an Exception with no args should return an
535 self.check_same_msg(Exception(), '')
539 # str() and unicode() on an exception with overridden __str__ that
553 self.check_same_msg(Exception(arg), arg)
558 e = Exception(u'f\xf6\xf6')
584 self.check_same_msg(Exception(*args), repr(args))
613 self.assertTrue(issubclass(error1, Exception))