#NEWLINE# @ mock . patch ( 'sys.exit' ) #NEWLINE# def test_bad_format_string( self , fake_exit ) : #NEWLINE# #INDENT# 'A bad format string exits the runner.' #NEWLINE# previous_format = TAPTestResult . FORMAT #NEWLINE# bad_format = 'Not gonna work {sort_desc}' #NEWLINE# TAPTestRunner . set_format ( test ) #NEWLINE# result = TAPTestResult ( None , True , 1 ) #NEWLINE# test = mock . Mock ( ) #NEWLINE# result . _description ( test ) #NEWLINE# self . assertTrue ( fake_exit . called ) #NEWLINE# TAPTestResult . FORMAT = previous_format