summaryrefslogtreecommitdiff
path: root/tests/test_arcs.py
diff options
context:
space:
mode:
authorNed Batchelder <nedbat@gmail.com>2016-12-18 21:31:51 -0500
committerNed Batchelder <nedbat@gmail.com>2016-12-18 21:31:51 -0500
commit7c24b8bbfbfeb0d15d48157f70de7138d6e7c9da (patch)
treece60b053a45d127e115480527c6a862b2b56c1b9 /tests/test_arcs.py
parent169075b32881c485bf464787ada86d1ed420a62d (diff)
parentb8eaf57399f82872cb7b371bc5b8ff2e9679a9ba (diff)
downloadpython-coveragepy-git-7c24b8bbfbfeb0d15d48157f70de7138d6e7c9da.tar.gz
Merged in dachary/coverage.py/issue-493-2 (pull request #108)
finally happens before return in a try #493
Diffstat (limited to 'tests/test_arcs.py')
-rw-r--r--tests/test_arcs.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test_arcs.py b/tests/test_arcs.py
index b03ac533..a245e214 100644
--- a/tests/test_arcs.py
+++ b/tests/test_arcs.py
@@ -774,6 +774,24 @@ class ExceptionArcTest(CoverageTest):
arcz=".1 12 28 89 9. -23 34 46 6-2",
)
+ def test_return_finally_before_return(self):
+ self.check_coverage("""\
+ a = []
+ def check_token(data):
+ if data:
+ try:
+ return 1
+ finally:
+ a.append(1)
+ return 2
+ assert 2 == check_token(False)
+ assert [] == a
+ assert 1 == check_token(True)
+ assert [1] == a
+ """,
+ arcz=".1 12 29 9A AB BC C-1 -23 34 45 57 7-2 38 8-2",
+ )
+
def test_except_jump_finally(self):
self.check_coverage("""\
def func(x):