#NEWLINE# def test_kill_cursors_with_tuple( self ) : #NEWLINE# #INDENT# if ( client_context . is_mongos and ( not client_context . version . at_least ( 2 , 4 , 7 ) ) ) : #NEWLINE# #INDENT# raise SkipTest ( "Can't test kill_cursors against old mongos" ) #NEWLINE# #UNINDENT# self . collection = self . client . pymongo_test . test #NEWLINE# self . collection . drop ( ) #NEWLINE# self . collection . insert_many ( [ { #NEWLINE# #INDENT# '_id' : i , #NEWLINE# #UNINDENT# } for i in range ( 200 ) ] ) #NEWLINE# cursor = self . collection . find ( ) . batch_size ( 1 ) #NEWLINE# next ( i ) #NEWLINE# self . client . kill_cursors ( [ cursor . cursor_id ] , self . client . address ) #NEWLINE# time . sleep ( 2 ) #NEWLINE# def raises_cursor_not_found( ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# next ( cursor ) #NEWLINE# return False #NEWLINE# #UNINDENT# except CursorNotFound : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# wait_until ( raises_cursor_not_found , 'close cursor' )