Created
October 11, 2020 02:59
-
-
Save JosXa/3f4bc07260f76498cf58b6025e488d40 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from contextlib import asynccontextmanager | |
from typing import AsyncGenerator | |
import pytest | |
@pytest.mark.asyncio | |
async def test(): | |
async with ctm() as r: | |
print(r) | |
@asynccontextmanager | |
async def ctm() -> AsyncGenerator[None, str]: | |
async with ctm_2() as r: | |
yield r | |
@asynccontextmanager | |
async def ctm_2() -> AsyncGenerator[None, str]: | |
yield "henlo" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment