diff options
| author | Ned Batchelder <ned@nedbatchelder.com> | 2009-11-28 07:38:09 -0500 |
|---|---|---|
| committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-11-28 07:38:09 -0500 |
| commit | 3aa383a9bbe39ef408cabc4a134aab22bfd6bc35 (patch) | |
| tree | 66a695904320bd29015c7254cdc67b5b691ec9fa /doc/branch.rst | |
| parent | 43a86c0668ec0e314f1b828aee2dd3862151053a (diff) | |
| download | python-coveragepy-3aa383a9bbe39ef408cabc4a134aab22bfd6bc35.tar.gz | |
Doc tweaking.
Diffstat (limited to 'doc/branch.rst')
| -rw-r--r-- | doc/branch.rst | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/doc/branch.rst b/doc/branch.rst index 28e8c77..087334b 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 -------- |
