From 15fd1bf898261270eb66c8cd4fbe672aa99dfcfa Mon Sep 17 00:00:00 2001 From: Greyson LaLonde Date: Fri, 23 Jan 2026 06:39:09 -0500 Subject: [PATCH] fix(tests): fix multimodal and before_kickoff_callback tests - Mock supports_multimodal() to return False in image tool test since AddImageTool is only added when LLM doesn't natively support multimodal - Remove incorrect assertion that expected original inputs dict to be modified (it's copied internally before modification) --- lib/crewai/tests/test_crew.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/crewai/tests/test_crew.py b/lib/crewai/tests/test_crew.py index c5138c05f..339657738 100644 --- a/lib/crewai/tests/test_crew.py +++ b/lib/crewai/tests/test_crew.py @@ -4038,7 +4038,11 @@ def test_multimodal_agent_image_tool_handling(): messages=[], ) - with patch.object(Task, "execute_sync") as mock_execute_sync: + # Mock supports_multimodal to return False so AddImageTool gets added + with ( + patch.object(Task, "execute_sync") as mock_execute_sync, + patch.object(multimodal_agent.llm, "supports_multimodal", return_value=False), + ): # Set up the mock to return our task output mock_execute_sync.return_value = mock_task_output @@ -4315,9 +4319,9 @@ def test_before_kickoff_callback(): # Call kickoff test_crew.kickoff(inputs=inputs) - # Check that the before_kickoff function was called and modified inputs + # Check that the before_kickoff function was called + # Note: inputs is copied internally, so the original dict is not modified assert test_crew_instance.inputs_modified - assert inputs.get("modified") @pytest.mark.vcr()