Ticket #5859 (closed defect: fixed)

Opened 4 years ago

Last modified 13 months ago

sage -coverageall fails on directories with zero tests

Reported by: mabshoff Owned by: mabshoff
Priority: major Milestone: sage-5.0
Component: doctest coverage Keywords:
Cc: mjo Work issues:
Report Upstream: N/A Reviewers: André Apitzsch
Authors: Michael Orlitzky Merged in: sage-5.0.rc0
Dependencies: Stopgaps:

Description

./sage -coverageall devel/sage/sage/catalogue/

results in

Traceback (most recent call last):
  File "/scratch/mabshoff/sage-3.4.2.alpha0/local/bin/sage-coverageall", line 44, in <module>
    coverage_all(sys.argv[1])
  File "/scratch/mabshoff/sage-3.4.2.alpha0/local/bin/sage-coverageall", line 28, in coverage_all
    score = (float(scr) / total)
ZeroDivisionError: float division

Attachments

sage-trac_5859.patch Download (696 bytes) - added by mjo 17 months ago.
Default to 100% coverage when there are no tests.

Change History

Changed 17 months ago by mjo

Default to 100% coverage when there are no tests.

comment:1 Changed 17 months ago by mjo

  • Cc mjo added
  • Status changed from new to needs_review
  • Report Upstream set to N/A
  • Authors set to Michael Orlitzky

This was a pretty small fix, so there it is.

The coverage score would naturally be undefined, but saying it's 100% of zero is a useful fiction in this case.

comment:2 Changed 13 months ago by aapitzsch

  • Status changed from needs_review to positive_review
  • Reviewers set to André Apitzsch

comment:3 Changed 13 months ago by jdemeyer

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-5.0.rc0
Note: See TracTickets for help on using tickets.