#NEWLINE# def test_add_remove_listener( self , scheduler ) : #NEWLINE# #INDENT# "Test that event dispatch works but removed listeners aren't called." #NEWLINE# events = [ ] #NEWLINE# scheduler . add_listener ( events . append , EVENT_EXECUTOR_ADDED ) #NEWLINE# scheduler . add_executor ( DummyExecutor ( ) , 'exec1' ) #NEWLINE# scheduler . remove_listener ( events . append ) #NEWLINE# scheduler . add_executor ( DummyExecutor ( ) , 'exec2' ) #NEWLINE# assert ( len ( events ) == 1 )