diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-02-06 03:20:56 +0200 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2014-02-06 03:20:56 +0200 |
commit | 3c95ba7e4eda0762d735503b718119e361eb7295 (patch) | |
tree | 284153247cc9daa5b7437f0a372faa27a705b996 /tests | |
parent | e09ffa1400cf4a9283041833fc56b848a87a4c6c (diff) | |
download | micropython-3c95ba7e4eda0762d735503b718119e361eb7295.tar.gz micropython-3c95ba7e4eda0762d735503b718119e361eb7295.zip |
Add additional testcase for finally/return.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/basics/try-finally-return.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/basics/try-finally-return.py b/tests/basics/try-finally-return.py index 053fd4b134..4adf3f0977 100644 --- a/tests/basics/try-finally-return.py +++ b/tests/basics/try-finally-return.py @@ -5,3 +5,19 @@ def func1(): print("finally 1") print(func1()) + + +def func2(): + try: + return "it worked" + finally: + print("finally 2") + +def func3(): + try: + s = func2() + return s + ", did this work?" + finally: + print("finally 3") + +print(func3()) |