#NEWLINE# def test_retry_wrapper_exception_checker( self ) : #NEWLINE# #INDENT# def exception_checker( exc ) : #NEWLINE# #INDENT# return ( isinstance ( exc , ValueError ) and ( exc . args [ 0 ] < 5 ) ) #NEWLINE# #UNINDENT# @ utils . wrap_func_retry ( max_retries = 10 , exception_checker = exception_checker ) #NEWLINE# def some_method( res ) : #NEWLINE# #INDENT# res [ 'result' ] += 1 #NEWLINE# raise ValueError ( res [ 'result' ] ) #NEWLINE# #UNINDENT# res = { #NEWLINE# #INDENT# 'result' : 0 , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertRaises ( ValueError , some_method , res ) #NEWLINE# self . assertEqual ( 5 , res [ 'result' ] )