PYTHON-4533 - Fix failing async tests (#1739)
This commit is contained in:
parent
0d89e1276c
commit
105393109e
@ -129,7 +129,7 @@ class TestCursor(AsyncIntegrationTest):
|
||||
# Exhaust - which mongos doesn't support
|
||||
if async_client_context.is_mongos:
|
||||
with self.assertRaises(InvalidOperation):
|
||||
self.db.test.find(cursor_type=CursorType.EXHAUST)
|
||||
await anext(self.db.test.find(cursor_type=CursorType.EXHAUST))
|
||||
else:
|
||||
cursor = self.db.test.find(cursor_type=CursorType.EXHAUST)
|
||||
self.assertEqual(64, cursor._query_flags)
|
||||
|
||||
@ -192,7 +192,7 @@ class TestTransactions(AsyncTransactionsBase):
|
||||
addresses = set()
|
||||
for _ in range(UNPIN_TEST_MAX_ATTEMPTS):
|
||||
async with await s.start_transaction():
|
||||
cursor = await coll.find({}, session=s)
|
||||
cursor = coll.find({}, session=s)
|
||||
self.assertTrue(await anext(cursor))
|
||||
addresses.add(cursor.address)
|
||||
# Break early if we can.
|
||||
@ -219,7 +219,7 @@ class TestTransactions(AsyncTransactionsBase):
|
||||
|
||||
addresses = set()
|
||||
for _ in range(UNPIN_TEST_MAX_ATTEMPTS):
|
||||
cursor = await coll.find({}, session=s)
|
||||
cursor = coll.find({}, session=s)
|
||||
self.assertTrue(await anext(cursor))
|
||||
addresses.add(cursor.address)
|
||||
# Break early if we can.
|
||||
|
||||
@ -129,7 +129,7 @@ class TestCursor(IntegrationTest):
|
||||
# Exhaust - which mongos doesn't support
|
||||
if client_context.is_mongos:
|
||||
with self.assertRaises(InvalidOperation):
|
||||
self.db.test.find(cursor_type=CursorType.EXHAUST)
|
||||
next(self.db.test.find(cursor_type=CursorType.EXHAUST))
|
||||
else:
|
||||
cursor = self.db.test.find(cursor_type=CursorType.EXHAUST)
|
||||
self.assertEqual(64, cursor._query_flags)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user