diff --git a/apps/api/app/services/plan_generator_service.py b/apps/api/app/services/plan_generator_service.py index a124e83dc..db68aa8f8 100644 --- a/apps/api/app/services/plan_generator_service.py +++ b/apps/api/app/services/plan_generator_service.py @@ -224,7 +224,7 @@ class PlanGeneratorService: ) order += 1 # 剩余为 overlay - for i in range(1, n): + for _ in range(1, n): clips.append( EditPlanClip.create( plan_id=plan_id, @@ -237,7 +237,7 @@ class PlanGeneratorService: elif editing_mode == EditingMode.VOICE_OVER.value: # N 个 main clips(B-roll) - for i in range(n): + for _ in range(n): clips.append( EditPlanClip.create( plan_id=plan_id, @@ -271,7 +271,7 @@ class PlanGeneratorService: ) order += 1 # 剩余为 b_roll - for i in range(2, n): + for _ in range(2, n): clips.append( EditPlanClip.create( plan_id=plan_id, @@ -284,7 +284,7 @@ class PlanGeneratorService: else: # ONE_TAKE: N 个 main clips - for i in range(n): + for _ in range(n): clips.append( EditPlanClip.create( plan_id=plan_id, diff --git a/apps/worker/video_processing/pip_engine.py b/apps/worker/video_processing/pip_engine.py index 59c26d6ef..bc231b2cb 100755 --- a/apps/worker/video_processing/pip_engine.py +++ b/apps/worker/video_processing/pip_engine.py @@ -403,7 +403,7 @@ class PiPEngine: input_args: list[str] = [] current_label = base_label - for i, (input_label, layer, path) in enumerate(pip_sources): + for i, (_input_label, layer, path) in enumerate(pip_sources): # 添加输入 input_args.extend(["-i", str(path)]) diff --git a/apps/worker/video_processing/sticker_engine.py b/apps/worker/video_processing/sticker_engine.py index afbdc996e..67ff13397 100755 --- a/apps/worker/video_processing/sticker_engine.py +++ b/apps/worker/video_processing/sticker_engine.py @@ -359,7 +359,7 @@ class StickerEngine: image_stickers: list[ImageStickerConfig] = [] image_paths: list[str] = [] - for i, s in enumerate(stickers): + for _, s in enumerate(stickers): try: sticker_type = s.get("type", "image") z = int(s.get("z_index", 10)) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index 7a9247719..71db53f6b 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -137,7 +137,7 @@ class PerfAssert: result = PerfResult(name=name or threshold_level, threshold_ms=threshold_ms) last_response = None - for i in range(num_samples): + for _ in range(num_samples): start = time.perf_counter() last_response = func() elapsed = (time.perf_counter() - start) * 1000 @@ -261,7 +261,7 @@ def run_perf_test( result = PerfResult(name=name, threshold_ms=threshold_ms) last_response = None - for i in range(samples): + for _ in range(samples): start = time.perf_counter() last_response = func() elapsed = (time.perf_counter() - start) * 1000 diff --git a/tests/integration/test_error_scenarios.py b/tests/integration/test_error_scenarios.py index 34601720e..c48739354 100755 --- a/tests/integration/test_error_scenarios.py +++ b/tests/integration/test_error_scenarios.py @@ -530,7 +530,7 @@ class TestLargeDataRequests: def test_rapid_sequential_requests(self, auth_headers): """快速连续请求不应触发限流导致 500。""" statuses = [] - for i in range(20): + for _ in range(20): resp = client.get("/api/v1/projects", headers=auth_headers) statuses.append(resp.status_code) diff --git a/tests/unit/test_pr312_security_debt.py b/tests/unit/test_pr312_security_debt.py index 14225835d..c1a685685 100644 --- a/tests/unit/test_pr312_security_debt.py +++ b/tests/unit/test_pr312_security_debt.py @@ -253,7 +253,7 @@ class TestConcatSecurity: # 创建超过上限的段数 segments = [] - for i in range(MAX_CONCAT_SEGMENTS + 5): + for _ in range(MAX_CONCAT_SEGMENTS + 5): segments.append(ConcatSegment(video_path=str(sample_video))) config = ConcatConfig(segments=segments) diff --git a/tests/unit/test_tts_segment_synthesis.py b/tests/unit/test_tts_segment_synthesis.py index e729d0665..5159683fe 100755 --- a/tests/unit/test_tts_segment_synthesis.py +++ b/tests/unit/test_tts_segment_synthesis.py @@ -115,7 +115,7 @@ class TestAudioMerger: # 创建临时文件 paths = [] - for i in range(3): + for _ in range(3): with tempfile.NamedTemporaryFile(suffix=".mp3", delete=False) as f: f.write(b"audio") paths.append(f.name) @@ -151,7 +151,7 @@ class TestAudioMerger: mock_run_ffmpeg.side_effect = CalledProcessError(returncode=1, cmd=["ffmpeg"], stderr="error details") paths = [] - for i in range(2): + for _ in range(2): with tempfile.NamedTemporaryFile(suffix=".mp3", delete=False) as f: f.write(b"audio") paths.append(f.name)