diff --git a/tests/unit/test_cover_frame_pre_extract.py b/tests/unit/test_cover_frame_pre_extract.py index c44efb969..c8c2141bd 100644 --- a/tests/unit/test_cover_frame_pre_extract.py +++ b/tests/unit/test_cover_frame_pre_extract.py @@ -114,7 +114,7 @@ class TestExtractFirstFrame(unittest.TestCase): self.assertIn("scale=640", vf_filter) Path(result).unlink(missing_ok=True) - @patch("video_processing.ffmpeg_utils.run_ffmpeg", side_effect=Exception("fail")) + @patch("video_processing.ffmpeg_utils.run_ffmpeg", side_effect=RuntimeError("fail")) @patch("video_processing.ffmpeg_utils.probe_duration", return_value=10.0) def test_cleanup_temp_file_on_failure(self, mock_probe, mock_run): """失败时清理临时文件.""" @@ -123,7 +123,7 @@ class TestExtractFirstFrame(unittest.TestCase): with tempfile.NamedTemporaryFile(suffix=".mp4") as video: Path(video.name).write_bytes(b"fake video") - with self.assertRaises(Exception): + with self.assertRaises(RuntimeError): extract_first_frame(video.name)