From 9d2b8a09154727bee8c2296ea5852574c22a16cb Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 30 Nov 2009 21:35:27 -0500 Subject: A little explanation of the partial branch annotations in the HTML report. --- test/farm/html/src/b.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'test/farm/html/src/b.py') diff --git a/test/farm/html/src/b.py b/test/farm/html/src/b.py index e8752300..f5d051c6 100644 --- a/test/farm/html/src/b.py +++ b/test/farm/html/src/b.py @@ -1,8 +1,8 @@ # A test file for HTML reporting by coverage. def one(x): + # This will be a branch that misses the else. if x < 2: - # Needed a < to look at HTML entities. a = 3 else: a = 4 @@ -10,7 +10,19 @@ def one(x): one(1) def two(x): + # A missed else that branches to "exit" if x: a = 5 two(1) + +def three_way(): + # for-else can be a three-way branch. + for i in range(10): + if i == 3: + break + else: + return 23 + return 17 + +three_way() -- cgit v1.2.1