mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 09:08:31 +00:00
fix: resolve lint issues in human input event streaming implementation
- 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 <joao@crewai.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import pytest
|
||||
import asyncio
|
||||
import json
|
||||
from unittest.mock import patch, MagicMock
|
||||
|
||||
try:
|
||||
from fastapi.testclient import TestClient
|
||||
|
||||
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user