#NEWLINE# def tearDown( self ) : #NEWLINE# #INDENT# super ( ChaiBase , self ) . tearDown ( ) #NEWLINE# for cls in inspect . getmro ( self . __class__ ) : #NEWLINE# #INDENT# if cls . __module__ . startswith ( 'chai' ) : #NEWLINE# #INDENT# break #NEWLINE# #UNINDENT# mod = sys . modules [ cls . __module__ ] #NEWLINE# if ( getattr ( mod , 'stub' , None ) == self . stub ) : #NEWLINE# #INDENT# delattr ( mod , 'stub' ) #NEWLINE# #UNINDENT# if ( getattr ( mod , 'expect' , None ) == self . expect ) : #NEWLINE# #INDENT# delattr ( mod , 'expect' ) #NEWLINE# #UNINDENT# if ( getattr ( mod , 'spy' , None ) == self . spy ) : #NEWLINE# #INDENT# delattr ( mod , 'spy' ) #NEWLINE# #UNINDENT# if ( getattr ( mod , 'mock' , None ) == self . mock ) : #NEWLINE# #INDENT# delattr ( mod , 'mock' ) #NEWLINE# #UNINDENT# #UNINDENT# while len ( self . _stubs ) : #NEWLINE# #INDENT# stub = self . _stubs . popleft ( ) #NEWLINE# stub . teardown ( ) #NEWLINE# #UNINDENT# while len ( self . _mocks ) : #NEWLINE# #INDENT# mock = self . _mocks . pop ( ) #NEWLINE# if ( len ( mock ) == 2 ) : #NEWLINE# #INDENT# delattr ( mock [ 0 ] , mock [ 1 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# setattr ( mock [ 0 ] , mock [ 1 ] , mock [ 2 ] ) #NEWLINE# #UNINDENT# #UNINDENT# Variable . clear ( )