#NEWLINE# def test_assert_deallocated( ) : #NEWLINE# #INDENT# class C ( object ) : #NEWLINE# #INDENT# def __init__( self , arg0 , arg1 , name = 'myname' ) : #NEWLINE# #INDENT# self . name = name #NEWLINE# #UNINDENT# #UNINDENT# for gc_current in ( True , False ) : #NEWLINE# #INDENT# with gc_state ( gc_current ) : #NEWLINE# #INDENT# with assert_deallocated ( C , 0 , 2 , 'another name' ) as c : #NEWLINE# #INDENT# assert_equal ( c . name , 'another name' ) #NEWLINE# del c #NEWLINE# #UNINDENT# with assert_deallocated ( C , 0 , 2 , name = 'third name' ) : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# assert_equal ( gc . isenabled ( ) , gc_current )