From b92e0681553611edb85d12440e1c7c206d7e673c Mon Sep 17 00:00:00 2001 From: "Xiang (Sean) Zhou" Date: Wed, 28 May 2025 22:29:01 -0700 Subject: [PATCH] chore: fix function tool UT PiperOrigin-RevId: 764567867 --- tests/unittests/tools/test_function_tool.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/unittests/tools/test_function_tool.py b/tests/unittests/tools/test_function_tool.py index 7f04b27..9d325ed 100644 --- a/tests/unittests/tools/test_function_tool.py +++ b/tests/unittests/tools/test_function_tool.py @@ -104,14 +104,16 @@ def test_init(): assert tool.func == function_for_testing_with_no_args -def test_function_returning_none(): +@pytest.mark.asyncio +async def test_function_returning_none(): """Test that the function returns with None actually returning None.""" tool = FunctionTool(function_returning_none) result = await tool.run_async(args={}, tool_context=MagicMock()) assert result is None -def test_function_returning_empty_dict(): +@pytest.mark.asyncio +async def test_function_returning_empty_dict(): """Test that the function returns with empty dict actually returning empty dict.""" tool = FunctionTool(function_returning_empty_dict) result = await tool.run_async(args={}, tool_context=MagicMock())