blob: c1ca26976d0df3086d29f0e95e45cbc1c4b3f9e1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
# pylint: disable=missing-docstring
from contextlib import asynccontextmanager
@asynccontextmanager
async def context_manager(value):
yield value
async with context_manager(42) as ans:
assert ans == 42
def async_context_manager():
@asynccontextmanager
async def wrapper():
pass
return wrapper
async def func():
async with async_context_manager():
pass
|