summaryrefslogtreecommitdiff
path: root/test/test_arcs.py
diff options
context:
space:
mode:
authorBen Finney <ben@benfinney.id.au>2011-07-27 13:08:39 +1000
committerBen Finney <ben@benfinney.id.au>2011-07-27 13:08:39 +1000
commitd9318b840bec37c116d5ef95ac1a618149f625da (patch)
tree305c374ca027499889a059f1809beb60dabdbdd6 /test/test_arcs.py
parentca7a10dff148fdb68f577f09e1f572f8350491b3 (diff)
parent0f1b0d30e306ad35b1e29912e0613e9bf2618c47 (diff)
downloadpython-coveragepy-d9318b840bec37c116d5ef95ac1a618149f625da.tar.gz
Refactor handling of static report files to a separate function.
Diffstat (limited to 'test/test_arcs.py')
-rw-r--r--test/test_arcs.py19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/test_arcs.py b/test/test_arcs.py
index 0c16929..2c98317 100644
--- a/test/test_arcs.py
+++ b/test/test_arcs.py
@@ -213,12 +213,12 @@ class LoopArcTest(CoverageTest):
i += 1
assert a == 4 and i == 3
""",
- arcz=".1 12 23 27 34 45 36 63 57 7.",
+ arcz=".1 12 23 34 45 36 63 57 7.",
)
# With "while True", 2.x thinks it's computation, 3.x thinks it's
# constant.
if sys.version_info >= (3, 0):
- arcz = ".1 12 23 27 34 45 36 63 57 7."
+ arcz = ".1 12 23 34 45 36 63 57 7."
else:
arcz = ".1 12 23 27 34 45 36 62 57 7."
self.check_coverage("""\
@@ -260,6 +260,21 @@ class LoopArcTest(CoverageTest):
arcz_missing="26 6."
)
+ def test_for_else(self):
+ self.check_coverage("""\
+ def forelse(seq):
+ for n in seq:
+ if n > 5:
+ break
+ else:
+ print('None of the values were greater than 5')
+ print('Done')
+ forelse([1,2])
+ forelse([1,6])
+ """,
+ arcz=".1 .2 23 32 34 47 26 67 7. 18 89 9."
+ )
+
class ExceptionArcTest(CoverageTest):
"""Arc-measuring tests involving exception handling."""