chore: remove decorator kwarg to ensure global conftest applies

This commit is contained in:
Greyson Lalonde
2025-11-07 17:01:30 -05:00
parent 54f8cc685f
commit 19f4ef0982
31 changed files with 1352 additions and 315 deletions

View File

@@ -288,7 +288,7 @@ def test_guardrail_type_error():
)
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_output_pydantic_sequential():
class ScoreOutput(BaseModel):
score: int
@@ -313,7 +313,7 @@ def test_output_pydantic_sequential():
assert result.to_dict() == {"score": 4}
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_output_pydantic_hierarchical():
class ScoreOutput(BaseModel):
score: int
@@ -343,7 +343,7 @@ def test_output_pydantic_hierarchical():
assert result.to_dict() == {"score": 4}
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_output_json_sequential():
import uuid
@@ -375,7 +375,7 @@ def test_output_json_sequential():
os.remove(output_file)
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_output_json_hierarchical():
class ScoreOutput(BaseModel):
score: int
@@ -401,11 +401,11 @@ def test_output_json_hierarchical():
manager_llm="gpt-4o",
)
result = crew.kickoff()
assert result.json == '{"score": 4}'
assert result.to_dict() == {"score": 4}
assert result.json == '{"score": 5}'
assert result.to_dict() == {"score": 5}
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_inject_date():
reporter = Agent(
role="Reporter",
@@ -430,7 +430,7 @@ def test_inject_date():
assert "2025-05-21" in result.raw
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_inject_date_custom_format():
reporter = Agent(
role="Reporter",
@@ -456,7 +456,7 @@ def test_inject_date_custom_format():
assert "May 21, 2025" in result.raw
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_no_inject_date():
reporter = Agent(
role="Reporter",
@@ -481,7 +481,7 @@ def test_no_inject_date():
assert "2025-05-21" not in result.raw
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_json_property_without_output_json():
class ScoreOutput(BaseModel):
score: int
@@ -509,7 +509,7 @@ def test_json_property_without_output_json():
assert "No JSON output found in the final task." in str(excinfo.value)
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_output_json_dict_sequential():
class ScoreOutput(BaseModel):
score: int
@@ -534,7 +534,7 @@ def test_output_json_dict_sequential():
assert result.to_dict() == {"score": 4}
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_output_json_dict_hierarchical():
class ScoreOutput(BaseModel):
score: int
@@ -564,7 +564,7 @@ def test_output_json_dict_hierarchical():
assert result.to_dict() == {"score": 4}
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_output_pydantic_to_another_task():
class ScoreOutput(BaseModel):
score: int
@@ -602,7 +602,7 @@ def test_output_pydantic_to_another_task():
assert pydantic_result.score == 5
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_output_json_to_another_task():
class ScoreOutput(BaseModel):
score: int
@@ -633,7 +633,7 @@ def test_output_json_to_another_task():
assert '{"score": 3}' == result.json
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_save_task_output():
scorer = Agent(
role="Scorer",
@@ -657,7 +657,7 @@ def test_save_task_output():
save_file.assert_called_once()
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_save_task_json_output():
from unittest.mock import patch
@@ -695,7 +695,7 @@ def test_save_task_json_output():
assert "score" in data
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_save_task_pydantic_output():
import uuid
@@ -728,7 +728,7 @@ def test_save_task_pydantic_output():
os.remove(output_file)
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_custom_converter_cls():
class ScoreOutput(BaseModel):
score: int
@@ -760,7 +760,7 @@ def test_custom_converter_cls():
mock_to_pydantic.assert_called_once()
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_increment_delegations_for_hierarchical_process():
scorer = Agent(
role="Scorer",
@@ -787,7 +787,7 @@ def test_increment_delegations_for_hierarchical_process():
increment_delegations.assert_called_once()
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_increment_delegations_for_sequential_process():
manager = Agent(
role="Manager",
@@ -821,7 +821,7 @@ def test_increment_delegations_for_sequential_process():
increment_delegations.assert_called_once()
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_increment_tool_errors():
from crewai.tools import tool
@@ -1275,7 +1275,7 @@ def test_github_issue_3149_reproduction():
assert task.output_file == "test_output.txt"
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_task_execution_times():
researcher = Agent(
role="Researcher",
@@ -1545,7 +1545,7 @@ def test_task_with_no_max_execution_time():
execute.assert_called_once()
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_task_with_max_execution_time():
from crewai.tools import tool
@@ -1579,7 +1579,7 @@ def test_task_with_max_execution_time():
assert result.raw == "okay"
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_task_with_max_execution_time_exceeded():
from crewai.tools import tool
@@ -1613,7 +1613,7 @@ def test_task_with_max_execution_time_exceeded():
task.execute_sync(agent=researcher)
@pytest.mark.vcr(filter_headers=["authorization"])
@pytest.mark.vcr()
def test_task_interpolation_with_hyphens():
agent = Agent(
role="Researcher",