summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2016-01-02 16:14:35 -0500
committerNed Batchelder <ned@nedbatchelder.com>2016-01-02 16:14:35 -0500
commit255afeb3314da3ad388ac7a3330dd3f94eae0d99 (patch)
treec956ed49d788f8ea541cb1d0e63b724c0c6a548e /tests
parent9c5e1a70c52da251e357d05218213c750c1e9a8d (diff)
downloadpython-coveragepy-255afeb3314da3ad388ac7a3330dd3f94eae0d99.tar.gz
Support returning through a finally
Diffstat (limited to 'tests')
-rw-r--r--tests/test_arcs.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_arcs.py b/tests/test_arcs.py
index cd3aaff..8844204 100644
--- a/tests/test_arcs.py
+++ b/tests/test_arcs.py
@@ -682,6 +682,21 @@ class ExceptionArcTest(CoverageTest):
arcz_unpredicted="45 AB",
)
+ def test_return_finally(self):
+ self.check_coverage("""\
+ a = [1]
+ def func():
+ try:
+ return 10
+ finally:
+ a.append(6)
+
+ assert func() == 10
+ assert a == [1, 6]
+ """,
+ arcz=".1 12 28 89 9. .3 34 46 6-2",
+ )
+
class YieldTest(CoverageTest):
"""Arc tests for generators."""