summaryrefslogtreecommitdiff
path: root/doc/branch.rst
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-11-28 07:38:09 -0500
committerNed Batchelder <ned@nedbatchelder.com>2009-11-28 07:38:09 -0500
commitf80837ae0385019de7b9a3d50a286a5fce0dfb46 (patch)
tree1be804a75a7ce8a83371141d25b03cc43da68856 /doc/branch.rst
parentb2cf3b8d1f1908c3d9732387346f038f84cc6ca0 (diff)
downloadpython-coveragepy-git-f80837ae0385019de7b9a3d50a286a5fce0dfb46.tar.gz
Doc tweaking.
Diffstat (limited to 'doc/branch.rst')
-rw-r--r--doc/branch.rst16
1 files changed, 15 insertions, 1 deletions
diff --git a/doc/branch.rst b/doc/branch.rst
index 28e8c778..087334ba 100644
--- a/doc/branch.rst
+++ b/doc/branch.rst
@@ -66,7 +66,21 @@ Thanks, Titus!
Excluding code
--------------
-If you have excluded
+If you have :ref:`excluded code <excluding>`, a condtional will not be
+counted as a branch if one of its choices is excluded::
+
+ def only_one_choice(x):
+ if x:
+ blah1()
+ blah2()
+ else: # pragma: no cover
+ # x is always true.
+ blah3()
+
+Because the ``else`` clause is excluded, the ``if`` only has one possible
+next line, so it isn't considered a branch at all.
+
+
Problems
--------