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
commit964019e5df2943b69c4bb503269af2af4a9d1916 (patch)
tree184ac39fb725ec5bd3496f49adb5628a0c41c8fd
parent19c064d168ed83c9f8e4d1f550851833a9d8f86d (diff)
downloadpython-coveragepy-964019e5df2943b69c4bb503269af2af4a9d1916.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 a802590..55653d5 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