Address PR feedback: Add type hints and improve docstrings

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-05-08 16:03:22 +00:00
parent e7a95d0b2d
commit 519ab3f324
2 changed files with 27 additions and 3 deletions

View File

@@ -1,7 +1,8 @@
"""Test that context=[] is respected and doesn't include previous task outputs."""
import pytest
from unittest import mock
import pytest
from crewai import Agent, Crew, Process, Task
from crewai.tasks.task_output import OutputFormat, TaskOutput
from crewai.utilities.formatter import (
@@ -9,8 +10,19 @@ from crewai.utilities.formatter import (
aggregate_raw_outputs_from_tasks,
)
def test_context_empty_list():
"""Test that context=[] is respected and doesn't include previous task outputs."""
"""Test that context=[] is respected and doesn't include previous task outputs.
This test verifies that when a task has context=[], the _get_context method
correctly uses task_outputs instead of an empty context list.
Returns:
None
Raises:
AssertionError: If the context handling doesn't work as expected
"""
researcher = Agent(