问题
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