From 510a4087cd3e4feb484b1d6e611678e34335c1b7 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 4 Jun 2025 07:08:26 +0000 Subject: [PATCH] Fix existing test assertions for streaming parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update mock assertions to include new stream and stream_callback parameters - Fix test_replay_with_context_set_to_nullable assertion - Fix test_crew_guardrail_feedback_in_context side_effect signature - Fix test_task_prompt_includes_expected_output and related test assertions Co-Authored-By: João --- tests/crew_test.py | 4 ++-- tests/task_test.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/crew_test.py b/tests/crew_test.py index 62b934883..9382f8bd3 100644 --- a/tests/crew_test.py +++ b/tests/crew_test.py @@ -3159,7 +3159,7 @@ def test_replay_with_context_set_to_nullable(): ) crew.kickoff() - mock_execute_task.assert_called_with(agent=ANY, context="", tools=ANY) + mock_execute_task.assert_called_with(agent=ANY, context="", tools=ANY, stream=False, stream_callback=None) @pytest.mark.vcr(filter_headers=["authorization"]) @@ -4069,7 +4069,7 @@ def test_crew_guardrail_feedback_in_context(): with patch.object(Agent, "execute_task") as mock_execute_task: # Define side_effect to capture context and return different responses - def side_effect(task, context=None, tools=None): + def side_effect(task, context=None, tools=None, stream=False, stream_callback=None): execution_contexts.append(context if context else "") if len(execution_contexts) == 1: return "This is a test response" diff --git a/tests/task_test.py b/tests/task_test.py index 89fa3c53c..28dc39caf 100644 --- a/tests/task_test.py +++ b/tests/task_test.py @@ -89,7 +89,7 @@ def test_task_prompt_includes_expected_output(): with patch.object(Agent, "execute_task") as execute: execute.return_value = "ok" task.execute_sync(agent=researcher) - execute.assert_called_once_with(task=task, context=None, tools=[]) + execute.assert_called_once_with(task=task, context=None, tools=[], stream=False, stream_callback=None) def test_task_callback(): @@ -181,7 +181,7 @@ def test_execute_with_agent(): with patch.object(Agent, "execute_task", return_value="ok") as execute: task.execute_sync(agent=researcher) - execute.assert_called_once_with(task=task, context=None, tools=[]) + execute.assert_called_once_with(task=task, context=None, tools=[], stream=False, stream_callback=None) def test_async_execution(): @@ -203,7 +203,7 @@ def test_async_execution(): execution = task.execute_async(agent=researcher) result = execution.result() assert result.raw == "ok" - execute.assert_called_once_with(task=task, context=None, tools=[]) + execute.assert_called_once_with(task=task, context=None, tools=[], stream=False, stream_callback=None) def test_multiple_output_type_error():