fix: rename ambiguous variable 'l' to 'line' in tests (E741)
CI/CD Pipeline / Build Staging API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Staging Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (pull_request) Has been skipped
CI/CD Pipeline / Staging E2E Tests (pull_request) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (pull_request) Has been skipped
CI/CD Pipeline / ACR Image Cleanup (pull_request) Has been skipped
CI/CD Pipeline / Check if frontend-only change (pull_request) Successful in 26s
CI/CD Pipeline / Frontend Lint (pull_request) Has been skipped
CI/CD Pipeline / Frontend Unit Tests (pull_request) Has been skipped
CI/CD Pipeline / PR Build Web Image (pull_request) Has been skipped
CI/CD Pipeline / Validate - Migration (alembic) (pull_request) Successful in 1m43s
CI/CD Pipeline / Validate - Type Check (mypy) (pull_request) Successful in 1m51s
PR Automation / Auto Merge on CI Green + Approved (pull_request) Successful in 1m58s
Preview Deploy / Deploy Preview Environment (pull_request) Successful in 2m39s
CI/CD Pipeline / PR Build API Image (pull_request) Successful in 2m59s
CI/CD Pipeline / PR Build Worker Image (pull_request) Successful in 3m1s
CI/CD Pipeline / Unit Tests (pull_request) Successful in 3m9s
PR Automation / Auto Approve on CI Green (pull_request) Successful in 3m42s
CI/CD Pipeline / Validate - Code Quality (pull_request) Successful in 4m52s
CI/CD Pipeline / Build Production Web Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production API Image (pull_request) Has been skipped
CI/CD Pipeline / Build Production Worker Image (pull_request) Has been skipped
CI/CD Pipeline / Canary Release to Production (pull_request) Has been skipped
CI/CD Pipeline / Deploy Production (pull_request) Has been skipped
CI/CD Pipeline / Production Browser E2E (pull_request) Has been skipped
AI Code Review / AI Code Review (pull_request) Successful in 6m52s
CI/CD Pipeline / Integration Tests (pull_request) Successful in 3m11s
CI/CD Pipeline / CI Gate (pull_request) Successful in 19s
ACR Cleanup / ACR Image Cleanup (pull_request_target) Successful in 37s
Preview Cleanup / Cleanup Preview Environment (pull_request) Successful in 51s

Fix 8 flake8 E741 errors in test_title_render_consistency.py
where list comprehension used 'l' as variable name.
This commit is contained in:
xiaoxia-ci
2026-08-16 18:52:02 +08:00
parent 02d2c7ea65
commit 2f7789f10b
+8 -8
View File
@@ -54,7 +54,7 @@ class TestFontSizeCap:
title_config=config,
)
# 解析 Style 行的 Fontsize 字段(第3个字段,索引2)
style_line = [l for l in content.splitlines() if l.startswith("Style: TitleStyle")][0]
style_line = [line for line in content.splitlines() if line.startswith("Style: TitleStyle")][0]
fields = [f.strip() for f in style_line.split(",")]
font_size = int(fields[2])
assert font_size == 36, f"字号60应被cap到36, 实际={font_size}"
@@ -86,7 +86,7 @@ class TestBooleanStrokeNormalization:
title_config=config,
)
# 解析 Style 行的 Outline 字段(第17个字段,索引16)
style_line = [l for l in content.splitlines() if l.startswith("Style: TitleStyle")][0]
style_line = [line for line in content.splitlines() if line.startswith("Style: TitleStyle")][0]
fields = [f.strip() for f in style_line.split(",")]
outline_width = float(fields[16])
assert outline_width == 2.0, f"stroke=true 应产生 outline_width=2, 实际={outline_width}"
@@ -101,7 +101,7 @@ class TestBooleanStrokeNormalization:
title_text="测试标题",
title_config=config,
)
style_line = [l for l in content.splitlines() if l.startswith("Style: TitleStyle")][0]
style_line = [line for line in content.splitlines() if line.startswith("Style: TitleStyle")][0]
fields = [f.strip() for f in style_line.split(",")]
outline_width = float(fields[16])
assert outline_width == 0.0, f"stroke=false 应产生 outline_width=0, 实际={outline_width}"
@@ -116,7 +116,7 @@ class TestBooleanStrokeNormalization:
title_text="测试标题",
title_config=config,
)
style_line = [l for l in content.splitlines() if l.startswith("Style: TitleStyle")][0]
style_line = [line for line in content.splitlines() if line.startswith("Style: TitleStyle")][0]
fields = [f.strip() for f in style_line.split(",")]
outline_width = float(fields[16])
assert outline_width == 3.0, f"自定义stroke width=3 应保留, 实际={outline_width}"
@@ -135,7 +135,7 @@ class TestBooleanShadowNormalization:
title_text="测试标题",
title_config=config,
)
style_line = [l for l in content.splitlines() if l.startswith("Style: TitleStyle")][0]
style_line = [line for line in content.splitlines() if line.startswith("Style: TitleStyle")][0]
fields = [f.strip() for f in style_line.split(",")]
# Shadow 字段是第18个(索引17
shadow_depth = int(fields[17])
@@ -151,7 +151,7 @@ class TestBooleanShadowNormalization:
title_text="测试标题",
title_config=config,
)
style_line = [l for l in content.splitlines() if l.startswith("Style: TitleStyle")][0]
style_line = [line for line in content.splitlines() if line.startswith("Style: TitleStyle")][0]
fields = [f.strip() for f in style_line.split(",")]
shadow_depth = int(fields[17])
assert shadow_depth == 0, f"shadow=false 应产生 shadow_depth=0, 实际={shadow_depth}"
@@ -166,7 +166,7 @@ class TestBooleanShadowNormalization:
title_text="测试标题",
title_config=config,
)
style_line = [l for l in content.splitlines() if l.startswith("Style: TitleStyle")][0]
style_line = [line for line in content.splitlines() if line.startswith("Style: TitleStyle")][0]
fields = [f.strip() for f in style_line.split(",")]
shadow_depth = int(fields[17])
assert shadow_depth == 3, f"自定义shadow offset_y=3 应保留, 实际={shadow_depth}"
@@ -198,7 +198,7 @@ class TestFullStyleConsistency:
title_text="标题文本",
title_config=config,
)
style_line = [l for l in content.splitlines() if l.startswith("Style: TitleStyle")][0]
style_line = [line for line in content.splitlines() if line.startswith("Style: TitleStyle")][0]
fields = [f.strip() for f in style_line.split(",")]
# Fontname