Uncaught ZeroDivisionError when generating XML report · Issue #250 · nedbat/coveragepy (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Description
Originally reported by Chris Rebert (Bitbucket: cvrebert, GitHub: cvrebert)
If you ask coverage v3.6 to generate an XML report under a no-meaningful-tests edge case, it crashes:
<nose portion of call stack elided>
File "/var/lib/jenkins/shiningpanda/jobs/f9dc77ce/virtualenvs/d41d8cd9/lib/python2.7/site-packages/coverage/control.py", line 647, in xml_report
return reporter.report(morfs, outfile=outfile)
File "/var/lib/jenkins/shiningpanda/jobs/f9dc77ce/virtualenvs/d41d8cd9/lib/python2.7/site-packages/coverage/xmlreport.py", line 88, in report
return 100.0 * (lhits_tot + bhits_tot) / (lnum_tot + bnum_tot)
ZeroDivisionError: float division by zero