async def test_end_frame_handling(self):
        """Test that final messages are captured when pipeline ends normally"""
        processor = AssistantTranscriptProcessor()

        received_updates: List[TranscriptionUpdateFrame] = []

        @processor.event_handler("on_transcript_update")
        async def handle_update(proc, frame: TranscriptionUpdateFrame):
            received_updates.append(frame)

        frames_to_send = [
            BotStartedSpeakingFrame(),
            SleepFrame(sleep=0.1),
            TTSTextFrame(text="Hello"),
            TTSTextFrame(text="world"),
            # Pipeline ends here; run_test will automatically send EndFrame
        ]

        expected_down_frames = [
            BotStartedSpeakingFrame,
            TTSTextFrame,
            TTSTextFrame,
            TranscriptionUpdateFrame,  # Final message emitted due to EndFrame
        ]

        # Run test - EndFrame will be sent automatically
        received_frames, _ = await run_test(
            processor,
            frames_to_send=frames_to_send,
            expected_down_frames=expected_down_frames,
        )

        self.assertEqual(len(received_updates), 1)
        message = received_updates[0].messages[0]
        self.assertEqual(message.role, "assistant")
        self.assertEqual(message.content, "Hello world")
Test that final messages are captured when pipeline ends normally
tests/test_transcript_processor.py