如何访问coverage.py生成的覆盖率数据库并获取所有已执行语句的列表?

发布于 2025-01-20 11:22:13 字数 102 浏览 4 评论 0原文

覆盖范围报告仅显示了该百分比,我想知道所有执行的陈述。

最终,我需要一个映射,其中密钥是语句,并且值为真(执行)/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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

缺⑴份安定 2025-01-27 11:22:13

您可以使用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?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文