diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2018-01-21 12:32:03 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2018-01-21 12:32:03 -0500 |
commit | eaf55bf6d75675220a12b59b348362f2ecaadb9f (patch) | |
tree | 12886e75d8d5879908eff4ebd7a1830e8e631504 /coverage/cmdline.py | |
parent | 60807c8e06b6811f4829b7a871cc6bddbbc004c9 (diff) | |
download | python-coveragepy-eaf55bf6d75675220a12b59b348362f2ecaadb9f.tar.gz |
fail_under can now be a float. #631.
Diffstat (limited to 'coverage/cmdline.py')
-rw-r--r-- | coverage/cmdline.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/coverage/cmdline.py b/coverage/cmdline.py index 841d8f4..7b86054 100644 --- a/coverage/cmdline.py +++ b/coverage/cmdline.py @@ -51,7 +51,7 @@ class Opts(object): help="Write the output files to DIR.", ) fail_under = optparse.make_option( - '', '--fail-under', action='store', metavar="MIN", type="int", + '', '--fail-under', action='store', metavar="MIN", type="float", help="Exit with a status of 2 if the total coverage is less than MIN.", ) help = optparse.make_option( @@ -528,7 +528,8 @@ class CoverageScript(object): self.coverage.set_option("report:fail_under", options.fail_under) fail_under = self.coverage.get_option("report:fail_under") - if should_fail_under(total, fail_under): + precision = self.coverage.get_option("report:precision") + if should_fail_under(total, fail_under, precision): return FAIL_UNDER return OK |