Skip to content

Commit 2fb35cd

Browse files
authored
chore(langchain-sdk): Fix warning about async session not closed after langchain utils tests. (#144)
1 parent 86bcf1c commit 2fb35cd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/test_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ async def test_invoke_tool_unsecure_with_auth(self, mock_post):
220220
@pytest.mark.asyncio
221221
@patch("aiohttp.ClientSession.post")
222222
async def test_invoke_tool_secure_with_auth(self, mock_post):
223+
session = ClientSession()
223224
mock_response = Mock()
224225
mock_response.raise_for_status = Mock()
225226
mock_response.json = AsyncMock(return_value={"key": "value"})
@@ -229,7 +230,7 @@ async def test_invoke_tool_secure_with_auth(self, mock_post):
229230
warnings.simplefilter("error")
230231
result = await _invoke_tool(
231232
"https://localhost:8000",
232-
ClientSession(),
233+
session,
233234
"tool_name",
234235
{"input": "data"},
235236
{"my_test_auth": lambda: "fake_id_token"},

0 commit comments

Comments
 (0)