test: 补齐覆盖率工具(pytest-cov,fail_under=90,基线 96.67%)
This commit is contained in:
+17
-2
@@ -16,10 +16,25 @@ dependencies = [
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
dev = ["pytest>=8.0"]
|
||||
dev = ["pytest>=8.0", "pytest-cov>=7.0"]
|
||||
|
||||
[tool.setuptools.packages.find]
|
||||
where = ["src"]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
testpaths = ["tests"]
|
||||
testpaths = ["tests"]
|
||||
addopts = "--cov=genesis --cov-report=term-missing"
|
||||
|
||||
[tool.coverage.run]
|
||||
# 仅统计 src/genesis 业务代码(不含 tests 自身)
|
||||
source = ["genesis"]
|
||||
# 测量分支覆盖
|
||||
branch = true
|
||||
|
||||
[tool.coverage.report]
|
||||
# 覆盖率门槛:低于该值 pytest 失败(红线,防止回归)
|
||||
fail_under = 90
|
||||
# 跳过 __init__.py 等空文件干扰
|
||||
skip_empty = true
|
||||
# 按语句总数降序展示
|
||||
sort = "miss"
|
||||
Reference in New Issue
Block a user