Reference in New Issue
Block a user
Delete Branch "fix/ci-ruff-unit-tests-red"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
任务1:修复Code Quality的10个ruff错误(#839)
修改内容
tests/unit/test_jwt_handler.pypytest.raises(Exception)ExpiredSignatureError(过期) /InvalidTokenError(无效/空/错密钥)tests/unit/test_domain_remaining_small_modules.pypytest.raises(Exception)FrozenInstanceError(frozen dataclass)tests/unit/test_filter_presets.pypytest.raises(Exception)FrozenInstanceErrortests/unit/test_transition_presets.pyFrozenInstanceError,F541去掉f前缀tests/unit/test_email_service_smtp.pytype(a) == type(b)type(a) is type(b)结果:ruff check全通过 ✅
任务2:修复Unit Tests收集失败(#881)
问题
test_dedup_pure.py导入video_processing.dedup时,模块顶层from worker_app.db import SessionLocal触发ensure_database_exists()查pg_database表,sqlite环境直接崩溃,导致6275个测试收集失败。修复
在
test_dedup_pure.py已有sys.modules["cv2"]mock的基础上,增加sys.modules["worker_app.db"]mock。纯算法测试不需要数据库,模块级mock避免导入时触发初始化。结果:6275个测试全部收集成功 ✅
范围
关联工单
16a97e0f39to0498f4a7e50498f4a7e5tof4b263bac8🗑️ 预览环境已清理
PR #896 已关闭或合并,对应的预览环境已被清理。