Fix integration test failures: correct mocking and attribute access

- 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 <joao@crewai.com>
This commit is contained in:
Devin AI
2025-06-24 05:35:00 +00:00
parent 14629bb87a
commit b1ae914cd3

View File

@@ -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