#NEWLINE# @ pytest . fixture ( autouse = True ) #NEWLINE# def setup( self , request , as_connection ) : #NEWLINE# #INDENT# keys = [ ] #NEWLINE# for i in range ( 5 ) : #NEWLINE# #INDENT# key = ( 'test' , 'demo' , i ) #NEWLINE# rec = { #NEWLINE# #INDENT# 'name' : ( 'name%s' % str ( i ) ) , #NEWLINE# 'contact_no' : [ i , ( i + 1 ) ] , #NEWLINE# 'city' : [ 'Pune' , 'Dehli' ] , #NEWLINE# #UNINDENT# } #NEWLINE# as_connection . put ( key , rec ) #NEWLINE# keys . append ( key ) #NEWLINE# #UNINDENT# def teardown( ) : #NEWLINE# #INDENT# '\n            Teardown method.\n            ' #NEWLINE# for key in keys : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# as_connection . remove ( key ) #NEWLINE# #UNINDENT# except e . RecordNotFound : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# request . addfinalizer ( teardown )