mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-07 00:16:57 +08:00
feat: 完善数据库备份管理与版本读取 (#6450)
This commit is contained in:
+16
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user