#NEWLINE# def testExceptionInEnter( self ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# with self . Dummy ( ) as a , self . EnterRaises ( ) : #NEWLINE# #INDENT# self . fail ( 'body of bad with executed' ) #NEWLINE# #UNINDENT# #UNINDENT# except RuntimeError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . fail ( 'RuntimeError not reraised' ) #NEWLINE# #UNINDENT# self . assertTrue ( a . enter_called ) #NEWLINE# self . assertTrue ( self . exit_called )