summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-12-21 15:07:36 -0500
committerNed Batchelder <ned@nedbatchelder.com>2009-12-21 15:07:36 -0500
commit7d8aeab9df3ac0b888a090c82b2b90871dae4b58 (patch)
treef3c9053d9d15d8cc68a626d94283f6ef7fa68b32
parentfb391e6f1d66a65152e476d60109f5c753889c0a (diff)
downloadpython-coveragepy-git-7d8aeab9df3ac0b888a090c82b2b90871dae4b58.tar.gz
Clarify the behavior of check_coverage.
-rw-r--r--test/coveragetest.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/coveragetest.py b/test/coveragetest.py
index a8025902..55653d53 100644
--- a/test/coveragetest.py
+++ b/test/coveragetest.py
@@ -174,9 +174,10 @@ class CoverageTest(TestCase):
"""Check the coverage measurement of `text`.
The source `text` is run and measured. `lines` are the line numbers
- that are executable, `missing` are the lines not executed, `excludes`
- are regexes to match against for excluding lines, and `report` is
- the text of the measurement report.
+ that are executable, or a list of possible line numbers, any of which
+ could match. `missing` are the lines not executed, `excludes` are
+ regexes to match against for excluding lines, and `report` is the text
+ of the measurement report.
For arc measurement, `arcz` is a string that can be decoded into arcs
in the code (see `arcz_to_arcs` for the encoding scheme),
@@ -218,8 +219,12 @@ class CoverageTest(TestCase):
analysis = cov._analyze(mod)
if lines is not None:
if type(lines[0]) == type(1):
+ # lines is just a list of numbers, it must match the statements
+ # found in the code.
self.assertEqual(analysis.statements, lines)
else:
+ # lines is a list of possible line number lists, one of them
+ # must match.
for line_list in lines:
if analysis.statements == line_list:
break