#NEWLINE# def _diff_values( self , name , result1 , result2 ) : #NEWLINE# #INDENT# fields = [ 'status' , 'time' , 'traceback' , 'reason' ] #NEWLINE# diffs = [ ] #NEWLINE# for field in fields : #NEWLINE# #INDENT# val1 = result1 . get ( field , 0 ) #NEWLINE# val2 = result2 . get ( field , 0 ) #NEWLINE# if ( val1 != val2 ) : #NEWLINE# #INDENT# if ( field == 'time' ) : #NEWLINE# #INDENT# max_ = max ( float ( val1 ) , float ( val2 ) ) #NEWLINE# min_ = min ( float ( val1 ) , float ( val2 ) ) #NEWLINE# time_threshold = ( ( ( max_ - min_ ) / ( min_ or 1 ) ) * 100 ) #NEWLINE# if ( time_threshold < self . threshold ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# #UNINDENT# diffs . append ( { #NEWLINE# #INDENT# 'field' : field , #NEWLINE# 'type' : 'value_changed' , #NEWLINE# 'test_name' : name , #NEWLINE# 'val1' : val1 , #NEWLINE# 'val2' : val2 , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# #UNINDENT# return diffs