tests: fix test_user_idle_processor for python 3.10

This commit is contained in:
Aleix Conchillo Flaqué
2025-04-01 13:54:59 -07:00
parent 3efbcab39c
commit 31311d8ac5
2 changed files with 8 additions and 3 deletions

View File

@@ -127,9 +127,10 @@ class UserIdleProcessor(FrameProcessor):
# Check for end frames before processing
if isinstance(frame, (EndFrame, CancelFrame)):
await self.push_frame(frame, direction) # Push the frame down the pipeline
if self._idle_task:
await self._stop() # Stop the idle task, if it exists
# Stop the idle task, if it exists
await self._stop()
# Push the frame down the pipeline
await self.push_frame(frame, direction)
return
await self.push_frame(frame, direction)

View File

@@ -71,6 +71,10 @@ class TestUserIdleProcessor(unittest.IsolatedAsyncioTestCase):
SleepFrame(sleep=0.1),
# Another bot speaking frame resets timer again
BotSpeakingFrame(),
# Give some time for the idle timeout task to start (Python 3.10
# doesn't really like when you create a task and then cancel it
# right away).
SleepFrame(sleep=0.1),
]
expected_down_frames = [