#NEWLINE# def test_with( self ) : #NEWLINE# #INDENT# lock = self . locktype ( ) #NEWLINE# def f( ) : #NEWLINE# #INDENT# lock . acquire ( ) #NEWLINE# lock . release ( ) #NEWLINE# #UNINDENT# def _with( err = None ) : #NEWLINE# #INDENT# with lock : #NEWLINE# #INDENT# if ( err is not None ) : #NEWLINE# #INDENT# raise err #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# _with ( ) #NEWLINE# Bunch ( f , 1 ) . wait_for_finished ( ) #NEWLINE# self . assertRaises ( TypeError , _with , TypeError ) #NEWLINE# Bunch ( f , 1 ) . wait_for_finished ( )