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

Unified Diff: tools/telemetry/third_party/coverage/tests/farm/html/src/b.py

Issue 1366913004: Add coverage Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months 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
Index: tools/telemetry/third_party/coverage/tests/farm/html/src/b.py
diff --git a/tools/telemetry/third_party/coverage/tests/farm/html/src/b.py b/tools/telemetry/third_party/coverage/tests/farm/html/src/b.py
new file mode 100644
index 0000000000000000000000000000000000000000..cb673c2295c3eb29eddd029ff67343f021ddd842
--- /dev/null
+++ b/tools/telemetry/third_party/coverage/tests/farm/html/src/b.py
@@ -0,0 +1,32 @@
+# Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
+# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
+
+# A test file for HTML reporting by coverage.py.
+
+def one(x):
+ # This will be a branch that misses the else.
+ if x < 2:
+ a = 3
+ else:
+ a = 4
+
+one(1)
+
+def two(x):
+ # A missed else that branches to "exit"
+ if x:
+ a = 5
+
+two(1)
+
+def three():
+ try:
+ # This if has two branches, *neither* one taken.
+ if name_error_this_variable_doesnt_exist:
+ a = 1
+ else:
+ a = 2
+ except:
+ pass
+
+three()

Powered by Google App Engine
This is Rietveld 408576698