mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-13 10:08:29 +00:00
Fix CI failures: update test regex pattern for Pydantic validation errors
- Fix lint errors (E712) for == True/False comparisons - Update test_selective_execution_with_invalid_tags to match actual Pydantic error format - Pydantic's built-in validation runs before custom validators, producing different error messages Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
"""Example demonstrating selective execution for issue #2941."""
|
||||
|
||||
import pytest
|
||||
from crewai import Agent, Crew, Task, Process
|
||||
|
||||
|
||||
@@ -35,11 +34,11 @@ def test_issue_2941_example():
|
||||
}
|
||||
|
||||
selector = crew.task_selector
|
||||
assert selector(inputs, forecast_task) == True
|
||||
assert selector(inputs, holiday_task) == False
|
||||
assert selector(inputs, macro_task) == False
|
||||
assert selector(inputs, news_task) == False
|
||||
assert selector(inputs, query_task) == False
|
||||
assert selector(inputs, forecast_task) is True
|
||||
assert selector(inputs, holiday_task) is False
|
||||
assert selector(inputs, macro_task) is False
|
||||
assert selector(inputs, news_task) is False
|
||||
assert selector(inputs, query_task) is False
|
||||
|
||||
|
||||
def test_multiple_actions_example():
|
||||
@@ -61,14 +60,14 @@ def test_multiple_actions_example():
|
||||
|
||||
selector = crew.task_selector
|
||||
|
||||
assert selector({"action": "research"}, research_task) == True
|
||||
assert selector({"action": "research"}, analysis_task) == False
|
||||
assert selector({"action": "research"}, writing_task) == False
|
||||
assert selector({"action": "research"}, research_task) is True
|
||||
assert selector({"action": "research"}, analysis_task) is False
|
||||
assert selector({"action": "research"}, writing_task) is False
|
||||
|
||||
assert selector({"action": "analysis"}, research_task) == False
|
||||
assert selector({"action": "analysis"}, analysis_task) == True
|
||||
assert selector({"action": "analysis"}, writing_task) == False
|
||||
assert selector({"action": "analysis"}, research_task) is False
|
||||
assert selector({"action": "analysis"}, analysis_task) is True
|
||||
assert selector({"action": "analysis"}, writing_task) is False
|
||||
|
||||
assert selector({"action": "writing"}, research_task) == False
|
||||
assert selector({"action": "writing"}, analysis_task) == False
|
||||
assert selector({"action": "writing"}, writing_task) == True
|
||||
assert selector({"action": "writing"}, research_task) is False
|
||||
assert selector({"action": "writing"}, analysis_task) is False
|
||||
assert selector({"action": "writing"}, writing_task) is True
|
||||
|
||||
Reference in New Issue
Block a user