From b1ae914cd3b65285a6a774710dad7db43575d8f3 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 24 Jun 2025 05:35:00 +0000 Subject: [PATCH] Fix integration test failures: correct mocking and attribute access MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix test_crew_with_llm_parameters: mock _run_sequential_process instead of kickoff to avoid circular mocking - Fix test_lite_agent_with_xml_extraction: access result.raw instead of result.output for LiteAgentOutput Co-Authored-By: João --- tests/test_integration_llm_features.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_integration_llm_features.py b/tests/test_integration_llm_features.py index 9e9849599..9d0962f19 100644 --- a/tests/test_integration_llm_features.py +++ b/tests/test_integration_llm_features.py @@ -79,7 +79,7 @@ class TestIntegrationLLMFeatures: result = lite_agent.kickoff("Analyze this problem") - thinking_content = extract_xml_content(result, "thinking") + thinking_content = extract_xml_content(result.raw, "thinking") assert thinking_content is not None assert "step by step" in thinking_content assert "requirements" in thinking_content @@ -148,10 +148,10 @@ class TestIntegrationLLMFeatures: crew = Crew(agents=[agent], tasks=[task]) - with patch.object(crew, 'kickoff') as mock_kickoff: - mock_output = Mock() - mock_output.tasks_output = [Mock(completion_metadata={"choices": mock_response.choices})] - mock_kickoff.return_value = mock_output + with patch.object(crew, '_run_sequential_process') as mock_run: + from crewai.crews.crew_output import CrewOutput + mock_output = CrewOutput(raw="Test response") + mock_run.return_value = mock_output result = crew.kickoff() assert result is not None