#NEWLINE# def test_jobs_not_canceled_multiple_times( self ) : #NEWLINE# #INDENT# failures = list ( ) #NEWLINE# def collect_failure( jobname ) : #NEWLINE# #INDENT# def fn( ) : #NEWLINE# #INDENT# failures . append ( jobname ) #NEWLINE# #UNINDENT# return fn #NEWLINE# #UNINDENT# def my_job( name , result_fn , deps ) : #NEWLINE# #INDENT# return self . job ( name , result_fn , deps , 1 , on_failure = collect_failure ( name ) ) #NEWLINE# #UNINDENT# exec_graph = ExecutionGraph ( [ my_job ( 'A' , raising_fn , [ ] ) , my_job ( 'B1' , passing_fn , [ 'A' ] ) , my_job ( 'B2' , passing_fn , [ 'A' ] ) , my_job ( 'C1' , passing_fn , [ 'B1' , 'B2' ] ) , my_job ( 'C2' , passing_fn , [ 'B1' , 'B2' ] ) , my_job ( 'E' , passing_fn , [ 'C2' ] ) ] ) #NEWLINE# with self . assertRaises ( ExecutionFailure ) : #NEWLINE# #INDENT# self . execute ( exec_graph ) #NEWLINE# #UNINDENT# self . assertEqual ( self . jobs_run , [ 'A' ] ) #NEWLINE# self . assertEqual ( failures , [ 'A' , 'B1' , 'B2' , 'C1' , 'C2' , 'E' ] )