nose-devs / nose

nose is nicer testing for python
http://readthedocs.org/docs/nose/en/latest/
1.36k stars 395 forks source link

cover plugin fails to accurately report coverage if modules are never imported #1049

Open thanatos opened 7 years ago

thanatos commented 7 years ago

The cover plugin will omit files that never get imported from the coverage report entirely. Further, when it computes the % of code covered by unit tests, these files are omitted altogether, resulting in a much higher "% covered" than what the actual reality is.

Essentially, this problem exists because the plugin insists on passing a list of modules to html_report(), seen here.

The list of modules is computed here

Simply passing None to the first argument of html_report results in the correct output.

GuillemGSubies commented 5 years ago

I have the same problem and I would not like to import every module in order to have them in the report. Is there any workaround?