Is it possible exclude test directories from coverage.py reports?

走远了吗. 提交于 2019-12-03 00:56:18

coverage html --omit="*/test*" -d tests/coverage

Cynthia Simiyu

Create .coveragerc file in your project root folder, and include the following:

[run]
omit = *tests*

You can also explicitly specify which directory has the code you want coverage on instead of saying which things to omit. In a .coveragerc file, if the directory of interest is called demo, this looks like

[run]
source = demo
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!