2121import sys
2222sys .path [0 :0 ] = ["" ]
2323
24- from nose .plugins .skip import SkipTest
24+ # from nose.plugins.skip import SkipTest
2525
26- from . import qcheck
27- from . test_connection import get_connection
28- from . import version
26+ import qcheck
27+ from test_connection import get_connection
28+ import version
2929from pymongo .objectid import ObjectId
3030from pymongo .code import Code
3131from pymongo .binary import Binary
@@ -243,31 +243,31 @@ def test_field_selection(self):
243243
244244 doc = {"a" : 1 , "b" : 5 , "c" : {"d" : 5 , "e" : 10 }}
245245 db .test .insert (doc )
246-
247- self .assertEqual (list (db .test .find ({}, ["_id" ]). next ( ).keys ()), ["_id" ])
248- l = list (db .test .find ({}, ["a" ]). next (). keys ( ))
246+
247+ self .assertEqual (list (next ( db .test .find ({}, ["_id" ])).keys ()), ["_id" ])
248+ l = list (next ( db .test .find ({}, ["a" ])))
249249 l .sort ()
250250 self .assertEqual (l , ["_id" , "a" ])
251- l = list (db .test .find ({}, ["b" ]). next (). keys ( ))
251+ l = list (next ( db .test .find ({}, ["b" ])))
252252 l .sort ()
253253 self .assertEqual (l , ["_id" , "b" ])
254- l = list (db .test .find ({}, ["c" ]). next (). keys ( ))
254+ l = list (next ( db .test .find ({}, ["c" ])))
255255 l .sort ()
256256 self .assertEqual (l , ["_id" , "c" ])
257- self .assertEqual (db .test .find ({}, ["a" ]). next ( )["a" ], 1 )
258- self .assertEqual (db .test .find ({}, ["b" ]). next ( )["b" ], 5 )
259- self .assertEqual (db .test .find ({}, ["c" ]). next ( )["c" ],
257+ self .assertEqual (next ( db .test .find ({}, ["a" ]))["a" ], 1 )
258+ self .assertEqual (next ( db .test .find ({}, ["b" ]))["b" ], 5 )
259+ self .assertEqual (next ( db .test .find ({}, ["c" ]))["c" ],
260260 {"d" : 5 , "e" : 10 })
261261
262- self .assertEqual (db .test .find ({}, ["c.d" ]). next ( )["c" ], {"d" : 5 })
263- self .assertEqual (db .test .find ({}, ["c.e" ]). next ( )["c" ], {"e" : 10 })
264- self .assertEqual (db .test .find ({}, ["b" , "c.e" ]). next ( )["c" ],
262+ self .assertEqual (next ( db .test .find ({}, ["c.d" ]))["c" ], {"d" : 5 })
263+ self .assertEqual (next ( db .test .find ({}, ["c.e" ]))["c" ], {"e" : 10 })
264+ self .assertEqual (next ( db .test .find ({}, ["b" , "c.e" ]))["c" ],
265265 {"e" : 10 })
266266
267- l = list (db .test .find ({}, ["b" , "c.e" ]). next (). keys ( ))
267+ l = list (next ( db .test .find ({}, ["b" , "c.e" ])))
268268 l .sort ()
269269 self .assertEqual (l , ["_id" , "b" , "c" ])
270- self .assertEqual (db .test .find ({}, ["b" , "c.e" ]). next ( )["b" ], 5 )
270+ self .assertEqual (next ( db .test .find ({}, ["b" , "c.e" ]))["b" ], 5 )
271271
272272 def test_options (self ):
273273 db = self .db
@@ -297,6 +297,8 @@ def remove_insert_find_one(dict):
297297 db .test .remove ({})
298298 db .test .insert (dict )
299299 return db .test .find_one () == dict
300+
301+ a = qcheck .gen_mongo_dict (3 )
300302
301303 qcheck .check_unittest (self , remove_insert_find_one ,
302304 qcheck .gen_mongo_dict (3 ))
@@ -452,7 +454,7 @@ def test_unique_index(self):
452454 db .test .save ({"hello" : "world" })
453455 db .test .save ({"hello" : "mike" })
454456 db .test .save ({"hello" : "world" })
455- self .failIf (db .error ())
457+ self .assertFalse (db .error ())
456458
457459 db .drop_collection ("test" )
458460 db .test .create_index ("hello" , unique = True )
@@ -469,7 +471,7 @@ def test_index_on_subfield(self):
469471 db .test .insert ({"hello" : {"a" : 4 , "b" : 5 }})
470472 db .test .insert ({"hello" : {"a" : 7 , "b" : 2 }})
471473 db .test .insert ({"hello" : {"a" : 4 , "b" : 10 }})
472- self .failIf (db .error ())
474+ self .assertFalse (db .error ())
473475
474476 db .drop_collection ("test" )
475477 db .test .create_index ("hello.a" , unique = True )
0 commit comments