From 51fcfe980f381cd8527086a3875ea987d27f96aa Mon Sep 17 00:00:00 2001 From: LYK Date: Tue, 7 Mar 2023 04:51:39 +0900 Subject: [PATCH] Mark failing tests of test/test_with.py A TypeError is raised instead of an AttributeError in "with" and "async with" statements for objects which do not support the context manager or asynchronous context manager protocols correspondingly. See also: https://github.com/python/cpython/pull/26809 --- Lib/test/test_with.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Lib/test/test_with.py b/Lib/test/test_with.py index 07522bda6..41f05c2ea 100644 --- a/Lib/test/test_with.py +++ b/Lib/test/test_with.py @@ -109,6 +109,8 @@ class FailureTestCase(unittest.TestCase): with foo: pass self.assertRaises(NameError, fooNotDeclared) + # TODO: RUSTPYTHON + @unittest.expectedFailure def testEnterAttributeError1(self): class LacksEnter(object): def __exit__(self, type, value, traceback): @@ -119,6 +121,8 @@ class FailureTestCase(unittest.TestCase): with foo: pass self.assertRaisesRegex(TypeError, 'the context manager', fooLacksEnter) + # TODO: RUSTPYTHON + @unittest.expectedFailure def testEnterAttributeError2(self): class LacksEnterAndExit(object): pass @@ -128,6 +132,8 @@ class FailureTestCase(unittest.TestCase): with foo: pass self.assertRaisesRegex(TypeError, 'the context manager', fooLacksEnterAndExit) + # TODO: RUSTPYTHON + @unittest.expectedFailure def testExitAttributeError(self): class LacksExit(object): def __enter__(self):