From d20a77c9cf1bdba8cf003f24681503313253389b Mon Sep 17 00:00:00 2001 From: Ionel Cristian Maries Date: Sun, 28 Jun 2015 22:41:53 +0300 Subject: 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. --- coverage/summary.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'coverage/summary.py') diff --git a/coverage/summary.py b/coverage/summary.py index aed83350..20123ea1 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 -- cgit v1.2.1