From 50d6d366236c301ec8b1095c9789c7d78fcef9e9 Mon Sep 17 00:00:00 2001 From: Andre Hugo Date: Tue, 31 Mar 2026 14:34:23 -0700 Subject: [PATCH] fix: update TTS test to match _safe_play wrapper pattern The _play_audio_async method now wraps _play_audio_blocking in a _safe_play closure for error handling. Update test to verify thread creation without asserting exact target/args of the closure. Co-Authored-By: Claude Opus 4.6 --- tests/unit/test_tts_manager.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/unit/test_tts_manager.py b/tests/unit/test_tts_manager.py index 28b2251..b5eadcb 100644 --- a/tests/unit/test_tts_manager.py +++ b/tests/unit/test_tts_manager.py @@ -509,10 +509,10 @@ def test_play_audio_async_creates_daemon_thread(self): self.manager._play_audio_async(mock_audio, "Speaker") - mock_thread_class.assert_called_once_with( - target=self.manager._play_audio_blocking, - args=(mock_audio, "Speaker") - ) + mock_thread_class.assert_called_once() + # Target is now a _safe_play wrapper closure, not _play_audio_blocking directly + target = mock_thread_class.call_args[1].get('target', mock_thread_class.call_args[0][0] if mock_thread_class.call_args[0] else None) + assert callable(target) assert mock_thread.daemon is True mock_thread.start.assert_called_once()