summaryrefslogtreecommitdiff
path: root/coverage/control.py
diff options
context:
space:
mode:
authorstepeos <82703776+stepeos@users.noreply.github.com>2022-11-05 17:29:04 +0100
committerGitHub <noreply@github.com>2022-11-05 09:29:04 -0700
commitcf1efa814e905ab1e2bc17795b1dbe6d437b39e5 (patch)
treee7f236575db700b37b595669bd8dbe803b1b53d4 /coverage/control.py
parent27fd4a9b8999dba408d1bc5a5df675d7caaa85b8 (diff)
downloadpython-coveragepy-git-cf1efa814e905ab1e2bc17795b1dbe6d437b39e5.tar.gz
feat: report terminal output in Markdown Table format #1418 (#1479)
* refactoring normal reporting text output * implemented markdown feature from #1418 * minor changes * fixed text output * fixed precision for text and markdown report format * minor changes * finished testing for markdown format feature * fixed testing outside test_summary.py * removed fixed-length widespace padding for tests * removed whitespaces * refactoring, fixing docs, rewriting cmd args * fixing code quality * implementing requested changes * doc fix * test: add another test of correct report formatting * fixed precision printing test * style: adjust the formatting Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Diffstat (limited to 'coverage/control.py')
-rw-r--r--coverage/control.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/coverage/control.py b/coverage/control.py
index 91e604e0..a8cf1649 100644
--- a/coverage/control.py
+++ b/coverage/control.py
@@ -908,7 +908,8 @@ class Coverage:
def report(
self, morfs=None, show_missing=None, ignore_errors=None,
file=None, omit=None, include=None, skip_covered=None,
- contexts=None, skip_empty=None, precision=None, sort=None
+ contexts=None, skip_empty=None, precision=None, sort=None,
+ output_format=None,
):
"""Write a textual summary report to `file`.
@@ -922,6 +923,9 @@ class Coverage:
`file` is a file-like object, suitable for writing.
+ `output_format` provides options, to print eitehr as plain text, or as
+ markdown code
+
`include` is a list of file name patterns. Files that match will be
included in the report. Files matching `omit` will not be included in
the report.
@@ -953,13 +957,16 @@ class Coverage:
.. versionadded:: 5.2
The `precision` parameter.
+ .. versionadded:: 6.6
+ The `format` parameter.
+
"""
with override_config(
self,
ignore_errors=ignore_errors, report_omit=omit, report_include=include,
show_missing=show_missing, skip_covered=skip_covered,
report_contexts=contexts, skip_empty=skip_empty, precision=precision,
- sort=sort
+ sort=sort, output_format=output_format,
):
reporter = SummaryReporter(self)
return reporter.report(morfs, outfile=file)