【发布时间】:2015-02-04 16:15:14
【问题描述】:
我正在测量一个小型 Python 应用程序的代码覆盖率。
虽然线路覆盖率是 100%,但分支覆盖率不是。问题是coverage 不会给我任何关于没有被覆盖的分支位置的指示。
coverage run
--branch
--omit=/usr/lib/python3/dist-packages/*,tests/*
-m unittest discover
返回:
Ran 33 tests in 0.079s
OK
Name Stmts Miss Branch BrMiss Cover Missing
-------------------------------------------------------------
app/__init__ 1 0 0 0 100%
app/file_finder 93 0 40 0 100%
app/zipper 66 0 46 7 94%
-------------------------------------------------------------
TOTAL 160 0 86 7 97%
我希望Missing 列包含对应于七个错过分支的行,但那里什么都没有。
我应该如何找到它们?
【问题讨论】:
标签: python python-3.x code-coverage coverage.py