Skip to content

Commit 9587ec5

Browse files
committed
address teardown failures in data lake tests
1 parent 6af4011 commit 9587ec5

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

test/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,7 @@ def setUp(self) -> None:
11891189
if client_context.serverless and not getattr(self, "RUN_ON_SERVERLESS", False):
11901190
raise SkipTest("this test does not support serverless")
11911191
self.client = client_context.client
1192+
self.addCleanup(self.client.close)
11921193
self.db = self.client.pymongo_test
11931194
if client_context.auth_enabled:
11941195
self.credentials = {"username": db_user, "password": db_pwd}

test/asynchronous/__init__.py

+1
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,7 @@ async def asyncSetUp(self) -> None:
12071207
if async_client_context.serverless and not getattr(self, "RUN_ON_SERVERLESS", False):
12081208
raise SkipTest("this test does not support serverless")
12091209
self.client = async_client_context.client
1210+
self.addAsyncCleanup(self.client.close)
12101211
self.db = self.client.pymongo_test
12111212
if async_client_context.auth_enabled:
12121213
self.credentials = {"username": db_user, "password": db_pwd}

0 commit comments

Comments
 (0)