我正在使用覆盖插件(pytest --cov
)运行 pytest,在报告中我得到以下行:
Name Stmts Miss Branch BrPart Cover Missing
---------------------------------------------------------
foo.py 5 1 2 1 71% 3->5, 5
我知道这3-5
意味着它错过了第 3 到第 5 行,但我不知道是什么->
意思。从测试逻辑来看,我希望只会5
被报告。作为参考,这是我使用的代码:
# foo.py
class Test:
def __lt__(self, other):
if type(self) == type(other):
return False
return NotImplemented
# test_foo.py
def test_lt():
test = Test()
assert not (test < test)