diff options
author | Teake Nutma <t.a.nutma@rug.nl> | 2020-04-30 17:47:38 +0200 |
---|---|---|
committer | Teake Nutma <t.a.nutma@rug.nl> | 2020-04-30 17:47:38 +0200 |
commit | bbd0c0fe16e0fa02b9023b3703fd0c91ca2cf855 (patch) | |
tree | b75341b6757c2a3924efa8f3535a81a7c4c744ca /coverage/cmdline.py | |
parent | 444e596a93de3e1864f92b0e7d532d0131bab56f (diff) | |
download | python-coveragepy-git-bbd0c0fe16e0fa02b9023b3703fd0c91ca2cf855.tar.gz |
Add --precision switch to report command
Diffstat (limited to 'coverage/cmdline.py')
-rw-r--r-- | coverage/cmdline.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py index 9fddb6bb..db604dbd 100644 --- a/coverage/cmdline.py +++ b/coverage/cmdline.py @@ -146,6 +146,13 @@ class Opts(object): "to be run as 'python -m' would run it." ), ) + precision = optparse.make_option( + '', '--precision', action='store', metavar='N', type=int, + help=( + "Number of digits after the decimal point to display for " + "reported coverage percentages." + ), + ) rcfile = optparse.make_option( '', '--rcfile', action='store', help=( @@ -203,6 +210,7 @@ class CoverageOptionParser(optparse.OptionParser, object): omit=None, contexts=None, parallel_mode=None, + precision=None, pylib=None, rcfile=True, show_missing=None, @@ -395,6 +403,7 @@ CMDS = { Opts.ignore_errors, Opts.include, Opts.omit, + Opts.precision, Opts.show_missing, Opts.skip_covered, Opts.skip_empty, @@ -569,6 +578,7 @@ class CoverageScript(object): omit=omit, include=include, contexts=contexts, + precision=options.precision, ) # We need to be able to import from the current directory, because |