mirror of
https://github.com/RustPython/RustPython.git
synced 2026-10-28 10:44:36 +08:00
Update test_contextlib.py to 3.14.4 (#7815)
This commit is contained in:
1 parent
3420ec94c1
commit
1ce29cb763
1 file changed
+5
-6
Vendored
+5
-6
@@ -48,23 +48,23 @@ class TestAbstractContextManager(unittest.TestCase):
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
return None
|
||||
|
||||
self.assertTrue(issubclass(ManagerFromScratch, AbstractContextManager))
|
||||
self.assertIsSubclass(ManagerFromScratch, AbstractContextManager)
|
||||
|
||||
class DefaultEnter(AbstractContextManager):
|
||||
def __exit__(self, *args):
|
||||
super().__exit__(*args)
|
||||
|
||||
self.assertTrue(issubclass(DefaultEnter, AbstractContextManager))
|
||||
self.assertIsSubclass(DefaultEnter, AbstractContextManager)
|
||||
|
||||
class NoEnter(ManagerFromScratch):
|
||||
__enter__ = None
|
||||
|
||||
self.assertFalse(issubclass(NoEnter, AbstractContextManager))
|
||||
self.assertNotIsSubclass(NoEnter, AbstractContextManager)
|
||||
|
||||
class NoExit(ManagerFromScratch):
|
||||
__exit__ = None
|
||||
|
||||
self.assertFalse(issubclass(NoExit, AbstractContextManager))
|
||||
self.assertNotIsSubclass(NoExit, AbstractContextManager)
|
||||
|
||||
|
||||
class ContextManagerTestCase(unittest.TestCase):
|
||||
@@ -1014,8 +1014,7 @@ class TestBaseExitStack:
|
||||
else:
|
||||
self.fail("Expected KeyError, but no exception was raised")
|
||||
|
||||
# TODO: RUSTPYTHON
|
||||
@unittest.expectedFailure
|
||||
@unittest.expectedFailure # TODO: RUSTPYTHON
|
||||
def test_exit_exception_with_correct_context(self):
|
||||
# http://bugs.python.org/issue20317
|
||||
@contextmanager
|
||||
|
||||
Reference in new issue
Block a user