mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-44566: resolve differences between asynccontextmanager and contextmanager (#27024)
This commit is contained in:
parent
85fa3b6b7c
commit
7f1c330da3
4 changed files with 116 additions and 87 deletions
|
@ -209,7 +209,18 @@ class AsyncContextManagerTestCase(unittest.TestCase):
|
|||
async def woohoo():
|
||||
yield
|
||||
|
||||
for stop_exc in (StopIteration('spam'), StopAsyncIteration('ham')):
|
||||
class StopIterationSubclass(StopIteration):
|
||||
pass
|
||||
|
||||
class StopAsyncIterationSubclass(StopAsyncIteration):
|
||||
pass
|
||||
|
||||
for stop_exc in (
|
||||
StopIteration('spam'),
|
||||
StopAsyncIteration('ham'),
|
||||
StopIterationSubclass('spam'),
|
||||
StopAsyncIterationSubclass('spam')
|
||||
):
|
||||
with self.subTest(type=type(stop_exc)):
|
||||
try:
|
||||
async with woohoo():
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue