#NEWLINE# @ contextmanager #NEWLINE# def suite( self , headline , * args , **kwargs ) : #NEWLINE# #INDENT# headline = str ( headline ) #NEWLINE# terminator = kwargs . pop ( 'terminator' , None ) #NEWLINE# if kwargs : #NEWLINE# #INDENT# raise TypeError ( ( 'Invalid keyword argument %r' % ( kwargs . keys ( ) , ) ) ) #NEWLINE# #UNINDENT# if ( headline [ ( - 1 ) ] not in '{:' ) : #NEWLINE# #INDENT# headline += ' {' #NEWLINE# #UNINDENT# self . _append ( ( headline . format ( * args ) if args else headline ) ) #NEWLINE# prev = self . _curr #NEWLINE# self . _curr = [ ] #NEWLINE# prev . append ( self . _curr ) #NEWLINE# ( yield ) #NEWLINE# self . _curr = prev #NEWLINE# if ( prev is None ) : #NEWLINE# #INDENT# self . _append ( '}' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if terminator : #NEWLINE# #INDENT# self . _append ( terminator )