File: _test_py36.py

package info (click to toggle)
python-makefun 1.15.4-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 440 kB
  • sloc: python: 2,384; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 408 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
def make_async_generator():
    """Returns a new async generator function to use in tests."""

    async def f(v):
        yield v

    return f


def make_async_generator_wrapper(async_gen_f):
    """Returns a new async generator function wrapping `f`, to use in tests."""

    async def wrapper(*args, **kwargs):
        async for v in async_gen_f(*args, **kwargs):
            yield v

    return wrapper