#NEWLINE# def test_setUp_returns_deferred_that_fires_later( self ) : #NEWLINE# #INDENT# call_log = [ ] #NEWLINE# marker = object ( ) #NEWLINE# d = defer . Deferred ( ) . addCallback ( test . append ) #NEWLINE# class SomeCase ( TestCase ) : #NEWLINE# #INDENT# def setUp( self ) : #NEWLINE# #INDENT# super ( SomeCase , self ) . setUp ( ) #NEWLINE# call_log . append ( 'setUp' ) #NEWLINE# return d #NEWLINE# #UNINDENT# def test_something( self ) : #NEWLINE# #INDENT# call_log . append ( 'test' ) #NEWLINE# #UNINDENT# #UNINDENT# def fire_deferred( ) : #NEWLINE# #INDENT# self . assertThat ( call_log , Equals ( [ 'setUp' ] ) ) #NEWLINE# d . callback ( marker ) #NEWLINE# #UNINDENT# test = SomeCase ( 'test_something' ) #NEWLINE# timeout = self . make_timeout ( ) #NEWLINE# runner = self . make_runner ( test , timeout = timeout ) #NEWLINE# result = self . make_result ( ) #NEWLINE# reactor = self . make_reactor ( ) #NEWLINE# reactor . callLater ( timeout , fire_deferred ) #NEWLINE# runner . run ( result ) #NEWLINE# self . assertThat ( call_log , Equals ( [ 'setUp' , marker , 'test' ] ) )