Update test/test_with.py from CPython 3.11.2 by dalinaum · Pull Request #4648 · RustPython/RustPython
# TODO: RUSTPYTHON @unittest.expectedFailure def testEnterAttributeError1(self): class LacksEnter(object): def __exit__(self, type, value, traceback):
# TODO: RUSTPYTHON @unittest.expectedFailure def testEnterAttributeError2(self): class LacksEnterAndExit(object): pass
def fooLacksEnterAndExit(): foo = LacksEnterAndExit() with foo: pass self.assertRaisesRegex(AttributeError, '__enter__', fooLacksEnterAndExit) self.assertRaisesRegex(TypeError, 'the context manager', fooLacksEnterAndExit)
# TODO: RUSTPYTHON @unittest.expectedFailure def testExitAttributeError(self): class LacksExit(object): def __enter__(self):
def assertRaisesSyntaxError(self, codestr): def shouldRaiseSyntaxError(s):