summaryrefslogtreecommitdiff
path: root/tests/farm/html/src/b.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/farm/html/src/b.py')
-rw-r--r--tests/farm/html/src/b.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/farm/html/src/b.py b/tests/farm/html/src/b.py
new file mode 100644
index 0000000..3bf73a9
--- /dev/null
+++ b/tests/farm/html/src/b.py
@@ -0,0 +1,29 @@
+# A test file for HTML reporting by coverage.
+
+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()