#NEWLINE# def test_temp_connection_for_sender( ) : #NEWLINE# #INDENT# sig = Signal ( ) #NEWLINE# canary = [ ] #NEWLINE# receiver = ( lambda sender : canary . append ( sender ) ) #NEWLINE# with sig . connected_to ( canary , sender = 2 ) : #NEWLINE# #INDENT# sig . send ( 1 ) #NEWLINE# sig . send ( 2 ) #NEWLINE# #UNINDENT# assert ( canary == [ 2 ] ) #NEWLINE# assert ( not sig . receivers )