如何访问coverage.py生成的覆盖率数据库并获取所有已执行语句的列表?
覆盖范围报告仅显示了该百分比,我想知道所有执行的陈述。
最终,我需要一个映射,其中密钥是语句,并且值为真(执行)/false(未执行)。
有什么办法做到这一点吗?
The coverage report only shows the percentage, and I would like to know all executed statements.
Eventually, I need a map in which the key is the statement and the value is True(Executed)/False(Not Executed).
Is there any way to do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用HTML报告查看执行哪些语句而不是执行。您可以通过覆盖范围数据API访问数据:
You can use the HTML report to see what statements are executed and not. You can access the data through the Coverage Data API: https://coverage.readthedocs.io/en/6.3.2/api_coveragedata.html
What will you be doing with the executed/not-executed data?