@@ -519,11 +519,13 @@ def test_group(self):
519519 db = self .db
520520 db .drop_collection ("test" )
521521
522- def group_checker (args , expected ):
522+ def group_checker (args , expected , with_command = True ):
523523 eval = db .test .group (* args )
524- cmd = db .test .group (* args , ** {"command" : True })
525524 self .assertEqual (eval , expected )
526- self .assertEqual (cmd , expected )
525+
526+ if with_command :
527+ cmd = db .test .group (* args , ** {"command" : True })
528+ self .assertEqual (cmd , expected )
527529
528530
529531 args = [[], {},
@@ -568,7 +570,7 @@ def group_checker(args, expected):
568570 expected = [{"a" : 2 , "count" : 3 },
569571 {"a" : None , "count" : 2 },
570572 {"a" : 1 , "count" : 2 }]
571- group_checker (args , expected )
573+ group_checker (args , expected , with_command = version . at_least ( db . connection (), ( 1 , 1 )) )
572574
573575 # returning finalize
574576 args = [["a" ], {},
@@ -578,7 +580,7 @@ def group_checker(args, expected):
578580 expected = [2 , # a:2
579581 1 , # a:None
580582 1 ] # a:1
581- group_checker (args , expected )
583+ group_checker (args , expected , with_command = version . at_least ( db . connection (), ( 1 , 1 )) )
582584
583585 self .assertRaises (OperationFailure , db .test .group , [], {}, {}, "5 ++ 5" )
584586 self .assertRaises (OperationFailure , db .test .group , [], {}, {}, "5 ++ 5" , command = True )
0 commit comments