summaryrefslogtreecommitdiff
path: root/coverage/summary.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2022-11-06 13:28:32 -0500
committerNed Batchelder <ned@nedbatchelder.com>2022-11-06 13:33:53 -0500
commitfaaf0d45abcf0a11c9e5db144c5b79f581dd92eb (patch)
tree9728e543c6789b19bcdf4e5f0dfbf10b2f9ceb2d /coverage/summary.py
parent8389674d5d0f15dcb84896439f74ada0bc2150da (diff)
downloadpython-coveragepy-git-faaf0d45abcf0a11c9e5db144c5b79f581dd92eb.tar.gz
fix: only accept known values for --format
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 fe73c678..24aa30f2 100644
--- a/coverage/summary.py
+++ b/coverage/summary.py
@@ -20,11 +20,12 @@ class SummaryReporter:
self.branches = coverage.get_data().has_arcs()
self.outfile = None
self.output_format = self.config.format or "text"
+ if self.output_format not in {"text", "markdown", "total"}:
+ raise ConfigError(f"Unknown report format choice: {self.output_format!r}")
self.fr_analysis = []
self.skipped_count = 0
self.empty_count = 0
self.total = Numbers(precision=self.config.precision)
- self.fmt_err = "%s %s: %s"
def write(self, line):
"""Write a line to the output, adding a newline."""