#NEWLINE# @ patch . object ( executor . MapTaskExecutor , 'execute' ) #NEWLINE# @ patch . object ( batchworker . ProgressReporter , 'start_reporting_progress' ) #NEWLINE# @ patch . object ( batchworker . ProgressReporter , 'stop_reporting_progress' ) #NEWLINE# @ patch . object ( batchworker . ProgressReporter , 'report_status' ) #NEWLINE# def test_worker_fails_for_deferred_exceptions( self , mock_report_status , mock_stop , mock_start , mock_execute ) : #NEWLINE# #INDENT# worker = batchworker . BatchWorker ( self . dummy_properties ( ) , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# mock_work_item = mock . MagicMock ( ) #NEWLINE# worker . do_work ( mock_work_item , deferred_exception_details = 'deferred_exc' ) #NEWLINE# mock_report_status . assert_called_with ( completed = True , exception_details = 'deferred_exc' ) #NEWLINE# assert ( not mock_stop . called ) #NEWLINE# assert ( not mock_start . called ) #NEWLINE# assert ( not mock_execute . called )