Index: testing_support/coverage_utils.py |
diff --git a/testing_support/coverage_utils.py b/testing_support/coverage_utils.py |
index f049938b98803bf43d4b39d626fa641a3d44eb49..3cd98f5ec240bd56b9e3d2b78e76e12a9a51b845 100644 |
--- a/testing_support/coverage_utils.py |
+++ b/testing_support/coverage_utils.py |
@@ -21,7 +21,7 @@ def native_error(msg, version): |
%s""") % (version, msg) |
sys.exit(1) |
-def covered_main(includes, require_native=None): |
+def covered_main(includes, require_native=None, required_percentage=100.0): |
"""Equivalent of unittest.main(), except that it gathers coverage data, and |
asserts if the test is not at 100% coverage. |
@@ -63,8 +63,8 @@ def covered_main(includes, require_native=None): |
retcode = e.code or retcode |
COVERAGE.stop() |
- if COVERAGE.report() != 100.0: |
- print 'FATAL: not at 100% coverage.' |
+ if COVERAGE.report() < required_percentage: |
+ print 'FATAL: not at required %f% coverage.' % required_percentage |
retcode = 2 |
return retcode |