diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2009-11-30 21:35:27 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-11-30 21:35:27 -0500 |
commit | 9d2b8a09154727bee8c2296ea5852574c22a16cb (patch) | |
tree | 1a43543ed896e037776a218456ec421125547121 /test/farm/html/src | |
parent | 62cd957d5ff36fa745affac27d23be7d7928b40b (diff) | |
download | python-coveragepy-git-9d2b8a09154727bee8c2296ea5852574c22a16cb.tar.gz |
A little explanation of the partial branch annotations in the HTML report.
Diffstat (limited to 'test/farm/html/src')
-rw-r--r-- | test/farm/html/src/b.py | 14 |
1 files changed, 13 insertions, 1 deletions
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() |