#NEWLINE# def test___closure__( self ) : #NEWLINE# #INDENT# a = 12 #NEWLINE# def f( ) : #NEWLINE# #INDENT# print ( a ) #NEWLINE# #UNINDENT# c = f . __closure__ #NEWLINE# self . assertIsInstance ( c , tuple ) #NEWLINE# self . assertEqual ( len ( c ) , 1 ) #NEWLINE# self . assertEqual ( c [ 0 ] . __class__ . __name__ , 'cell' ) #NEWLINE# self . cannot_set_attr ( f , '__closure__' , c , AttributeError )