def test_getattr_exceptions():
 class AttributeTest(object, ):
  def __getattr__(self, name):
   raise AttributeError('catch me')
 x = AttributeTest()
 try:
  y = x.throws
 except AttributeError as ex:
  AreEqual(ex.args, ('catch me',))
 else:
  Fail('should have thrown')

def test_getattr_exceptions ( ) : class AttributeTest ( object , ) : def __getattr__ ( self , name ) : raise AttributeError ( 'catch me' ) x = AttributeTest ( ) try : y = x . throws except AttributeError as ex : AreEqual ( ex . args , ( 'catch me' , ) ) else : Fail ( 'should have thrown' )
verify the original exception propagates out .