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
This commit is contained in:
LYK committed 2023-03-07 05:02:10 +09:00
1 parent e983506e23
commit 51fcfe980f
1 file changed
+6
+6
View File
@@ -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):