#NEWLINE# def test_markup_leaks( self ) : #NEWLINE# #INDENT# counts = set ( ) #NEWLINE# for count in range ( 20 ) : #NEWLINE# #INDENT# for item in range ( 1000 ) : #NEWLINE# #INDENT# escape ( 'foo' ) #NEWLINE# escape ( '<foo>' ) #NEWLINE# escape ( 'foo' ) #NEWLINE# escape ( '<foo>' ) #NEWLINE# #UNINDENT# counts . add ( len ( gc . get_objects ( ) ) ) #NEWLINE# #UNINDENT# assert ( len ( counts ) == 1 ) , 'ouch, c extension seems to leak objects'