#NEWLINE# def test_retries_with_success( self ) : #NEWLINE# #INDENT# retry_task ( 'blampf' , False ) #NEWLINE# self . assertFalse ( ( 'blampf' in state ) ) #NEWLINE# task = test_huey . dequeue ( ) #NEWLINE# with CaptureLogs ( ) as capture : #NEWLINE# #INDENT# self . worker ( task ) #NEWLINE# #UNINDENT# self . assertLogs ( capture , [ 'Executing' , 'Unhandled' , 'Re-enqueueing' ] ) #NEWLINE# task = test_huey . dequeue ( ) #NEWLINE# self . assertEqual ( task . retries , 2 ) #NEWLINE# self . worker ( task ) #NEWLINE# self . assertEqual ( state [ 'blampf' ] , 'fixed' ) #NEWLINE# self . assertEqual ( len ( test_huey ) , 0 ) #NEWLINE# self . assertTaskEvents ( ( 'started' , task ) , ( 'error-task' , task ) , ( 'retrying' , task ) , ( 'started' , task ) , ( 'finished' , task ) )