feat: 完善数据库备份管理与版本读取 (#6450)

This commit is contained in:
InfinityPacer
2026-08-25 16:05:45 +08:00
committed by GitHub
parent b952a3e407
commit d58c8d2b17
38 changed files with 1846 additions and 459 deletions
+16 -2
View File
@@ -1,6 +1,8 @@
"""mypy 错误数只降不增 ratchet 的解析与对比逻辑测试。"""
"""mypy 错误数只降不增 ratchet 的执行、解析与对比逻辑测试。"""
from scripts.architecture.mypy_ratchet import compare_counts, parse_errors
from unittest.mock import patch
from scripts.architecture.mypy_ratchet import compare_counts, parse_errors, run_mypy
MYPY_SAMPLE = """
@@ -13,6 +15,18 @@ Found 3 errors in 1 file (checked 500 source files)
"""
def test_run_mypy_uses_stable_full_analysis() -> None:
"""全量门禁不得复用前序检查缓存,也不得输出换行错误码。"""
with patch("scripts.architecture.mypy_ratchet.subprocess.run") as run:
run.return_value.stdout = ""
run_mypy()
command = run.call_args.args[0]
assert "--no-incremental" in command
assert "--no-pretty" in command
def test_parse_errors_aggregates_per_file_and_code() -> None:
"""错误行按文件与错误码聚合,源码上下文与摘要行不计入。"""
report = parse_errors(MYPY_SAMPLE)