帮助识别Python代码覆盖率中的差距。
项目描述
Spackle
Spackle对Coverage.py结果报告进行排序,以便您更快地识别测试覆盖率中的差距。
安装
pip install spackle
使用方法
只需在执行Coverage.py的运行命令后运行spackle
,而不是运行coverage report -m
。Spackle将输出原始覆盖率报告和一个包含仅多行覆盖率差距的新报告,按缺少的行数排序。
示例
示例用法
coverage run ./manage.py test demo
spackle
示例输出(缩短)
Name Stmts Miss Cover Missing
--------------------------------------------------------------------
demo/querysets.py 63 27 57% 16, 19, 53, 56-57, 64-101
demo/views.py 106 84 21% 18-39, 45-46, 55-92, 103-134, 143-153, 162-185
demo/utils/github.py 48 24 50% 10-49
demo/utils/graphs.py 100 27 73% 41, 63-64, 68-73, 156-196
--------------------------------------------------------------------
TOTAL 317 162 86%
Largest gaps in coverage:
Name Missing Miss
--------------------------------------------------------------------
demo/utils/graphs.py 156-196 40
demo/utils/github.py 10-49 39
demo/querysets.py 64-101 37
demo/views.py 55-92 37
demo/views.py 103-134 31
demo/views.py 162-185 23
demo/views.py 18-39 21
demo/views.py 143-153 10
demo/utils/graphs.py 68-73 5
demo/views.py 45-46 1
demo/utils/graphs.py 63-64 1
demo/querysets.py 56-57 1