File tree 2 files changed +12
-6
lines changed
2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -170,7 +170,8 @@ async def test_init_kms_tls_options(self):
170
170
# Error cases:
171
171
opts = AutoEncryptionOpts ({}, "k.d" , kms_tls_options = {"kmip" : 1 })
172
172
with self .assertRaisesRegex (TypeError , r'kms_tls_options\["kmip"\] must be a dict' ):
173
- AsyncMongoClient (auto_encryption_opts = opts )
173
+ client = AsyncMongoClient (auto_encryption_opts = opts )
174
+ await client .close ()
174
175
175
176
tls_opts : Any
176
177
for tls_opts in [
@@ -180,12 +181,14 @@ async def test_init_kms_tls_options(self):
180
181
]:
181
182
opts = AutoEncryptionOpts ({}, "k.d" , kms_tls_options = tls_opts )
182
183
with self .assertRaisesRegex (ConfigurationError , "Insecure TLS options prohibited" ):
183
- AsyncMongoClient (auto_encryption_opts = opts )
184
+ client = AsyncMongoClient (auto_encryption_opts = opts )
185
+ await client .close ()
184
186
opts = AutoEncryptionOpts (
185
187
{}, "k.d" , kms_tls_options = {"kmip" : {"tlsCAFile" : "does-not-exist" }}
186
188
)
187
189
with self .assertRaises (FileNotFoundError ):
188
- AsyncMongoClient (auto_encryption_opts = opts )
190
+ client = AsyncMongoClient (auto_encryption_opts = opts )
191
+ await client .close ()
189
192
# Success cases:
190
193
tls_opts : Any
191
194
for tls_opts in [None , {}]:
Original file line number Diff line number Diff line change @@ -170,7 +170,8 @@ def test_init_kms_tls_options(self):
170
170
# Error cases:
171
171
opts = AutoEncryptionOpts ({}, "k.d" , kms_tls_options = {"kmip" : 1 })
172
172
with self .assertRaisesRegex (TypeError , r'kms_tls_options\["kmip"\] must be a dict' ):
173
- MongoClient (auto_encryption_opts = opts )
173
+ client = MongoClient (auto_encryption_opts = opts )
174
+ client .close ()
174
175
175
176
tls_opts : Any
176
177
for tls_opts in [
@@ -180,12 +181,14 @@ def test_init_kms_tls_options(self):
180
181
]:
181
182
opts = AutoEncryptionOpts ({}, "k.d" , kms_tls_options = tls_opts )
182
183
with self .assertRaisesRegex (ConfigurationError , "Insecure TLS options prohibited" ):
183
- MongoClient (auto_encryption_opts = opts )
184
+ client = MongoClient (auto_encryption_opts = opts )
185
+ client .close ()
184
186
opts = AutoEncryptionOpts (
185
187
{}, "k.d" , kms_tls_options = {"kmip" : {"tlsCAFile" : "does-not-exist" }}
186
188
)
187
189
with self .assertRaises (FileNotFoundError ):
188
- MongoClient (auto_encryption_opts = opts )
190
+ client = MongoClient (auto_encryption_opts = opts )
191
+ client .close ()
189
192
# Success cases:
190
193
tls_opts : Any
191
194
for tls_opts in [None , {}]:
You can’t perform that action at this time.
0 commit comments