Skip to content

Commit 97793b6

Browse files
committed
add missing async and fix var typo
1 parent 79f7516 commit 97793b6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

test/asynchronous/test_retryable_writes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ async def test_supported_single_statement_supported_cluster(self):
249249
)
250250

251251
# There should be no retry when the failpoint is not active.
252-
if async_client_context._is_mongos or not async_client_context.test_commands_enabled:
252+
if async_client_context.is_mongos or not async_client_context.test_commands_enabled:
253253
self.assertEqual(len(commands_started), 1)
254254
continue
255255

@@ -404,7 +404,7 @@ async def test_batch_splitting_retry_fails(self):
404404
)
405405
)
406406
self.listener.reset()
407-
with self.client.start_session() as session:
407+
async with self.client.start_session() as session:
408408
initial_txn = session._transaction_id
409409
try:
410410
await coll.bulk_write(
@@ -521,7 +521,7 @@ async def test_RetryableWriteError_error_label(self):
521521
async def test_RetryableWriteError_error_label_RawBSONDocument(self):
522522
# using RawBSONDocument should not cause errorLabel parsing to fail
523523
async with self.fail_point(self.fail_insert):
524-
with self.client.start_session() as s:
524+
async with self.client.start_session() as s:
525525
s._start_retryable_write()
526526
result = await self.client.pymongo_test.command(
527527
"insert",
@@ -679,7 +679,7 @@ def raise_connection_err_select_server(*args, **kwargs):
679679
for method, args, kwargs in retryable_single_statement_ops(client.db.retryable_write_test):
680680
listener.reset()
681681
topology.select_server = raise_connection_err_select_server
682-
with client.start_session() as session:
682+
async with client.start_session() as session:
683683
kwargs = copy.deepcopy(kwargs)
684684
kwargs["session"] = session
685685
msg = f"{method.__name__}(*{args!r}, **{kwargs!r})"

test/test_retryable_writes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def test_supported_single_statement_supported_cluster(self):
249249
)
250250

251251
# There should be no retry when the failpoint is not active.
252-
if client_context._is_mongos or not client_context.test_commands_enabled:
252+
if client_context.is_mongos or not client_context.test_commands_enabled:
253253
self.assertEqual(len(commands_started), 1)
254254
continue
255255

0 commit comments

Comments
 (0)