From f133d13a00b03dfd6924fcd5da7bb5f88021e76a Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sat, 2 Aug 2025 16:10:35 +0000 Subject: [PATCH] fix: resolve lint issues in human input event streaming implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove unused imports from server modules and test files - Fix undefined variable references in test assertions - All ruff checks now pass locally Co-Authored-By: João --- src/crewai/server/event_stream_manager.py | 1 - src/crewai/server/human_input_server.py | 4 +--- tests/server/test_event_stream_manager.py | 5 +---- tests/server/test_human_input_server.py | 3 --- tests/test_human_input_event_integration.py | 6 +++--- 5 files changed, 5 insertions(+), 14 deletions(-) diff --git a/src/crewai/server/event_stream_manager.py b/src/crewai/server/event_stream_manager.py index c6e29fc5d..cbf22b933 100644 --- a/src/crewai/server/event_stream_manager.py +++ b/src/crewai/server/event_stream_manager.py @@ -2,7 +2,6 @@ import asyncio import json import uuid from typing import Dict, List, Optional, Set -from datetime import datetime, timezone from crewai.utilities.events.crewai_event_bus import crewai_event_bus from crewai.utilities.events.task_events import HumanInputRequiredEvent, HumanInputCompletedEvent diff --git a/src/crewai/server/human_input_server.py b/src/crewai/server/human_input_server.py index 7724a3f8b..2d0c4aa76 100644 --- a/src/crewai/server/human_input_server.py +++ b/src/crewai/server/human_input_server.py @@ -1,8 +1,6 @@ import asyncio import json -import queue -import uuid -from typing import Optional, Dict, Any +from typing import Optional from datetime import datetime, timezone try: diff --git a/tests/server/test_event_stream_manager.py b/tests/server/test_event_stream_manager.py index 15fc6c289..78a4062e6 100644 --- a/tests/server/test_event_stream_manager.py +++ b/tests/server/test_event_stream_manager.py @@ -1,10 +1,7 @@ -import pytest -import asyncio -import json from unittest.mock import MagicMock, patch from crewai.server.event_stream_manager import EventStreamManager -from crewai.utilities.events.task_events import HumanInputRequiredEvent, HumanInputCompletedEvent +from crewai.utilities.events.task_events import HumanInputRequiredEvent class TestEventStreamManager: diff --git a/tests/server/test_human_input_server.py b/tests/server/test_human_input_server.py index e0c5d68f9..bae5f56f8 100644 --- a/tests/server/test_human_input_server.py +++ b/tests/server/test_human_input_server.py @@ -1,7 +1,4 @@ import pytest -import asyncio -import json -from unittest.mock import patch, MagicMock try: from fastapi.testclient import TestClient diff --git a/tests/test_human_input_event_integration.py b/tests/test_human_input_event_integration.py index e1071b594..b84e2b8b7 100644 --- a/tests/test_human_input_event_integration.py +++ b/tests/test_human_input_event_integration.py @@ -167,7 +167,7 @@ class TestHumanInputEventIntegration: with patch.object(crewai_event_bus, 'emit', side_effect=capture_event), \ patch('builtins.input', return_value='test'): - result = self.executor._ask_human_input("Test result") + self.executor._ask_human_input("Test result") assert len(events_captured) == 2 required_event = events_captured[0][1] @@ -185,7 +185,7 @@ class TestHumanInputEventIntegration: with patch.object(crewai_event_bus, 'emit', side_effect=capture_event), \ patch('builtins.input', return_value='test'): - result = self.executor._ask_human_input("Test result") + self.executor._ask_human_input("Test result") assert len(events_captured) == 2 required_event = events_captured[0][1] @@ -202,7 +202,7 @@ class TestHumanInputEventIntegration: with patch.object(crewai_event_bus, 'emit', side_effect=capture_event), \ patch('builtins.input', return_value='test'): - result = self.executor._ask_human_input("Test result") + self.executor._ask_human_input("Test result") assert len(events_captured) == 2 required_event = events_captured[0][1]