Skip to content

Commit

Permalink
Fix a "coroutine not awaited" warning
Browse files Browse the repository at this point in the history
  • Loading branch information
njsmith committed Jan 19, 2018
1 parent 4b740df commit 7d9357f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions async_generator/_tests/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,18 +157,23 @@ async def switch_it():
raise KeyError


def test_asynccontextmanager_nice_message_on_sync_enter():
async def test_asynccontextmanager_nice_message_on_sync_enter():
@asynccontextmanager
@async_generator
async def xxx(): # pragma: no cover
pass
await yield_()

cm = xxx()

with pytest.raises(RuntimeError) as excinfo:
with xxx():
with cm:
pass # pragma: no cover

assert "async with" in str(excinfo.value)

async with cm:
pass


async def test_asynccontextmanager_no_yield():
@asynccontextmanager
Expand Down

0 comments on commit 7d9357f

Please sign in to comment.