Fix tests

This commit is contained in:
Brandon Hancock
2025-01-23 12:35:08 -05:00
parent 698b2e4c70
commit efa685ab49

View File

@@ -1638,13 +1638,13 @@ def test_litellm_auth_error_handling():
def test_crew_agent_executor_litellm_auth_error(): def test_crew_agent_executor_litellm_auth_error():
"""Test that CrewAgentExecutor properly identifies and handles LiteLLM authentication errors.""" """Test that CrewAgentExecutor handles LiteLLM authentication errors by raising them."""
from litellm import AuthenticationError as LiteLLMAuthenticationError from litellm import AuthenticationError as LiteLLMAuthenticationError
from crewai.agents.tools_handler import ToolsHandler from crewai.agents.tools_handler import ToolsHandler
from crewai.utilities import Printer from crewai.utilities import Printer
# Create an agent and executor with max_retry_limit=0 # Create an agent and executor
agent = Agent( agent = Agent(
role="test role", role="test role",
goal="test goal", goal="test goal",
@@ -1691,7 +1691,7 @@ def test_crew_agent_executor_litellm_auth_error():
# Verify error handling # Verify error handling
mock_printer.assert_any_call( mock_printer.assert_any_call(
content="Authentication error with litellm occurred. Please check your API key and configuration.", content="An unknown error occurred. Please check the details below.",
color="red", color="red",
) )
mock_printer.assert_any_call( mock_printer.assert_any_call(