#NEWLINE# def compare_events( self , line_offset , events , expected_events ) : #NEWLINE# #INDENT# events = [ ( ( l - line_offset ) , e ) for ( l , e ) in events ] #NEWLINE# if ( events != expected_events ) : #NEWLINE# #INDENT# self . fail ( ( 'events did not match expectation:\n' + '\n' . join ( difflib . ndiff ( [ str ( line_offset ) for x in expected_events ] , [ str ( x ) for x in events ] ) ) ) )