从覆盖率报告中忽略空文件 [英] Ignoring empty files from coverage report

查看:73
本文介绍了从覆盖率报告中忽略空文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

coverage.py将在其报告中包含 init .py并显示为0行,但覆盖率达到100%。

coverage.py will include init.py in its report and show it as 0 lines, but with 100% coverage.

I想要从覆盖率报告中排除所有空白文件。我不能只是将 * / __ init __。py 添加到省略作为我的 __ init__ .py 文件包含代码。

I want to exclude all blank files from coverage report. I can't just add */__init__.py to omit as some of my __init__.py files have code.

推荐答案

coverage.py中不存在此功能。

This feature doesn't exist in coverage.py. Does it help that you can sort the HTML report to move 100% files to the bottom, or files with 0 statements to the bottom?

更新:从coverage.py开始,是否可以对HTML报告进行排序以将100%的文件移至底部,或将0语句的文件移至底部? 4.0中,-skip-covered 选项可用于完全执行请求的操作。

UPDATE: As of coverage.py 4.0, the --skip-covered option is available to do exactly what is requested.

这篇关于从覆盖率报告中忽略空文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆