void () { doTestByText( """ class C(object): def __enter__(self): return self def __exit__(self, exc, value, traceback): return undefined def g1(): raise Exception() def f1(): with C(): if undefined: return g1() x = 2 print(x) #pass def f2(): with C(): if undefined: g1() x = 2 print(x) #pass import contextlib from unittest import TestCase def f1(): with contextlib.suppress(Exception): if undefined: return g1() x = 2 print(x) #pass class A(TestCase): def f2(self): with self.assertRaises(Exception): if undefined: g1() x = 2 print(x) #pass""" ); }