8000 Updated test_contextlib_async.py by terryluan12 · Pull Request #6686 · RustPython/RustPython · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions Lib/test/test_contextlib_async.py
7440
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,7 @@ async def woohoo():
raise ZeroDivisionError()
self.assertEqual(state, [1, 42, 999])

# TODO: RUSTPYTHON
@unittest.expectedFailure
@unittest.expectedFailure # TODO: RUSTPYTHON
async def test_contextmanager_traceback(self):
@asynccontextmanager
async def f():
Expand Down Expand Up @@ -253,8 +252,7 @@ async def woohoo():
raise ZeroDivisionError(999)
self.assertEqual(state, [1, 42, 999])

# TODO: RUSTPYTHON
@unittest.expectedFailure
@unittest.expectedFailure # TODO: RUSTPYTHON
async def test_contextmanager_except_stopiter(self):
@asynccontextmanager
async def woohoo():
Expand Down Expand Up @@ -535,11 +533,6 @@ def __exit__(self, *exc_details):
('__aexit__', 'cb_suppress = cb(*exc_details)'),
]

# TODO: RUSTPYTHON - no _asyncio module, pure Python Task adds extra frame
@unittest.expectedFailure
def test_exit_exception_traceback(self):
super().test_exit_exception_traceback()

async def test_async_callback(self):
expected = [
((), {}),
Expand Down Expand Up @@ -657,8 +650,7 @@ async def __aenter__(self):
await stack.enter_async_context(LacksExit())
self.assertFalse(stack._exit_callbacks)

# TODO: RUSTPYTHON
@unittest.expectedFailure
@unittest.expectedFailure # TODO: RUSTPYTHON
async def test_async_exit_exception_chaining(self):
# Ensure exception chaining matches the reference behaviour
async def raise_exc(exc):
Expand Down Expand Up @@ -690,8 +682,7 @@ async def suppress_exc(*exc_details):
self.assertIsInstance(inner_exc, ValueError)
self.assertIsInstance(inner_exc.__context__, ZeroDivisionError)

# TODO: RUSTPYTHON
@unittest.expectedFailure
@unittest.expectedFailure # TODO: RUSTPYTHON
async def test_async_exit_exception_explicit_none_context(self):
# Ensure AsyncExitStack chaining matches actual nested `with` statements
# regarding explicit __context__ = None.
Expand Down Expand Up @@ -737,6 +728,10 @@ class Example(object): pass
stack.push_async_exit(cm)
self.assertIs(stack._exit_callbacks[-1][1], cm)

@unittest.expectedFailure # TODO: RUSTPYTHON; - no _asyncio module, pure Python Task adds extra frame
def test_exit_exception_traceback(self):
return super().test_exit_exception_traceback()


class TestAsyncNullcontext(unittest.IsolatedAsyncioTestCase):
async def test_async_nullcontext(self):
Expand Down
Loading
0