summaryrefslogtreecommitdiff
path: root/coverage/summary.py
diff options
context:
space:
mode:
authorIonel Cristian Maries <contact@ionelmc.ro>2015-06-28 22:41:53 +0300
committerIonel Cristian Maries <contact@ionelmc.ro>2015-06-28 22:41:53 +0300
commitc6dfb5b69d8211fc25aca06dc2c97e492d9b334c (patch)
tree0a30b8c347dc1994eae1a43a9f7cc3029b42312e /coverage/summary.py
parent19200e548f72609d1fb7637ffdd45f1dacf5c5e8 (diff)
downloadpython-coveragepy-c6dfb5b69d8211fc25aca06dc2c97e492d9b334c.tar.gz
Make return codes consistent: 1 for no data and 2 for fail_under. Now the `report` command will properly report `No data to report` if there's no data.
Diffstat (limited to 'coverage/summary.py')
-rw-r--r--coverage/summary.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/coverage/summary.py b/coverage/summary.py
index aed8335..20123ea 100644
--- a/coverage/summary.py
+++ b/coverage/summary.py
@@ -98,5 +98,6 @@ class SummaryReporter(Reporter):
if self.config.show_missing:
args += ("",)
outfile.write(fmt_coverage % args)
-
+ if not total.n_files:
+ raise CoverageException("No data to report.")
return total.n_statements and total.pc_covered