tests: fix test_user_idle_processor for python 3.10
This commit is contained in:
@@ -127,9 +127,10 @@ class UserIdleProcessor(FrameProcessor):
|
|||||||
|
|
||||||
# Check for end frames before processing
|
# Check for end frames before processing
|
||||||
if isinstance(frame, (EndFrame, CancelFrame)):
|
if isinstance(frame, (EndFrame, CancelFrame)):
|
||||||
await self.push_frame(frame, direction) # Push the frame down the pipeline
|
# Stop the idle task, if it exists
|
||||||
if self._idle_task:
|
await self._stop()
|
||||||
await self._stop() # Stop the idle task, if it exists
|
# Push the frame down the pipeline
|
||||||
|
await self.push_frame(frame, direction)
|
||||||
return
|
return
|
||||||
|
|
||||||
await self.push_frame(frame, direction)
|
await self.push_frame(frame, direction)
|
||||||
|
|||||||
@@ -71,6 +71,10 @@ class TestUserIdleProcessor(unittest.IsolatedAsyncioTestCase):
|
|||||||
SleepFrame(sleep=0.1),
|
SleepFrame(sleep=0.1),
|
||||||
# Another bot speaking frame resets timer again
|
# Another bot speaking frame resets timer again
|
||||||
BotSpeakingFrame(),
|
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 = [
|
expected_down_frames = [
|
||||||
|
|||||||
Reference in New Issue
Block a user