#NEWLINE# def test_worker_exception( self ) : #NEWLINE# #INDENT# with CaptureLogs ( ) as capture : #NEWLINE# #INDENT# blow_up ( ) #NEWLINE# task = test_huey . dequeue ( ) #NEWLINE# #UNINDENT# self . assertLogs ( capture , [ ] ) #NEWLINE# with CaptureLogs ( ) as capture : #NEWLINE# #INDENT# self . worker ( task ) #NEWLINE# #UNINDENT# self . assertLogs ( capture , [ 'Executing' , 'Unhandled exception in worker' ] ) #NEWLINE# self . assertTaskEvents ( ( 'started' , task ) , ( 'error-task' , task ) )