#NEWLINE# @ patch ( 'prestoadmin.util.application.logger' ) #NEWLINE# def test_handles_system_abnormal_exits( self , logger_mock , logging_mock , filesystem_mock ) : #NEWLINE# #INDENT# def should_exit( ) : #NEWLINE# #INDENT# with Application ( APPLICATION_NAME ) : #NEWLINE# #INDENT# sys . exit ( 2 ) #NEWLINE# #UNINDENT# #UNINDENT# self . assertRaises ( SystemExit , filesystem_mock ) #NEWLINE# logger_mock . debug . assert_has_calls ( [ call ( 'Application exiting with status %d' , 2 ) ] )