@@ -170,8 +170,7 @@ async def test_init_kms_tls_options(self):
170170 # Error cases:
171171 opts = AutoEncryptionOpts ({}, "k.d" , kms_tls_options = {"kmip" : 1 })
172172 with self .assertRaisesRegex (TypeError , r'kms_tls_options\["kmip"\] must be a dict' ):
173- client = await self .async_rs_or_single_client (auto_encryption_opts = opts )
174- await client .db .coll .insert_one ({"encrypted" : "test" })
173+ AsyncMongoClient (auto_encryption_opts = opts )
175174
176175 tls_opts : Any
177176 for tls_opts in [
@@ -181,14 +180,12 @@ async def test_init_kms_tls_options(self):
181180 ]:
182181 opts = AutoEncryptionOpts ({}, "k.d" , kms_tls_options = tls_opts )
183182 with self .assertRaisesRegex (ConfigurationError , "Insecure TLS options prohibited" ):
184- client = await self .async_rs_or_single_client (auto_encryption_opts = opts )
185- await client .db .coll .insert_one ({"encrypted" : "test" })
183+ AsyncMongoClient (auto_encryption_opts = opts )
186184 opts = AutoEncryptionOpts (
187185 {}, "k.d" , kms_tls_options = {"kmip" : {"tlsCAFile" : "does-not-exist" }}
188186 )
189187 with self .assertRaises (FileNotFoundError ):
190- client = await self .async_rs_or_single_client (auto_encryption_opts = opts )
191- await client .db .coll .insert_one ({"encrypted" : "test" })
188+ AsyncMongoClient (auto_encryption_opts = opts )
192189 # Success cases:
193190 tls_opts : Any
194191 for tls_opts in [None , {}]:
0 commit comments