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 | e756776c0a9f3c78389bcc93e067ac3ac0f45ad9 (patch) | |
tree | 6175b059058e9c1db47bdb3e4ac9f3488bef6877 /coverage/cmdline.py | |
parent | f6e05b8c9b69ad1b8b847d8e9078d0c99480dac7 (diff) | |
download | python-coveragepy-git-e756776c0a9f3c78389bcc93e067ac3ac0f45ad9.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 841d8f4a..7b86054e 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 |