diff --git a/tests/structures/test_try_catch.py b/tests/structures/test_try_catch.py index 42464d02e0..655b5ac35c 100644 --- a/tests/structures/test_try_catch.py +++ b/tests/structures/test_try_catch.py @@ -1,3 +1,5 @@ +from unittest import expectedFailure + from ..utils import TranspileTestCase @@ -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):