Skip to content
This repository has been archived by the owner on May 31, 2020. It is now read-only.

Commit

Permalink
Merge pull request #901 from BPYap/exception-scoping-bug
Browse files Browse the repository at this point in the history
Added test case for #900
  • Loading branch information
freakboy3742 authored Aug 11, 2018
2 parents 2262a71 + 4a1c95c commit f7e6979
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 f7e6979

Please sign in to comment.