Python nosetests with coverage no longer shows missing lines
In coverage.py 4.1, I fixed a problem with the coverage.py API defaulting two parameters to non-None values. One of them was show_missing
.
The best way to fix this in your project is to set show_missing
in your .coveragerc file:
# .coveragerc[report]show_missing = True
Beside having a configuration files to set show_missing
you can also use coverage set_option
to define it.
cov.set_option('report:show_missing', True)
I have issue with getting the correct coverage for models.py
, i solve it according to this.
Then i just add the above lines to show missing line. So my manage.py
have a part like this:
if is_testing: import coverage cov = coverage.coverage(source=['blog'], omit=['*/tests/*']) cov.set_option('report:show_missing', True) #add this cov.erase() cov.start()