2626from test .asynchronous import AsyncIntegrationTest , async_client_context , remove_all_users , unittest
2727from test .utils import (
2828 async_rs_or_single_client_noauth ,
29+ async_single_client ,
2930 async_wait_until ,
30- single_client ,
3131)
3232
3333from bson .binary import Binary , UuidRepresentation
@@ -817,7 +817,7 @@ async def asyncSetUp(self):
817817 roles = [],
818818 )
819819
820- async_client_context .create_user (self .db .name , "noremove" , "pw" , ["noremove" ])
820+ await async_client_context .create_user (self .db .name , "noremove" , "pw" , ["noremove" ])
821821
822822 async def asyncTearDown (self ):
823823 await self .db .command ("dropRole" , "noremove" )
@@ -919,7 +919,7 @@ async def test_readonly(self):
919919 username = "readonly" , password = "pw" , authSource = "pymongo_test"
920920 )
921921 coll = cli .pymongo_test .test
922- coll .find_one ()
922+ await coll .find_one ()
923923 with self .assertRaises (OperationFailure ):
924924 await coll .bulk_write ([InsertOne ({"x" : 1 })])
925925
@@ -930,7 +930,7 @@ async def test_no_remove(self):
930930 username = "noremove" , password = "pw" , authSource = "pymongo_test"
931931 )
932932 coll = cli .pymongo_test .test
933- coll .find_one ()
933+ await coll .find_one ()
934934 requests = [
935935 InsertOne ({"x" : 1 }),
936936 ReplaceOne ({"x" : 2 }, {"x" : 2 }, upsert = True ),
@@ -954,7 +954,7 @@ async def _setup_class(cls):
954954 if cls .w is not None and cls .w > 1 :
955955 for member in (await async_client_context .hello )["hosts" ]:
956956 if member != (await async_client_context .hello )["primary" ]:
957- cls .secondary = single_client (* partition_node (member ))
957+ cls .secondary = await async_single_client (* partition_node (member ))
958958 break
959959
960960 @classmethod
0 commit comments