How do I interpret Python coverage.py branch coverage results?

后端 未结 1 1597
滥情空心
滥情空心 2021-01-17 16:18

I\'m using coverage.py to measure the code coverage of my tests. I\'ve enabled branch coverage, but I can\'t quite make sense of the report.

Without bra

1条回答
  •  北海茫月
    2021-01-17 16:41

    Dan's comment is close. First, the negative numbers mean, an exit from a function starting at that line number. So -48 means, exit from the function starting at line 48.

    The issue isn't empty loops: those branches would have happened if the loops ever completed. It looks like perhaps they did not.

    BTW: Coverage.py 4.1b3 has changed some of this behavior: they'd be marked as 53->exit, 59->exit. Also, the branches themselves might be identified differently. Give it a try.

    0 讨论(0)
提交回复
热议问题