Skip to content

Commit e873e27

Browse files
committed
Fix a test for MongoDB 3.3 behavior change
1 parent 63c8fd3 commit e873e27

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/test_cursor.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -765,8 +765,12 @@ def test_count_with_hint(self):
765765
self.assertEqual(
766766
1, collection.find({'i': 1}).hint([("x", 1)]).count())
767767

768-
self.assertEqual(2, collection.find().hint("x_1").count())
769-
self.assertEqual(2, collection.find().hint([("x", 1)]).count())
768+
if client_context.version.at_least(3, 3, 2):
769+
self.assertEqual(0, collection.find().hint("x_1").count())
770+
self.assertEqual(0, collection.find().hint([("x", 1)]).count())
771+
else:
772+
self.assertEqual(2, collection.find().hint("x_1").count())
773+
self.assertEqual(2, collection.find().hint([("x", 1)]).count())
770774

771775
def test_where(self):
772776
db = self.db

0 commit comments

Comments
 (0)