File tree 2 files changed +2
-0
lines changed
2 files changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -1189,6 +1189,7 @@ def setUp(self) -> None:
1189
1189
if client_context .serverless and not getattr (self , "RUN_ON_SERVERLESS" , False ):
1190
1190
raise SkipTest ("this test does not support serverless" )
1191
1191
self .client = client_context .client
1192
+ self .addCleanup (self .client .close )
1192
1193
self .db = self .client .pymongo_test
1193
1194
if client_context .auth_enabled :
1194
1195
self .credentials = {"username" : db_user , "password" : db_pwd }
Original file line number Diff line number Diff line change @@ -1207,6 +1207,7 @@ async def asyncSetUp(self) -> None:
1207
1207
if async_client_context .serverless and not getattr (self , "RUN_ON_SERVERLESS" , False ):
1208
1208
raise SkipTest ("this test does not support serverless" )
1209
1209
self .client = async_client_context .client
1210
+ self .addAsyncCleanup (self .client .close )
1210
1211
self .db = self .client .pymongo_test
1211
1212
if async_client_context .auth_enabled :
1212
1213
self .credentials = {"username" : db_user , "password" : db_pwd }
You can’t perform that action at this time.
0 commit comments