#NEWLINE# def test_expected_failure( self ) : #NEWLINE# #INDENT# class Foo ( unittest . TestCase ) : #NEWLINE# #INDENT# @ unittest . expectedFailure #NEWLINE# def test_die( self ) : #NEWLINE# #INDENT# self . fail ( 'help me!' ) #NEWLINE# #UNINDENT# #UNINDENT# events = [ ] #NEWLINE# result = LoggingResult ( test ) #NEWLINE# test = Foo ( 'test_die' ) #NEWLINE# test . run ( result ) #NEWLINE# self . assertEqual ( events , [ 'startTest' , 'addExpectedFailure' , 'stopTest' ] ) #NEWLINE# self . assertEqual ( result . expectedFailures [ 0 ] [ 0 ] , test ) #NEWLINE# self . assertTrue ( result . wasSuccessful ( ) )