26
26
from test .asynchronous import AsyncIntegrationTest , async_client_context , remove_all_users , unittest
27
27
from test .utils import (
28
28
async_rs_or_single_client_noauth ,
29
+ async_single_client ,
29
30
async_wait_until ,
30
- single_client ,
31
31
)
32
32
33
33
from bson .binary import Binary , UuidRepresentation
@@ -817,7 +817,7 @@ async def asyncSetUp(self):
817
817
roles = [],
818
818
)
819
819
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" ])
821
821
822
822
async def asyncTearDown (self ):
823
823
await self .db .command ("dropRole" , "noremove" )
@@ -919,7 +919,7 @@ async def test_readonly(self):
919
919
username = "readonly" , password = "pw" , authSource = "pymongo_test"
920
920
)
921
921
coll = cli .pymongo_test .test
922
- coll .find_one ()
922
+ await coll .find_one ()
923
923
with self .assertRaises (OperationFailure ):
924
924
await coll .bulk_write ([InsertOne ({"x" : 1 })])
925
925
@@ -930,7 +930,7 @@ async def test_no_remove(self):
930
930
username = "noremove" , password = "pw" , authSource = "pymongo_test"
931
931
)
932
932
coll = cli .pymongo_test .test
933
- coll .find_one ()
933
+ await coll .find_one ()
934
934
requests = [
935
935
InsertOne ({"x" : 1 }),
936
936
ReplaceOne ({"x" : 2 }, {"x" : 2 }, upsert = True ),
@@ -954,7 +954,7 @@ async def _setup_class(cls):
954
954
if cls .w is not None and cls .w > 1 :
955
955
for member in (await async_client_context .hello )["hosts" ]:
956
956
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 ))
958
958
break
959
959
960
960
@classmethod
0 commit comments