mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-29 11:14:38 +08:00
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:
1 parent
e983506e23
commit
51fcfe980f
1 file changed
+6
Vendored
+6
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user