Why does Coverage.py ignore files with no coverage?

爷,独闯天下 提交于 2020-06-27 11:18:10

问题


I first run

nosetests --with-coverage

So I should have a .coverage file with all the default settings.

Within folder_1, I have file_1.py, file_2.py, and file_3.py

When I cd into folder_1 and run

coverage report

It outputs:

It doesn't generate anything for file_3.py! But then when I run:

coverage report file_3.py

it says:

Does it skip files with no coverage in the report? How can I change it so the report shows me the results of every *.py file?


回答1:


You need to specify a source directory for coverage.py to find files that have never been executed at all. You can use --source=folder_1 on the command line, or [run] source=folder_1 in your .coveragerc file.



来源:https://stackoverflow.com/questions/43077589/why-does-coverage-py-ignore-files-with-no-coverage

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