@@ -249,7 +249,7 @@ async def test_supported_single_statement_supported_cluster(self):
249
249
)
250
250
251
251
# 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 :
253
253
self .assertEqual (len (commands_started ), 1 )
254
254
continue
255
255
@@ -404,7 +404,7 @@ async def test_batch_splitting_retry_fails(self):
404
404
)
405
405
)
406
406
self .listener .reset ()
407
- with self .client .start_session () as session :
407
+ async with self .client .start_session () as session :
408
408
initial_txn = session ._transaction_id
409
409
try :
410
410
await coll .bulk_write (
@@ -521,7 +521,7 @@ async def test_RetryableWriteError_error_label(self):
521
521
async def test_RetryableWriteError_error_label_RawBSONDocument (self ):
522
522
# using RawBSONDocument should not cause errorLabel parsing to fail
523
523
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 :
525
525
s ._start_retryable_write ()
526
526
result = await self .client .pymongo_test .command (
527
527
"insert" ,
@@ -679,7 +679,7 @@ def raise_connection_err_select_server(*args, **kwargs):
679
679
for method , args , kwargs in retryable_single_statement_ops (client .db .retryable_write_test ):
680
680
listener .reset ()
681
681
topology .select_server = raise_connection_err_select_server
682
- with client .start_session () as session :
682
+ async with client .start_session () as session :
683
683
kwargs = copy .deepcopy (kwargs )
684
684
kwargs ["session" ] = session
685
685
msg = f"{ method .__name__ } (*{ args !r} , **{ kwargs !r} )"
0 commit comments