#NEWLINE# def __exit__( self , type , value , traceback ) : #NEWLINE# #INDENT# self . test_case . assertEqual ( len ( self . warnings ) , self . number , ( '%d warnings thrown, %d expected' % ( len ( self . warnings ) , self . number ) ) ) #NEWLINE# for warning in self . warnings : #NEWLINE# #INDENT# self . test_case . assertTrue ( issubclass ( warning . category , self . klass ) , ( '%s warning thrown, %s expected' % ( warning . category . __name__ , self . klass . __name__ ) ) ) #NEWLINE# #UNINDENT# self . ctx . __exit__ ( type , value , traceback )