Skip to content

Commit

Permalink
Added test case for beeware#900
Browse files Browse the repository at this point in the history
  • Loading branch information
BPYap committed Aug 8, 2018
1 parent 0028447 commit 4a1c95c
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/structures/test_try_catch.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from unittest import expectedFailure

from ..utils import TranspileTestCase


Expand Down Expand Up @@ -453,6 +455,23 @@ def test_try_multiple_except_mixed3(self):
print('Done.')
""")

@expectedFailure
def test_nested_try_catch_same_error(self):
self.assertCodeExecution("""
try:
try:
raise TypeError
except TypeError as e:
print("handled by first except")
try:
raise TypeError
except TypeError as e:
print("handled by second except")
except TypeError as e:
print("handled by outer except")
""")

def test_try_catch_in_loop(self):
self.assertCodeExecution("""
for x in range(2):
Expand Down

0 comments on commit 4a1c95c

Please sign in to comment.