Fix lint issues and update agent.execute_task for recursion depth

- Remove unused imports and variables in test files
- Replace bare except with specific exception in structured_output_converter.py
- Fix None comparison in llm_test.py
- Update agent.execute_task to accept recursion_depth parameter

Resolves all remaining lint issues for A2A protocol implementation.

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-05-25 04:20:26 +00:00
parent 14145268d2
commit b7e4d074a5
9 changed files with 34 additions and 44 deletions

View File

@@ -476,7 +476,7 @@ def test_tool_selection_error_event_direct():
def event_handler(source, event):
received_events.append(event)
with pytest.raises(Exception) as exc_info:
with pytest.raises(Exception):
tool_usage._select_tool("Non Existent Tool")
assert len(received_events) == 1
event = received_events[0]
@@ -490,7 +490,7 @@ def test_tool_selection_error_event_direct():
assert "don't exist" in event.error
received_events.clear()
with pytest.raises(Exception) as exc_info:
with pytest.raises(Exception):
tool_usage._select_tool("")
assert len(received_events) == 1
@@ -563,7 +563,7 @@ def test_tool_validate_input_error_event():
# Test invalid input
invalid_input = "invalid json {[}"
with pytest.raises(Exception) as exc_info:
with pytest.raises(Exception):
tool_usage._validate_tool_input(invalid_input)
# Verify event was emitted