From aba7afede9fd71e99be163da779e264f17476f3e Mon Sep 17 00:00:00 2001 From: xiaoxia Date: Fri, 14 Aug 2026 21:37:20 +0800 Subject: [PATCH] fix(test): use RuntimeError instead of Exception to avoid B017 lint warning --- tests/unit/test_cover_frame_pre_extract.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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)