@@ -523,7 +523,8 @@ def test_command(self):
523523 ('geoSearch' , 'test' ), ('near' , [33 , 33 ]), ('maxDistance' , 6 ),
524524 ('search' , {'type' : 'restaurant' }), ('limit' , 30 )])))
525525
526- if version .at_least (self .c , (2 , 1 , 0 )):
526+ if (version .at_least (self .c , (2 , 1 , 0 )) and
527+ not version .at_least (self .c , (3 , 5 , 1 ))):
527528 self ._test_fn (
528529 True , lambda : self .c .pymongo_test .command (SON ([
529530 ('aggregate' , 'test' ),
@@ -568,8 +569,8 @@ def test_map_reduce_command(self):
568569 ])))
569570
570571 def test_aggregate_command_with_out (self ):
571- if not version .at_least (self .c , (2 , 5 , 2 )):
572- raise SkipTest ("Aggregation with $out requires MongoDB >= 2.5.2 " )
572+ if not version .at_least (self .c , (2 , 6 , 0 )):
573+ raise SkipTest ("Aggregation with $out requires MongoDB >= 2.6.0 " )
573574
574575 # Tests aggregate command when pipeline contains $out.
575576 self .c .pymongo_test .test .insert ({"x" : 1 , "y" : 1 }, w = self .w )
@@ -584,12 +585,14 @@ def test_aggregate_command_with_out(self):
584585 warnings .simplefilter ("ignore" , UserWarning )
585586 self ._test_fn (False , lambda : self .c .pymongo_test .command (
586587 "aggregate" , "test" ,
587- pipeline = [{"$match" : {"x" : 1 }}, {"$out" : "agg_out" }]
588+ pipeline = [{"$match" : {"x" : 1 }}, {"$out" : "agg_out" }],
589+ cursor = {}
588590 ))
589591
590592 # Test aggregate when sent through the collection aggregate function.
591593 self ._test_fn (False , lambda : self .c .pymongo_test .test .aggregate (
592- [{"$match" : {"x" : 2 }}, {"$out" : "agg_out" }]
594+ [{"$match" : {"x" : 2 }}, {"$out" : "agg_out" }],
595+ cursor = {}
593596 ))
594597 finally :
595598 ctx .exit ()
@@ -662,7 +665,9 @@ def test_distinct(self):
662665
663666 def test_aggregate (self ):
664667 if version .at_least (self .c , (2 , 1 , 0 )):
665- self ._test_fn (True , lambda : self .c .pymongo_test .test .aggregate ([]))
668+ self ._test_fn (
669+ True ,
670+ lambda : self .c .pymongo_test .test .aggregate ([], cursor = {}))
666671
667672
668673class TestMovingAverage (unittest .TestCase ):
0 commit comments