#NEWLINE# def test_identity_map_mutate( self ) : #NEWLINE# #INDENT# ( users , User ) = ( self . tables . users , self . classes . User ) #NEWLINE# mapper ( User , users ) #NEWLINE# sess = Session ( ) #NEWLINE# sess . add_all ( [ User ( name = 'u1' ) , User ( name = 'u2' ) , User ( name = 'u3' ) ] ) #NEWLINE# sess . commit ( ) #NEWLINE# ( u1 , u2 , u3 ) = sess . query ( User ) . all ( ) #NEWLINE# for ( i , ( key , value ) ) in enumerate ( iter ( sess . identity_map . items ( ) ) ) : #NEWLINE# #INDENT# if ( i == 2 ) : #NEWLINE# #INDENT# del u3 #NEWLINE# gc_collect ( )