PYTHON-4533 - Fix failing async tests (#1739)

This commit is contained in:
Noah Stapp 2024-07-17 12:57:55 -07:00 committed by GitHub
parent 0d89e1276c
commit 105393109e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 4 additions and 4 deletions

View File

@ -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)

View File

@ -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.

View File

@ -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)