Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(400)

Unified Diff: testing_support/coverage_utils.py

Issue 2471133006: Disable coverage in depot_tools tests. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing_support/coverage_utils.py
diff --git a/testing_support/coverage_utils.py b/testing_support/coverage_utils.py
index 8b912307c3a3e7e73c158c16c1414ca9cc5ecc99..b08c883413e91df3b2e2cb048fbb82e041f6d8ec 100644
--- a/testing_support/coverage_utils.py
+++ b/testing_support/coverage_utils.py
@@ -21,7 +21,8 @@ def native_error(msg, version):
%s""") % (version, msg)
sys.exit(1)
-def covered_main(includes, require_native=None, required_percentage=100.0):
+def covered_main(includes, require_native=None, required_percentage=100.0,
+ disable_coverage=True):
"""Equivalent of unittest.main(), except that it gathers coverage data, and
asserts if the test is not at 100% coverage.
@@ -31,7 +32,13 @@ def covered_main(includes, require_native=None, required_percentage=100.0):
require_native (str) - If non-None, will require that
at least |require_native| version of coverage is installed on the
system with CTracer.
+ disable_coverage (bool) - If True, just run unittest.main() without any
+ coverage tracking. Bug: crbug.com/662277
"""
+ if disable_coverage:
+ unittest.main()
+ return
+
try:
import coverage
if require_native is not None:
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698