Skip to content

Commit

Permalink
Add test for the new AsyncGenerator support. Close #2379
Browse files Browse the repository at this point in the history
  • Loading branch information
PCManticore committed Aug 16, 2018
1 parent 242c4c9 commit 4297cf5
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pylint/test/functional/iterable_context_py36.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# pylint: disable=missing-docstring,too-few-public-methods,unused-variable

import asyncio

class AIter:
async def __aiter__(self):
Expand All @@ -13,3 +13,16 @@ async def to_list(self):
yield value
async for value in self:
yield value


async def some_iter_func(number):
""" emits 1 number per second """
for i in range(1, number):
yield i
await asyncio.sleep(1)


async def count_to(number):
""" counts to n in async manner"""
async for i in some_iter_func(number):
print(i)

0 comments on commit 4297cf5

Please sign in to comment.