HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.10/test/__pycache__/test_coroutines.cpython-310.opt-2.pyc
o

�i*��@sNddlZddlZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZddlm
Z
ddlmZGdd�d�ZGdd	�d	�Zd
d�Zdd
�Zejdd��ZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�dej�Ze
jGdd�dej��Zedkr�e� �dSdS)�N)�support)�
import_helper)�warnings_helper��assert_python_okc@�eZdZdd�Zdd�ZdS)�AsyncYieldFromcC�
||_dS�N��obj)�selfr�r�1/usr/local/lib/python3.10/test/test_coroutines.py�__init__�
zAsyncYieldFrom.__init__ccs�|jEdHdSr
r�r
rrr�	__await__��zAsyncYieldFrom.__await__N��__name__�
__module__�__qualname__rrrrrrr�rc@r)�
AsyncYieldcCr	r
��value)r
rrrrrrzAsyncYield.__init__ccs�|jVdSr
rrrrrr��zAsyncYield.__await__Nrrrrrrrrc
Cs`g}d}	z
|�|�d��Wnty.}z|jr|jdnd}WYd}~||fSd}~wwq)NTr)�append�send�
StopIteration�args)�coro�buffer�result�exrrr�	run_async s
���r&c
Cs�|��}g}d}d}	z|dr|�t|��n|�|�d��|d7}WntyD}z|jr5|jdnd}WYd}~||fSd}~wwq)NrT��)rr�nextrr r!)r"�awr#r$�ir%rrr�run_async__await__.s"
���r,ccsH�t���t�d�dVt��Wd�dS1swYdS)N�ignore)�warnings�catch_warnings�simplefilterr�
gc_collectrrrr�silence_coro_gcAs�


"�r2c@�,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�AsyncBadSyntaxTestc
C�xgd�}|D]3}|j|d��#|�t��t|dd�Wd�n1s%wYWd�n1s4wYqdS)N);z9def foo():
                await something()
            zawait something()z;async def foo():
                yield from []
            z=async def foo():
                await await fut
            zEasync def foo(a=await something()):
                pass
            zEasync def foo(a:await something()):
                pass
            z`async def foo():
                def bar():
                 [i async for i in els]
            z`async def foo():
                def bar():
                 [await i for i in els]
            z�async def foo():
                def bar():
                 [i for i in els
                    async for b in els]
            z�async def foo():
                def bar():
                 [i for i in els
                    for c in b
                    async for b in els]
            z�async def foo():
                def bar():
                 [i for i in els
                    async for b in els
                    for c in b]
            z�async def foo():
                def bar():
                 [i for i in els
                    for b in await els]
            z�async def foo():
                def bar():
                 [i for i in els
                    for b in els
                        if await b]
            z`async def foo():
                def bar():
                 [i for i in await els]
            zeasync def foo():
                def bar():
                 [i for i in els if await i]
            z?def bar():
                 [i async for i in els]
            zBdef bar():
                 {i: i async for i in els}
            z?def bar():
                 {i async for i in els}
            z?def bar():
                 [await i for i in els]
            z`def bar():
                 [i for i in els
                    async for b in els]
            zdef bar():
                 [i for i in els
                    for c in b
                    async for b in els]
            zdef bar():
                 [i for i in els
                    async for b in els
                    for c in b]
            z`def bar():
                 [i for i in els
                    for b in await els]
            z}def bar():
                 [i for i in els
                    for b in els
                        if await b]
            z?def bar():
                 [i for i in await els]
            zDdef bar():
                 [i for i in els if await i]
            z3async def foo():
                await
            z]async def foo():
                   def bar(): pass
                   await = 1
            z^async def foo():

                   def bar(): pass
                   await = 1
            zzasync def foo():
                   def bar(): pass
                   if 1:
                       await = 1
            zxdef foo():
                   async def bar(): pass
                   if 1:
                       await a
            z[def foo():
                   async def bar(): pass
                   await a
            z~def foo():
                   def baz(): pass
                   async def bar(): pass
                   await a
            z�def foo():
                   def baz(): pass
                   # 456
                   async def bar(): pass
                   # 123
                   await a
            z�async def foo():
                   def baz(): pass
                   # 456
                   async def bar(): pass
                   # 123
                   await = 2
            z�def foo():

                   def baz(): pass

                   async def bar(): pass

                   await a
            z�async def foo():

                   def baz(): pass

                   async def bar(): pass

                   await = 2
            zBasync def foo():
                   def async(): pass
            zBasync def foo():
                   def await(): pass
            zXasync def foo():
                   def bar():
                       await
            zKasync def foo():
                   return lambda async: await
            zGasync def foo():
                   return lambda a: await
            z	await a()z>async def foo(a=await b):
                   pass
            z>async def foo(a:await b):
                   pass
            z`def baz():
                   async def foo(a=await b):
                       pass
            z:async def foo(async):
                   pass
            z�async def foo():
                   def bar():
                        def baz():
                            async = 1
            z�async def foo():
                   def bar():
                        def baz():
                            pass
                        async = 1
            z�def foo():
                   async def bar():

                        async def baz():
                            pass

                        def baz():
                            42

                        async = 1
            z�async def foo():
                   def bar():
                        def baz():
                            pass
await foo()
            z�def foo():
                   def bar():
                        async def baz():
                            pass
await foo()
            z:async def foo(await):
                   pass
            z]def foo():

                   async def bar(): pass

                   await a
            z`def foo():
                   async def bar():
                        pass
await a
            z`def foo():
                   async for i in arange(2):
                       pass
            z[def foo():
                   async with resource:
                       pass
            z9async with resource:
                   pass
            z>async for i in arange(2):
                   pass
            ��code�<test>�exec�ZsubTest�assertRaises�SyntaxError�compile�r
Zsamplesr7rrr�test_badsyntax_1Ks6����z#AsyncBadSyntaxTest.test_badsyntax_1c
Cr5)N)	z1def foo():
                await = 1
            z9class Bar:
                def async(): pass
            z1class Bar:
                async = 1
            z.class async:
                pass
            z.class await:
                pass
            zimport math as awaitz!def async():
                passz2def foo(*, await=1):
                passasync = 1zprint(await=1)r6r8r9r:r>rrr�test_badsyntax_2�s"����z#AsyncBadSyntaxTest.test_badsyntax_2cCs<|�t��tddd�Wd�dS1swYdS)Nz	async = 1r8r9)r;r<r=rrrr�test_badsyntax_3�s"�z#AsyncBadSyntaxTest.test_badsyntax_3c
Cr5)N)z�def foo(await):
                async def foo(): pass
                async def foo():
                    pass
                return await + 1
            z�def foo(await):
                async def foo(): pass
                async def foo(): pass
                return await + 1
            z�def foo(await):

                async def foo(): pass

                async def foo(): pass

                return await + 1
            z�def foo(await):
                """spam"""
                async def foo():                     pass
                # 123
                async def foo(): pass
                # 456
                return await + 1
            a:def foo(await):
                def foo(): pass
                def foo(): pass
                async def bar(): return await_
                await_ = await
                try:
                    bar().send(None)
                except StopIteration as ex:
                    return ex.args[0] + 1
            r6r8r9r:r>rrr�test_badsyntax_4�s-����z#AsyncBadSyntaxTest.test_badsyntax_4N)rrrr?r@rArBrrrrr4Is;'r4c@�eZdZdd�ZdS)�TokenizerRegrTestcCs�g}td�D]}|�dj|d��qd�|�}i}t|||�|�|d�d�|d7}i}t|||�|�|d�d�|�t�|d��dS)	Ni�zdef i{i}(): return {i}�r+�
Zi499i�z
async def foo():
    return�foo)	�ranger�format�joinr9�assertEqual�
assertTrue�inspectZiscoroutinefunction)r
�bufr+�nsrrr�test_oneline_defs�s
z#TokenizerRegrTest.test_oneline_defsN)rrrrPrrrrrD��rDc@s�eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*dQdR�Z+dSdT�Z,dUdV�Z-dWdX�Z.dYdZ�Z/d[d\�Z0d]d^�Z1d_d`�Z2dadb�Z3dcdd�Z4dedf�Z5dgdh�Z6didj�Z7dkdl�Z8dmdn�Z9dodp�Z:dqdr�Z;dsdt�Z<dudv�Z=dwdx�Z>dydz�Z?d{d|�Z@d}d~�ZAdd��ZBd�d��ZCd�d��ZDd�d��ZEd�d��ZFd�d��ZGd�d��ZHd�d��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRd�S)��
CoroutineTestcCsdd�}|�t|d��dS)Ncs��dVdSr
rrrrr�gen�s�
z%CoroutineTest.test_gen_1.<locals>.genr)�assertFalse�hasattr)r
rTrrr�
test_gen_1�szCoroutineTest.test_gen_1cCs�dd�}|�}|�|tj�|�t|jjtj@��|�	t|jjtj
@��|�t|jjtj@��|�	t|jjtj
@��|�t
|�gdf�|�t|��gdf�dd�}|�	t|jjtj@��dS)Nc���dS�N�
rrrrrrG���z&CoroutineTest.test_func_1.<locals>.foorZcS�dSr
rrrrr�bar�z&CoroutineTest.test_func_1.<locals>.bar)�assertIsInstance�types�
CoroutineTyperL�bool�__code__�co_flagsrMZCO_COROUTINErUZCO_GENERATOR�cr_coderKr&r,)r
rG�fr]rrr�test_func_1�szCoroutineTest.test_func_1cC�Ddd�}|�td��t|��Wd�dS1swYdS)Nc���t�r
�r rrrrrGr[z&CoroutineTest.test_func_2.<locals>.foozcoroutine raised StopIteration)�assertRaisesRegex�RuntimeErrorr&�r
rGrrr�test_func_2s�"�zCoroutineTest.test_func_2cCs*dd�}|�}|�t|�d�|��dS)Nc�rir
rjrrrrrGr[z&CoroutineTest.test_func_3.<locals>.fooz^<coroutine object.* at 0x.*>$)�assertRegex�repr�close)r
rGr"rrr�test_func_3szCoroutineTest.test_func_3csBdd�}|�}�fdd�}|��t|�Wd�n1swY|��t|�Wd�n1s6wY|��t|�Wd�n1sMwY|��t|�Wd�n1sdwY|��
|D]}qoWd�n1s|wY|��dd�|D�Wd�n1s�wY|��dS)Nc�rir
rjrrrrrG!r[z&CoroutineTest.test_func_4.<locals>.fooc���td�S�Nz"'coroutine' object is not iterable�rk�	TypeErrorrrrr�<lambda>%��z+CoroutineTest.test_func_4.<locals>.<lambda>cS�g|]}|�qSrr��.0r+rrr�
<listcomp>9�z-CoroutineTest.test_func_4.<locals>.<listcomp>)�list�tuple�sum�iterrq)r
rGr"�checkr+rrr�test_func_4 s0
�
�
�
����zCoroutineTest.test_func_4cs�tjdd����fdd�}�fdd�}|�}|��
|D]}qWd�n1s)wY|����D]}��|d�q5��dd	���D�dg���t���d
���tt����d�dS)Ncss�dVdS�Nr(rrrrrr]>��
z&CoroutineTest.test_func_5.<locals>.barc�����IdHdSr
rr�r]rrrGBrz&CoroutineTest.test_func_5.<locals>.foocrsrtrurrrrrwErxz+CoroutineTest.test_func_5.<locals>.<lambda>r(cSryrr)r{�elrrrr|Qr}z-CoroutineTest.test_func_5.<locals>.<listcomp>�r()r`�	coroutinerqrKrr)r�)r
rGr�r"r�r)r]r
r�test_func_5=s 
��
zCoroutineTest.test_func_5cs~tjdd����fdd�}|�}|�|�d�d�|�|�d�d�|�t��|�d�Wd�dS1s8wYdS)Ncss�dVdVdS�Nr(r'rrrrrr]Vs�
z&CoroutineTest.test_func_6.<locals>.barc�r�r
rrr�rrrG[rz&CoroutineTest.test_func_6.<locals>.foor(r')r`r�rKrr;r )r
rGrfrr�r�test_func_6Us
"�zCoroutineTest.test_func_6cs\dd�}|���fdd�}|�td��
t|��Wd�n1s#wY���dS)Nc�rXrYrrrrrr]er[z&CoroutineTest.test_func_7.<locals>.barc3s��EdHdSr
rr�r"rrrGi��z&CoroutineTest.test_func_7.<locals>.foozCcannot 'yield from' a coroutine object in a non-coroutine generator)rkrvr~rq�r
r]rGrr�r�test_func_7ds��zCoroutineTest.test_func_7csBtj�fdd��}dd�}|��|�t|��gdf����dS)Nc3s��EdHSr
rrr�rrr]ur�z&CoroutineTest.test_func_8.<locals>.barc�rX�N�spamrrrrrrGyr[z&CoroutineTest.test_func_8.<locals>.foor�)r`r�rKr&rqr�rr�r�test_func_8tszCoroutineTest.test_func_8c	Cs�dd�}|�td��|�t��Wd�n1swY|�td��(|�t��|�D]}q1Wd�n1s>wYt��Wd�dS1sRwYdS)Nc���dSr
rrrrrrG�r[z&CoroutineTest.test_func_9.<locals>.fooz0coroutine '.*test_func_9.*foo' was never awaited)ZassertWarnsRegex�RuntimeWarningrr1r;rv)r
rG�_rrr�test_func_9�s&�
��
��
"�zCoroutineTest.test_func_9cs�d�tj�fdd����fdd�}|�}|��}|�|t|��t|�|�|�d�d�|��d�|��|��d�|�}|��}t|�|�	t
��|�t
dd�Wd�n1s_wY|��d	�dS)
Nrc3sJ�zz
dV}|dVWnty�d7��wW�d7�dS�d7�w)Nr'�dr(��ZeroDivisionError��a)�NrrrT�s���z'CoroutineTest.test_func_10.<locals>.genc�r�r
rr�rTrrrG�rz'CoroutineTest.test_func_10.<locals>.foorZr�r(�f)r`r�r�assertIsr�r)rKrrqr;r��throw)r
rGr"r*r)r�rTr�test_func_10�s&�zCoroutineTest.test_func_10cCsRdd�}|�}|�dt|��|�dt|����|�dt|����|��dS)Nc�r�r
rrrrr�func���z(CoroutineTest.test_func_11.<locals>.funcr�__iter__Zcoroutine_wrapper)�assertIn�dirrrprq)r
r�r"rrr�test_func_11�szCoroutineTest.test_func_11csN�fdd�}|��|�td����d�Wd�dS1s wYdS)Nc�s���d�}tIdHdSr
)rrGrE��merr�g�s�
z%CoroutineTest.test_func_12.<locals>.gzcoroutine already executing)rk�
ValueErrorr)r
r�rr�r�test_func_12�s�"�zCoroutineTest.test_func_12cCsPdd�}|�}|�td��
|�d�Wd�n1swY|��dS)Nc�r�r
rrrrrr��r[z%CoroutineTest.test_func_13.<locals>.gz5can't send non-None value to a just-started coroutiner�)rkrvrrq)r
r�r"rrr�test_func_13�s��zCoroutineTest.test_func_13csdtjdd����fdd�}|�}|�d�|�td��
|��Wd�dS1s+wYdS)NcsrSr
rrrrrrT�r�z'CoroutineTest.test_func_14.<locals>.genc�s6�z	��IdHWdSty��IdHYdSwr
��
GeneratorExitrr�rrr"�s��z(CoroutineTest.test_func_14.<locals>.corozcoroutine ignored GeneratorExit)r`r�rrkrlrq)r
r"�crr�r�test_func_14�s

�
"�zCoroutineTest.test_func_14cCs�dd�}dd�}|�}|�td��||��d�Wd�n1s#wY|�td��||��d�Wd�dS1sAwYdS)Nc�rXr�rrrrr�spammer�r[z+CoroutineTest.test_func_15.<locals>.spammerc�s�|IdHSr
rr�rrr�reader���
z*CoroutineTest.test_func_15.<locals>.readerr��&cannot reuse already awaited coroutine)rkr rrl)r
r�r�Zspammer_cororrr�test_func_15�s��"�zCoroutineTest.test_func_15cs
tjdd����fdd�}�fdd�}|�}||�}|�d�|�d�|�td��|�td��Wd�n1s<wY||�}|�d�|�td��
|�d�Wd�n1s`wY|�td��|�td	��Wd�dS1s~wYdS)
NcsrSr
rrrrr�nop�r�z'CoroutineTest.test_func_16.<locals>.nopc�s���IdHdSr�rr�r�rrr�s�z(CoroutineTest.test_func_16.<locals>.sendc�s���IdH|IdHSr
rr�r�rr�reads�
z(CoroutineTest.test_func_16.<locals>.read�hamr��wat)r`r�rrk�	Exceptionr�rl)r
rr�r�r�rr�r�test_func_16�s.


�
���"�zCoroutineTest.test_func_16cCs�dd�}|�}|�td��
|�d�Wd�n1swY|�td��
|�d�Wd�n1s8wY|�td��|�td��Wd�n1sUwY|��|��dS)Nc�rXr�rrrrrr�r[z-CoroutineTest.test_func_17.<locals>.coroutiner�r�r�)rkr rrlr�r�rq)r
r�r"rrr�test_func_17s"�����zCoroutineTest.test_func_17cCsFdd�}|�}|��}t|�}|�td��
|�d�Wd�n1s%wY|�td��
|�d�Wd�n1s@wY|�td��t|�Wd�n1sZwY|�td��|�td��Wd�n1swwY|�td��|�td��Wd�n1s�wY|�	�|�	�dS)Nc�rXr�rrrrrr�1r[z-CoroutineTest.test_func_18.<locals>.coroutiner�r�r�)
rr�rkr rrlr)r�r�rq)r
r�r"Z
await_iter�itrrr�test_func_18.s:����
�
����zCoroutineTest.test_func_18cs�d�tj�fdd����fdd�}|�}|�d�|�d�|��d�|��|��d�td�D]}|��|��d�q2dS)Nrc3s2�dVzdVWdSty�d7�YdSwr�r�r)�CHKrrrGYs��z'CoroutineTest.test_func_19.<locals>.fooc�r�r
rr)rGrrr�brz-CoroutineTest.test_func_19.<locals>.coroutiner(�)r`r�rrKrqrH)r
r�r"r�r)r�rGr�test_func_19Vs

�zCoroutineTest.test_func_19cCs&dd�}t|��}|�|gdf�dS)Nc�rX)N�rZrrrrrrGur[z7CoroutineTest.test_coro_wrapper_send_tuple.<locals>.foor�)r,rK�r
rGr$rrr�test_coro_wrapper_send_tuplets
z*CoroutineTest.test_coro_wrapper_send_tuplecCs8dd�}t|��}|�|dt�|�|djd�dS)Nc�s
�td�SrYrjrrrrrG|s�z?CoroutineTest.test_coro_wrapper_send_stop_iterator.<locals>.foor(rZ)r,r_r rKrr�rrr�$test_coro_wrapper_send_stop_iterator{s
z2CoroutineTest.test_coro_wrapper_send_stop_iteratorcs�tj��fdd����fdd�����fdd�}|����t���tj����j���d���t���tj	����jjj
jd���t
��
��d�Wd�n1sYwY��t���tj����j�dS)Nc3sL���t���tj����j�dV��t���tj����j�dSr
)rKrM�getcoroutinestateZCORO_RUNNING�assertIsNone�cr_awaitr)�coro_br
rrr��s�z&CoroutineTest.test_cr_await.<locals>.ac�r�r
rrr�rrr��rz&CoroutineTest.test_cr_await.<locals>.cc�s*����j���IdH���j�dSr
)r�r�r)r�r�r
rr�b�s�z&CoroutineTest.test_cr_await.<locals>.br�)r`r�rKrMr�ZCORO_CREATEDr�r�rZCORO_SUSPENDED�gi_code�co_namer;r ZCORO_CLOSED)r
r�r)r�r�r�r
r�
test_cr_await�s
�zCoroutineTest.test_cr_awaitcCs�tj}|�d|jj�|�d|jj�|�d|jj�|�d|jdj�|�d|jdj�|�|j	d�dd	�}|�}|�d
t
|��|��dS)Nzinto coroutinezinside coroutinezin coroutinezof the coroutinerrr�c�r�r
rrrrrrf�r�z(CoroutineTest.test_corotype_1.<locals>.fzcoroutine object)r`rar�r�__doc__rqr��__dict__rKrrp)r
�ctrfr�rrr�test_corotype_1�szCoroutineTest.test_corotype_1cCrh)Nc�s�dIdHdSr�rrrrrrG�r�z'CoroutineTest.test_await_1.<locals>.foozobject int can.t.*await�rkrvr&rmrrr�test_await_1�s"�zCoroutineTest.test_await_1cCrh)Nc�s�gIdHdSr
rrrrrrG�r�z'CoroutineTest.test_await_2.<locals>.foozobject list can.t.*awaitr�rmrrr�test_await_2�s"�zCoroutineTest.test_await_2cCs@dd�}|�t|��gd�df�|�t|��gd�df�dS)Nc�s�tgd��IdHdS)N�r(r'r�)rrrrrrG���z'CoroutineTest.test_await_3.<locals>.foor�)rKr&r,rmrrr�test_await_3�szCoroutineTest.test_await_3cs.dd���fdd�}|�t|��gdf�dS)Nc�rX�N�*rrrrrr]�r[z'CoroutineTest.test_await_4.<locals>.barc�����IdHSr
rrr�rrrG�rz'CoroutineTest.test_await_4.<locals>.foor��rKr&rmrr�r�test_await_4�szCoroutineTest.test_await_4c�VGdd�d���fdd�}|�td��t|��Wd�dS1s$wYdS)Nc@rC)z-CoroutineTest.test_await_5.<locals>.AwaitablecSr\r
rrrrrr��z7CoroutineTest.test_await_5.<locals>.Awaitable.__await__N�rrrrrrrr�	Awaitable��r�c�r�r
rr�r�rrrG�rz'CoroutineTest.test_await_5.<locals>.foo�(__await__.*returned non-iterator of typer�rmrr�r�test_await_5���"�zCoroutineTest.test_await_5cs6Gdd�d���fdd�}|�t|��dgdf�dS)Nc@rC)z-CoroutineTest.test_await_6.<locals>.AwaitablecSs
tdg�S)N�4�r�rrrrr�rz7CoroutineTest.test_await_6.<locals>.Awaitable.__await__Nr�rrrrr��r�r�c�r�r
rrr�rrrG�rz'CoroutineTest.test_await_6.<locals>.foor�r�rmrr�r�test_await_6�szCoroutineTest.test_await_6cs6Gdd�d���fdd�}|�t|��dgdf�dS)Nc@rC)z-CoroutineTest.test_await_7.<locals>.Awaitablecss�dVdS)Nr�r�rrrrrr�s�z7CoroutineTest.test_await_7.<locals>.Awaitable.__await__Nr�rrrrr��r�r�c�r�r
rrr�rrrG�rz'CoroutineTest.test_await_7.<locals>.foor�r�r�rmrr�r�test_await_7�szCoroutineTest.test_await_7cr�)Nc@�eZdZdS)z-CoroutineTest.test_await_8.<locals>.AwaitableN�rrrrrrrr���r�c�r�r
rrr�rrrG�s�z'CoroutineTest.test_await_8.<locals>.fooz4object Awaitable can't be used in 'await' expressionr�rmrr�r�test_await_8�s�"�zCoroutineTest.test_await_8cs^�fdd��dd����fdd�}�fdd�}|�t|��gd	f�|�t|��gd
f�dS)Nc��Sr
rrr�rr�wrap�r�z(CoroutineTest.test_await_9.<locals>.wrapc�rXr�rrrrrr]�r[z'CoroutineTest.test_await_9.<locals>.barc�sr�d�fdd�i}G�fdd�d�}��IdH���IdH|d���IdH��IdHd|���IdHS)Nr�cr�r
rr�r�rrrwr^z9CoroutineTest.test_await_9.<locals>.foo.<locals>.<lambda>cseZdZ�ZdS)z3CoroutineTest.test_await_9.<locals>.foo.<locals>.DBN)rrrr�rr�rr�DBsr����r�)Zdbr��r]r�rrrGs�,��z'CoroutineTest.test_await_9.<locals>.fooc�s���IdHSr
rrr�rr�foo2	r�z(CoroutineTest.test_await_9.<locals>.foo2i��i���r��r
rGr�rr�r�test_await_9�s	zCoroutineTest.test_await_9cs:dd���fdd���fdd�}|�t|��gdf�dS)Nc�rXr�rrrrr�bazr[z(CoroutineTest.test_await_10.<locals>.bazc�s���Sr
rr)r�rrr]��z(CoroutineTest.test_await_10.<locals>.barc�s���IdHIdHSr
rrr�rrrG��z(CoroutineTest.test_await_10.<locals>.foor�r�rmr)r]r�r�
test_await_10szCoroutineTest.test_await_10csDdd��dd����fdd�}�fdd�}|�t|��gd	f�dS)
NcS�|Sr
r��valrrr�identr�z*CoroutineTest.test_await_11.<locals>.identc�rXr�rrrrrr]r[z(CoroutineTest.test_await_11.<locals>.barc�s����IdHd�S)Nrrr�r]rrrrG"r�z(CoroutineTest.test_await_11.<locals>.fooc�s���IdHdfS)Nr�rrr�rrr�%rz)CoroutineTest.test_await_11.<locals>.foo2)r�r�r�r�rrr�
test_await_11s
zCoroutineTest.test_await_11csndd�}|��G�fdd�d���fdd�}|�td��
t|��Wd�n1s,wY���dS)Nc�rXr�rrrrrr"+r[z)CoroutineTest.test_await_12.<locals>.corocseZdZ�fdd�ZdS)z.CoroutineTest.test_await_12.<locals>.Awaitablecr�r
rr�r�rrr0r�z8CoroutineTest.test_await_12.<locals>.Awaitable.__await__Nr�rrrrr�/sr�c�r�r
rrr�rrrG3rz(CoroutineTest.test_await_12.<locals>.fooz"__await__\(\) returned a coroutine)rkrvr&rq)r
r"rGr)r�r�r�
test_await_12*s��zCoroutineTest.test_await_12cr�)Nc@rC)z.CoroutineTest.test_await_13.<locals>.AwaitablecSrr
rrrrrr>r�z8CoroutineTest.test_await_13.<locals>.Awaitable.__await__Nr�rrrrr�=r�r�c�r�r
rrr�rrrGArz(CoroutineTest.test_await_13.<locals>.foor�r�rmrr�r�
test_await_13<r�zCoroutineTest.test_await_13cs�Gdd�d��Gdd�d��Gdd�dt����fdd����fd	d
�}|�}|�d�|�td��
|�d�Wd�n1sBwY|�}|�d�|����|�t�Wd�dS1sewYdS)Nc@r)z,CoroutineTest.test_await_14.<locals>.WrappercSr	r
r�)r
r"rrrrLs
z5CoroutineTest.test_await_14.<locals>.Wrapper.__init__cSs
|j��Sr
)r"rrrrrrOrz6CoroutineTest.test_await_14.<locals>.Wrapper.__await__Nrrrrr�WrapperJsr	c@rC)z/CoroutineTest.test_await_14.<locals>.FutureLikecss�dVSr
rrrrrrSr�z9CoroutineTest.test_await_14.<locals>.FutureLike.__await__Nr�rrrr�
FutureLikeRr�r
c@r�)z+CoroutineTest.test_await_14.<locals>.MarkerNr�rrrr�MarkerVr�rc�s$�z��IdHWSty��wr
r�r)r
rrr�coro1Ys��z*CoroutineTest.test_await_14.<locals>.coro1c�s�����IdHSr
rr)r	rrr�coro2^rz*CoroutineTest.test_await_14.<locals>.coro2r�)r�rrkr r;r�r�)r
r
r�r)r
rr	rr�
test_await_14Is
�
"�zCoroutineTest.test_await_14csrtjdd����fdd�}dd�}|�}|�d�|�td��||��d�Wd�dS1s2wYdS)NcsrSr
rrrrrr�lr�z(CoroutineTest.test_await_15.<locals>.nopc�r�r
rrr�rrr�prz.CoroutineTest.test_await_15.<locals>.coroutinec�s�|IdHdSr
rr�rrr�waitersr�z+CoroutineTest.test_await_15.<locals>.waiterz"coroutine is being awaited already)r`r�rrkrl)r
r�rr"rr�r�
test_await_15ks

�"�zCoroutineTest.test_await_15cs2dd���fdd�}t|��\}}|�|j�dS)Nc�s�t�Sr
)r�rrrrrf�r�z&CoroutineTest.test_await_16.<locals>.fc�s�zt���IdHYSr
)�KeyErrorr�rfrrr��s
�z&CoroutineTest.test_await_16.<locals>.g)r&r��__context__)r
r�r�r$rrr�
test_await_16}szCoroutineTest.test_await_16cs�Gdd�d���fdd�}|�}t|�\}}|�|gd���fdd�}|�t��t|��Wd�dS1s:wYdS)Nc@�$eZdZdd�Zdd�Zdd�ZdS)z*CoroutineTest.test_with_1.<locals>.ManagercSr	r
)�name)r
rrrrr�rz3CoroutineTest.test_with_1.<locals>.Manager.__init__c�s$�td|jd|jg�IdH|S)Nzenter-1-zenter-2-�rrrrrr�
__aenter__�s
�
�z5CoroutineTest.test_with_1.<locals>.Manager.__aenter__c�s2�td|jd|jg�IdH|jdkrdSdS)Nzexit-1-zexit-2-�BTr�r
r!rrr�	__aexit__�s�
�
�z4CoroutineTest.test_with_1.<locals>.Manager.__aexit__N)rrrrrrrrrr�Manager�src
����d�4IdH�;}�d�4IdH�}td|j|jfg�IdHddWd�IdHn1IdHs4wYWd�IdHdS1IdHsJwYdS)N�Ar�managersr(rr)r�r��rrrrG��
�$
X�z&CoroutineTest.test_with_1.<locals>.foo)	z	enter-1-Az	enter-2-Az	enter-1-Bz	enter-2-B)rrrzexit-1-Bzexit-2-Bzexit-1-Azexit-2-Ac
�r)Nr�Crr(rr)r�r�r rrrG�r!)r&rKr;r�)r
rGrfr$r�rr r�test_with_1�s�"�zCoroutineTest.test_with_1c�fGdd�d��d���fdd�}|�td��
t|��Wd�n1s&wY|��d�dS)Nc@rC)z%CoroutineTest.test_with_2.<locals>.CMcSr\r
rrrrrr�r�z0CoroutineTest.test_with_2.<locals>.CM.__aenter__N)rrrrrrrr�CM�r�r%c	��J�d���4IdH�d�Wd�IdHdS1IdHswYdS�NFTrr�r%Z
body_executedrrrG��
�.�z&CoroutineTest.test_with_2.<locals>.foorF�rk�AttributeErrorr&r�rmrr(r�test_with_2���zCoroutineTest.test_with_2cr$)Nc@rC)z%CoroutineTest.test_with_3.<locals>.CMcSr\r
rrrrrr�r�z/CoroutineTest.test_with_3.<locals>.CM.__aexit__N)rrrrrrrrr%�r�r%c	�r&r'rrr(rrrG�r)z&CoroutineTest.test_with_3.<locals>.foorFr*rmrr(r�test_with_3�r-zCoroutineTest.test_with_3cr$)Nc@r�)z%CoroutineTest.test_with_4.<locals>.CMNr�rrrrr%�r�r%c	�r&r'rrr(rrrG�r)z&CoroutineTest.test_with_4.<locals>.foorFr*rmrr(r�test_with_4�s�zCoroutineTest.test_with_4csVGdd�d����fdd�}��t��t|��Wd�dS1s$wYdS)Nc@r)z%CoroutineTest.test_with_5.<locals>.CMc���|Sr
rrrrrr�r[z0CoroutineTest.test_with_5.<locals>.CM.__aenter__c�r�r
r)r
�excrrrr�r[z/CoroutineTest.test_with_5.<locals>.CM.__aexit__N�rrrrrrrrrr%�rr%c	�sN���4IdH���dd�Wd�IdHdS1IdHs wYdS)Nr�r()rKr�r%r
rrr��s�.�z'CoroutineTest.test_with_5.<locals>.func)r;�AssertionErrorr&)r
r�rr3r�test_with_5�s
"�zCoroutineTest.test_with_5cr�)Nc@r)z%CoroutineTest.test_with_6.<locals>.CMcS�dS)N�{rrrrrr�r�z0CoroutineTest.test_with_6.<locals>.CM.__aenter__cWr6�Ni�r�r
�errrr�r�z/CoroutineTest.test_with_6.<locals>.CM.__aexit__Nr2rrrrr%�rr%c	�sB���4IdH�Wd�IdHdS1IdHswYdSr
rr�r%rrrG�s�.�z&CoroutineTest.test_with_6.<locals>.foozV'async with' received an object from __aenter__ that does not implement __await__: intr�rmrr;r�test_with_6�s�"�zCoroutineTest.test_with_6c
s�Gdd�d���fdd�}zt|��Wn-tyA}z!|�|jdd�|�|jdu�|�t|jt��WYd}~dSd}~ww|�d�dS)Nc@r)z%CoroutineTest.test_with_7.<locals>.CMc�r0r
rrrrrrr[z0CoroutineTest.test_with_7.<locals>.CM.__aenter__cWr6)Ni�rr9rrrrr�z/CoroutineTest.test_with_7.<locals>.CM.__aexit__Nr2rrrrr%
rr%c	�sJ���4IdH�ddWd�IdHdS1IdHswYdS�Nr(rrrr;rrrGs�
.�z&CoroutineTest.test_with_7.<locals>.foor�U'async with' received an object from __aexit__ that does not implement __await__: intz1invalid asynchronous context manager did not fail)	r&rvror!rLr�
isinstancer��fail�r
rGr1rr;r�test_with_7	s� ��zCoroutineTest.test_with_7csVd�Gdd�d����fdd�}|�td��
t|��Wd�n1s&wY|��d���fdd�}|�td��
t|��Wd�n1sNwY|��d	���fd
d�}|�td��
t|��Wd�n1svwY|��d���fdd�}|�td��
t|��Wd�n1s�wY|��d
�dS)Nrc@r)z%CoroutineTest.test_with_8.<locals>.CMc�r0r
rrrrrr'r[z0CoroutineTest.test_with_8.<locals>.CM.__aenter__cWr6r8rr9rrrr*r�z/CoroutineTest.test_with_8.<locals>.CM.__aexit__Nr2rrrrr%&rr%c	��J���4IdH��d7�Wd�IdHdS1IdHswYdSr�rr�r%�CNTrrrG.��
.�z&CoroutineTest.test_with_8.<locals>.foor>r(c
�s\�td�D]&}��4IdH��d7�	Wd�IdHdS1IdHs&wYqdS�Nr'r(�rHrErDrrrG:s�0��r'c
�sX�td�D]$}��4IdH��d7�	Wd�IdHq1IdHs$wYqdSrGrHrErDrrrGHs�,��r�c	�sL���4IdH��d7�	Wd�IdHdS1IdHswYdSr�rrrDrrrGVs
�0��)rkrvr&rKrmrrDr�test_with_8#sD��������zCoroutineTest.test_with_8c�dd�Gdd�d����fdd�}|�t��
t|��Wd�n1s%wY|��d�dS)Nrc@r)z%CoroutineTest.test_with_9.<locals>.CMc�r0r
rrrrrrgr[z0CoroutineTest.test_with_9.<locals>.CM.__aenter__c���dddSr=rr9rrrrjrz/CoroutineTest.test_with_9.<locals>.CM.__aexit__Nr2rrrrr%frr%c	�rCr�rrrDrrrGmrFz&CoroutineTest.test_with_9.<locals>.foor(�r;r�r&rKrmrrDr�test_with_9cs�zCoroutineTest.test_with_9c
s�d�Gdd�d����fdd�}zt|��Wn.tyE}z"|�|jdu�|�t|jt��|�t|jjt��WYd}~dSd}~ww|�d�dS)Nrc@r)z&CoroutineTest.test_with_10.<locals>.CMc�r0r
rrrrrr{r[z1CoroutineTest.test_with_10.<locals>.CM.__aenter__c�rLr=rr9rrrr~rz0CoroutineTest.test_with_10.<locals>.CM.__aexit__Nr2rrrrr%zrr%c
�sl���4IdH�!��4IdH�t�1IdHswYWd�IdHdS1IdHs/wYdSr
�rlrrDrrrG�s��.�z'CoroutineTest.test_with_10.<locals>.fooz*exception from __aexit__ did not propagate)r&r�rLrr?rlr@rArrDr�test_with_10ws���zCoroutineTest.test_with_10c
std�Gdd�d����fdd�}zt|��Wnty2}z|�|jdu�WYd}~dSd}~ww|�d�dS)Nrc@r)z&CoroutineTest.test_with_11.<locals>.CMc�rir
)�NotImplementedErrorrrrrr�r[z1CoroutineTest.test_with_11.<locals>.CM.__aenter__c�rLr=rr9rrrr�rz0CoroutineTest.test_with_11.<locals>.CM.__aexit__Nr2rrrrr%�rr%c	�s0���4IdH�t�1IdHswYdSr
rOrrDrrrG�s��z'CoroutineTest.test_with_11.<locals>.fooz+exception from __aenter__ did not propagate)r&rQrLrr@rArrDr�test_with_11�s��zCoroutineTest.test_with_11cs0d�Gdd�d�����fdd�}t|��dS)Nrc@r)z&CoroutineTest.test_with_12.<locals>.CMc�r0r
rrrrrr�r[z1CoroutineTest.test_with_12.<locals>.CM.__aenter__c�rX�NTrr9rrrr�r[z0CoroutineTest.test_with_12.<locals>.CM.__aexit__Nr2rrrrr%�rr%c	�s>���4IdH�
}��|j��t�1IdHswYdSr
)r��	__class__rl��cm�r%rEr
rrrG�s
��z'CoroutineTest.test_with_12.<locals>.foo)r&rmrrWr�test_with_12�szCoroutineTest.test_with_12crK)Nrc@r)z&CoroutineTest.test_with_13.<locals>.CMc�rLr=rrrrrr�rz1CoroutineTest.test_with_13.<locals>.CM.__aenter__c�rXrSrr9rrrr�r[z0CoroutineTest.test_with_13.<locals>.CM.__aexit__Nr2rrrrr%�rr%c	�sX��d7���4IdH��d7�Wd�IdHn1IdHs!wY�d7�dS)Nr(r��'rrrDrrrG�s�
(�z'CoroutineTest.test_with_13.<locals>.foor(rMrmrrDr�test_with_13�s�zCoroutineTest.test_with_13csHd�G�fdd�d��g���fdd�}t|��\}}|��d�|�|dd�tdd	�D��|��d
d�tdd�D��g���fdd
�}t|��\}}|��d�|�|ddg�|��dd�tdd�D�dg�g���fdd�}t|��\}}|��d�|�|dd�tdd	�D��|��dd�tdd�D�ddg�dS)Nrcs(eZdZdd�Z�fdd�Zdd�ZdS)z+CoroutineTest.test_for_1.<locals>.AsyncItercS�
d|_dS�NrrErrrrr�rz4CoroutineTest.test_for_1.<locals>.AsyncIter.__init__cs�d7�|Sr�rr��aiter_callsrr�	__aiter__�sz5CoroutineTest.test_for_1.<locals>.AsyncIter.__aiter__c�sH�|jd7_|jdst|jd�IdH|jdkrt�|j|jfS)Nr(rZr�)r+r�StopAsyncIterationrrrr�	__anext__�s�

z5CoroutineTest.test_for_1.<locals>.AsyncIter.__anext__N�rrrrr_rarr]rr�	AsyncIter�srcc�s.���2z3dHW\}}��||�q6dSr
�r)Zi1Zi2�rcr#rr�test1�s��z'CoroutineTest.test_for_1.<locals>.test1r(cS�g|]}|d�qS�r�rrzrrrr|��z,CoroutineTest.test_for_1.<locals>.<listcomp>�cSrg)r'rrzrrrr|�ri�ec�sN���2z3dHW}��|d�|ddkrnq6��d���d�dS�Nr��what?�endrdrErerr�test2�s���
z'CoroutineTest.test_for_1.<locals>.test2r'r���cSryrrrzrrrr|r}�roc�sL���2z3dHW}|ddkrq��|d�q6��d���d�dSrlrdrErerr�test3s��
z'CoroutineTest.test_for_1.<locals>.test3r�cSrgrhrrzrrrr|ricSryrrrzrrrr|r}rn)r&rKrH)r
rf�yieldedr�rprsr)rcr^r#r�
test_for_1�s,
"

�zCoroutineTest.test_for_1csfd�t���}�fdd�}|�td��
t|��Wd�n1s#wY|�t���|�dS)Nr�c��"��2z
3dHW}td�q6dS�Nznever going to happen��printrE��tuprrrG��
�z%CoroutineTest.test_for_2.<locals>.fooz/async for' requires an object.*__aiter__.*tuple��sys�getrefcountrkrvr&rK)r
�refs_beforerGrrzr�
test_for_2s
��zCoroutineTest.test_for_2c�vGdd�d�}|��t���}�fdd�}|�td��
t|��Wd�n1s+wY|�t���|�dS)Nc@rC)z#CoroutineTest.test_for_3.<locals>.IcSrr
rrrrrr_'r�z-CoroutineTest.test_for_3.<locals>.I.__aiter__N�rrrr_rrrr�I&r�r�c�rvrwrxrE��aiterrrrG-r|z%CoroutineTest.test_for_3.<locals>.fooz!that does not implement __anext__r}�r
r�r�rGrr�r�
test_for_3%s
��zCoroutineTest.test_for_3cr�)Nc@r)z#CoroutineTest.test_for_4.<locals>.IcSrr
rrrrrr_;r�z-CoroutineTest.test_for_4.<locals>.I.__aiter__cSr6)Nrrrrrrra>r�z-CoroutineTest.test_for_4.<locals>.I.__anext__N)rrrr_rarrrrr�:rr�c�rvrwrxrEr�rrrGDr|z%CoroutineTest.test_for_4.<locals>.fooz7async for' received an invalid object.*__anext__.*tupler}r�rr�r�
test_for_49s
��zCoroutineTest.test_for_4csd�G�fdd�d��Gdd�d��������t���}t���}���fdd�}t���t�d�t|��Wd�n1sCwY|��d	�|�t���|�|�t���|����fd
d�}t|��|��d����fdd�}t|��|��d
�dS)Nrcs$eZdZ�fdd�Z�fdd�ZdS)z)CoroutineTest.test_for_6.<locals>.Managerc����d7�dS)NrYrr�r�rrrT��z4CoroutineTest.test_for_6.<locals>.Manager.__aenter__c�r�)Ni��rrr�rrrXr�z3CoroutineTest.test_for_6.<locals>.Manager.__aexit__Nr2rr�rrrSsrc@r)z*CoroutineTest.test_for_6.<locals>.IterablecSr[r\rErrrrr]rz3CoroutineTest.test_for_6.<locals>.Iterable.__init__cSrr
rrrrrr_`r�z4CoroutineTest.test_for_6.<locals>.Iterable.__aiter__c�s$�|jdkrt�|jd7_|jS�NrZr()r+r`rrrrracs
�
z4CoroutineTest.test_for_6.<locals>.Iterable.__anext__Nrbrrrr�Iterable\sr�c	�sb��4IdH��2z
3dHW}�d7�q
6Wd�IdHn1IdHs&wY�d7�dS�Nr(r�rrE)r��iterable�managerrr�mainps�
�(�z&CoroutineTest.test_for_6.<locals>.main�errori��c	�s����4IdH���2z
3dHW}�d7�q6Wd�IdHn1IdHs(wY�d7���4IdH���2z
3dHW}�d7�q<6Wd�IdHn1IdHsXwY�d7�dSr�rrE�r�r�rrrr��s�
�(�
�(�i�c	�s����4IdH�"�d7���2z
3dHW}�d7�q6�d7�Wd�IdHn1IdHs0wY�d7���4IdH�"�d7���2z
3dHW}�d7�qH6�d7�Wd�IdHn1IdHshwY�d7�dS)Nr�r(i���r�rrEr�rrr��s"�
�
(�
�
(�i��9)r~rr.r/r0r&rK)r
Zmrefs_beforeZirefs_beforer�r)r�r�rr�r�r�
test_for_6Ps*	



�


zCoroutineTest.test_for_6csdd�Gdd�d����fdd�}|�t��
t|��Wd�n1s%wY|��d�dS)Nrc@rC)z$CoroutineTest.test_for_7.<locals>.AIcS�dddSr=rrrrrr_��z.CoroutineTest.test_for_7.<locals>.AI.__aiter__Nr�rrrr�AI�r�r�c��,���2z
3dHW}�d7�q6�d7�dS�Nr(rZrrE�r�rErrrG��
�
�z%CoroutineTest.test_for_7.<locals>.foorMrmrr�r�
test_for_7�s�zCoroutineTest.test_for_7c	s�d�Gdd�d����fdd�}|�t��&t���t�d�t|��Wd�n1s/wYWd�n1s>wY|��d�dS)Nrc@rC)z$CoroutineTest.test_for_8.<locals>.AIcSr�r=rrrrrr_�r�z.CoroutineTest.test_for_8.<locals>.AI.__aiter__Nr�rrrrr��r�r�c�r�r�rrEr�rrrG�r�z%CoroutineTest.test_for_8.<locals>.foor�)r;r�r.r/r0r&rKrmrr�r�
test_for_8�s

���zCoroutineTest.test_for_8csjGdd�d���fdd�}|�td��}|��d�Wd�n1s$wY|j}|�|jt�dS)Nc@r)z$CoroutineTest.test_for_11.<locals>.FcSrr
rrrrrr_�r�z.CoroutineTest.test_for_11.<locals>.F.__aiter__cSrr
rrrrrra�r�z.CoroutineTest.test_for_11.<locals>.F.__anext__cSr�r=rrrrrr�r�z.CoroutineTest.test_for_11.<locals>.F.__await__N)rrrr_rarrrrr�F�sr�c�s���2z3dHW}q6dSr
r)r��r�rrr��s��z'CoroutineTest.test_for_11.<locals>.mainz an invalid object from __anext__)rkrvr�	exceptionr_�	__cause__r�)r
r�r��errrr�r�test_for_11�s��zCoroutineTest.test_for_11c�|Gdd�dt��Gdd�dt��g����fdd�}|����|��d�Wd�n1s0wY|��dg�dS)Nc@r�)z*CoroutineTest.test_for_tuple.<locals>.DoneNr�rrrr�Done��r�c@� eZdZdZdd�Zdd�ZdS)z+CoroutineTest.test_for_tuple.<locals>.AIterrcSrr
rrrrrr_�r�z5CoroutineTest.test_for_tuple.<locals>.AIter.__aiter__c�s0�|jt|�kr
t�|jd7_||jdSr�)r+�lenr`rrrrra�s
�z5CoroutineTest.test_for_tuple.<locals>.AIter.__anext__N�rrrr+r_rarrrr�AIter��r�c�s*��dg�2z3dHW}��|�q6��r�rdrE�r�r�r$rrrG�s
��z)CoroutineTest.test_for_tuple.<locals>.foor�)r�rr;rrKrmrr�r�test_for_tuple��
�zCoroutineTest.test_for_tuplecr�)Nc@r�)z3CoroutineTest.test_for_stop_iteration.<locals>.DoneNr�rrrrr��r�r�c@r�)z4CoroutineTest.test_for_stop_iteration.<locals>.AIterrcSrr
rrrrrr_�r�z>CoroutineTest.test_for_stop_iteration.<locals>.AIter.__aiter__c�s �|jrt�|jd7_|jSr�)r+r`rrrrrra�s
�z>CoroutineTest.test_for_stop_iteration.<locals>.AIter.__anext__Nr�rrrrr��r�r�c�s(��d�2z3dHW}��|�q6��r�rdrEr�rrrGs
��z2CoroutineTest.test_for_stop_iteration.<locals>.foor�)r�r r;rrKrmrr�r�test_for_stop_iteration�r�z%CoroutineTest.test_for_stop_iterationcs�dd���fdd�}�fdd�}�fdd�}�fd	d
�}|�t|��gddgf�|�t|��gddhf�|�t|��gd
d
d�f�|�t|��gddd�f�dS)Nc�r0r
rrErrrrfr[z$CoroutineTest.test_comp_1.<locals>.fc��"�dd��d��d�fD�IdHS)Nc�s�g|]}|IdH�qSr
r�r{r�rrrr|��z?CoroutineTest.test_comp_1.<locals>.run_list.<locals>.<listcomp>r(�)rrrrr�run_list�� z+CoroutineTest.test_comp_1.<locals>.run_listc�r�)Nc�s�h|]}|IdH�qSr
rr�rrr�	<setcomp>r�z=CoroutineTest.test_comp_1.<locals>.run_set.<locals>.<setcomp>r(r�rrrrr�run_setr�z*CoroutineTest.test_comp_1.<locals>.run_setc�r�)Nc�s�i|]}|IdHd�qS)Nr�rr�rrr�
<dictcomp>s�z@CoroutineTest.test_comp_1.<locals>.run_dict1.<locals>.<dictcomp>r(r�rrrrr�	run_dict1r�z,CoroutineTest.test_comp_1.<locals>.run_dict1c�s&�dd�t�d��d�g�D�IdHS)Nc�s�i|]
\}}||IdH�qSr
r)r{r+r�rrrr�s�z@CoroutineTest.test_comp_1.<locals>.run_dict2.<locals>.<dictcomp>r(r�)�	enumeraterrrr�	run_dict2��$z,CoroutineTest.test_comp_1.<locals>.run_dict2r(r�r�)r(r�)rr(r�)r
r�r�r�r�rrr�test_comp_1s zCoroutineTest.test_comp_1cs~dd���fdd�}|�t|��ggd�f��fdd�}|�t|��ghd�f��fd	d
�}|�t|��gddhf�dS)
Nc�r0r
rrErrrrf$r[z$CoroutineTest.test_comp_2.<locals>.fc�s2�dd��d��d��d��ddg�fD�IdHS)Nc�s"�g|]}|IdHD]}|�q
qSr
r�r{r��srrrr|(s��
�z?CoroutineTest.test_comp_2.<locals>.run_list.<locals>.<listcomp>��abc�de�fgrrrrrr�'s�0z+CoroutineTest.test_comp_2.<locals>.run_list)r�r�r�r�r�c�s.�dd���ddg��dg�g�fD�IdHS)Nc�s2�h|]}|IdHD]}|IdHD]}|�qq
qSr
r)r{r�r��drrrr�0s����z=CoroutineTest.test_comp_2.<locals>.run_set.<locals>.<setcomp>rZ�rmrrrrrr�/s���z*CoroutineTest.test_comp_2.<locals>.run_set>rZrmr�c�s(�dd���d��d�g�fD�IdHS)Nc�s(�h|]}|IdHD]}|IdH�q
qSr
rr�rrrr�;s���z>CoroutineTest.test_comp_2.<locals>.run_set2.<locals>.<setcomp>rZrmrrrrr�run_set2:s��z+CoroutineTest.test_comp_2.<locals>.run_set2rZrmr�)r
r�r�r�rrr�test_comp_2#s 
�
�
�zCoroutineTest.test_comp_2cs�dd���fdd�}|�t|��gddgf��fdd�}|�t|��gddhf��fd	d
�}|�t|��gddd
�f��fdd�}|�t|��gddgf�dS)NcS��|D]}|VqdSr
r�r�r+rrrrfD���z$CoroutineTest.test_comp_3.<locals>.fc���dd��ddg�2�IdHS)Nc�� �g|z
3dHW}|d�q6Sr�rrzrrrr|I��z?CoroutineTest.test_comp_3.<locals>.run_list.<locals>.<listcomp>rZrmrrrrrr�H��z+CoroutineTest.test_comp_3.<locals>.run_listrjrrc�r�)Nc�s �h|z
3dHW}|d�q6Sr�rrzrrrr�Or�z=CoroutineTest.test_comp_3.<locals>.run_set.<locals>.<setcomp>rZrmrrrrrr�Nr�z*CoroutineTest.test_comp_3.<locals>.run_setc�r�)Nc�s&�i|z
3dHW}|d|d�q6Sr�rrzrrrr�Us�$z?CoroutineTest.test_comp_3.<locals>.run_dict.<locals>.<dictcomp>rZrmrrrrr�run_dictTr�z+CoroutineTest.test_comp_3.<locals>.run_dict��)rjrrc��,�dd��ddg�2�}dd�|2�IdHS)NcSs"�|z3dHW}|dVq6dSr�rrzrrr�	<genexpr>[�� z=CoroutineTest.test_comp_3.<locals>.run_gen.<locals>.<genexpr>rZrmc�r��Nr�r�r{r�rrrr|\r�z>CoroutineTest.test_comp_3.<locals>.run_gen.<locals>.<listcomp>rr�rrr�run_genZ��z*CoroutineTest.test_comp_3.<locals>.run_gen�o�yr��r
r�r�r�r�rrr�test_comp_3Cs*
�
��
�zCoroutineTest.test_comp_3cs�dd���fdd�}|�t|��gdgf��fdd�}|�t|��gdhf��fdd	�}|�t|��gdd
if��fdd�}|�t|��gd
gf�dS)NcSr�r
rr�rrrrfbr�z$CoroutineTest.test_comp_4.<locals>.fc�r�)Nc�s(�g|z3dHW}|dkr|d�q6Sr�rrzrrrr|g��&z?CoroutineTest.test_comp_4.<locals>.run_list.<locals>.<listcomp>rZrmrrrrrr�fr�z+CoroutineTest.test_comp_4.<locals>.run_listrrc�r�)Nc�s(�h|z3dHW}|dkr|d�q6Sr�rrzrrrr�mr�z=CoroutineTest.test_comp_4.<locals>.run_set.<locals>.<setcomp>rZrmrrrrrr�lr�z*CoroutineTest.test_comp_4.<locals>.run_setc�r�)Nc�s.�i|z3dHW}|dkr|d|d�q6S)NrZr(r'rrzrrrr�ss�,z?CoroutineTest.test_comp_4.<locals>.run_dict.<locals>.<dictcomp>rZrmrrrrrr�rr�z+CoroutineTest.test_comp_4.<locals>.run_dictr�c�r�)NcSs*�|z3dHW}|dkr|dVq6dSr�rrzrrrr�ys�(z=CoroutineTest.test_comp_4.<locals>.run_gen.<locals>.<genexpr>rZrmc�r�r�rr�rrrr|zr�z>CoroutineTest.test_comp_4.<locals>.run_gen.<locals>.<listcomp>rr�rrrr�xr�z*CoroutineTest.test_comp_4.<locals>.run_genr�r�r�rrr�test_comp_4as*��
��zCoroutineTest.test_comp_4cs�dd���fdd�}|�t|��ggd�f��fdd�}|�t|��ghd�f��fd	d
�}|�t|��gddd
d�f��fdd�}|�t|��ggd�f�dS)NcSr�r
rr�rrrrf�r�z&CoroutineTest.test_comp_4_2.<locals>.fc���dd��td��2�IdHS)Nc�s8�g|z3dHW}d|krdkrnn|d�q6S�NrrIrZrrzrrrr|���6zACoroutineTest.test_comp_4_2.<locals>.run_list.<locals>.<listcomp>�rHrrrrr��r�z-CoroutineTest.test_comp_4_2.<locals>.run_list)rjr��
c�r�)Nc�s8�h|z3dHW}d|krdkrnn|d�q6Sr�rrzrrrr��r�z?CoroutineTest.test_comp_4_2.<locals>.run_set.<locals>.<setcomp>r�rHrrrrr��r�z,CoroutineTest.test_comp_4_2.<locals>.run_set>rjr�r�c�r�)Nc�s>�i|z3dHW}d|krdkrnn|d|d�q6S)NrrIrZr�rrzrrrr��s�<zACoroutineTest.test_comp_4_2.<locals>.run_dict.<locals>.<dictcomp>r�rHrrrrr��r�z-CoroutineTest.test_comp_4_2.<locals>.run_dictrkr��gc�s,�dd��td��2�}dd�|2�IdHS)NcSs:�|z3dHW}d|krdkrnn|dVq6dSr�rrzrrrr��s�8z?CoroutineTest.test_comp_4_2.<locals>.run_gen.<locals>.<genexpr>r�c�r�r�rr�rrrr|�r�z@CoroutineTest.test_comp_4_2.<locals>.run_gen.<locals>.<listcomp>rHr�rrrr��r�z,CoroutineTest.test_comp_4_2.<locals>.run_gen)r��p�qr�r�rrr�
test_comp_4_2s*
�
��
�zCoroutineTest.test_comp_4_2cs0dd���fdd�}|�t|��gdgf�dS)NcSr�r
rr�rrrrf�r�z$CoroutineTest.test_comp_5.<locals>.fc�s&��fdd�ddgddgfD�IdHS)Nc	�sB�g|]}|ddkr�|�2z3dHW}|dkr|d�q6qS)rrZNr�r(r)r{Zpairr+rrrr|�s��
�
z?CoroutineTest.test_comp_5.<locals>.run_list.<locals>.<listcomp>rZrmr��(rrrrrr��r�z+CoroutineTest.test_comp_5.<locals>.run_listr�r��r
r�rrr�test_comp_5�s�zCoroutineTest.test_comp_5cs2dd���fdd�}|�t|��ggd�f�dS)NcSr�r
rr�rrrrf�r�z$CoroutineTest.test_comp_6.<locals>.fc�r�)Nc�s*�g|z3dHW}|D]}|d�qq6Sr�r)r{�seqr+rrrr|�s���z?CoroutineTest.test_comp_6.<locals>.run_list.<locals>.<listcomp>)rZrm)r�rrrrrr��r�z+CoroutineTest.test_comp_6.<locals>.run_list)rjrr�r�r�rrr�test_comp_6�s
�zCoroutineTest.test_comp_6csPdd���fdd�}|�td��t|��Wd�dS1s!wYdS)NcSs�dVdVtd��)Nr(r'�aaa)r�rrrrrf�s�z$CoroutineTest.test_comp_7.<locals>.fc�s�dd���2�IdHS)Nc���g|z3dHW}|�q6Sr
rrzrrrr|���z?CoroutineTest.test_comp_7.<locals>.run_list.<locals>.<listcomp>rrrrrr��r�z+CoroutineTest.test_comp_7.<locals>.run_listr�)rkr�r&r�rrr�test_comp_7�s
"�zCoroutineTest.test_comp_7cCs&dd�}|�t|��ggd�f�dS)Nc�s�dd�dD�S)NcSryrrrzrrrr|�r}z8CoroutineTest.test_comp_8.<locals>.f.<locals>.<listcomp>r�rrrrrrf�r�z$CoroutineTest.test_comp_8.<locals>.fr�r��r
rfrrr�test_comp_8�s

�zCoroutineTest.test_comp_8cs2dd���fdd�}|�t|��gddgf�dS)NcSs�dVdVdSr�rrrrrrT�s�
z&CoroutineTest.test_comp_9.<locals>.genc�s&�dd���2�IdH}dd�|D�S)Nc�r�r
rrzrrrr|�r�z8CoroutineTest.test_comp_9.<locals>.f.<locals>.<listcomp>cSryrrrzrrrr|�r}r)�lr�rrrf�s�z$CoroutineTest.test_comp_9.<locals>.fr(r'r�r�rr�r�test_comp_9�s
�zCoroutineTest.test_comp_9cCs*dd�}|�t|��gdddd�f�dS)Nc�s�dd�dD�}dd�|D�S)NcSsh|]}|�qSrrrzrrrr��r}z8CoroutineTest.test_comp_10.<locals>.f.<locals>.<setcomp>r�cSsi|]}||�qSrr)r{�xrrrr��sz9CoroutineTest.test_comp_10.<locals>.f.<locals>.<dictcomp>r)�xxrrrrf�s�z%CoroutineTest.test_comp_10.<locals>.fr(r'r�r�r�r�rrr�test_comp_10�s
�zCoroutineTest.test_comp_10cCs�dd�}|�}|�t��
t�|�Wd�n1swY|��}z(|�t��
t�|�Wd�n1s;wYW|��dSW|��dS|��w)Nc�r�r
rrrrrr��r�z%CoroutineTest.test_copy.<locals>.func)r;rv�copyrrq)r
r�r"r*rrr�	test_copy�s���zCoroutineTest.test_copyc	Cs�dd�}|�}ttjd�D] }|�ttjf��t�||�Wd�n1s)wYq|��}z/ttjd�D] }|�ttjf��t�||�Wd�n1sVwYq;W|��dS|��w)Nc�r�r
rrrrrr��r�z'CoroutineTest.test_pickle.<locals>.funcr()	rH�pickle�HIGHEST_PROTOCOLr;rv�
PicklingError�dumpsrrq)r
r�r"�protor*rrr�test_pickle�s �����zCoroutineTest.test_picklec	Cs�dd�}t���Kt���.}t�d�|�}t|�}d}t��|�dt|j	j
��|�t|j	j�|�Wd�n1s>wYWd�dSWd�dS1sVwYdS)Nc�r�r
rrrrrr��r�z3CoroutineTest.test_fatal_coro_warning.<locals>.funcr�zwas never awaited)
r.r/r�catch_unraisable_exception�filterwarningsrpr1r��str�
unraisable�	exc_valuerK�object)r
r�rVr"�	coro_reprrrr�test_fatal_coro_warning�s
�
P�z%CoroutineTest.test_fatal_coro_warningcs�Gdd�d�}|��dd�����fdd�}��t|��gdf����fdd	�}��t|��gdf����fd
d�}��t|��gdf�dS)Nc@rC)zMCoroutineTest.test_for_assign_raising_stop_async_iteration.<locals>.BadTargetcS�td��r��r`)r
�keyrrrr�__setitem__�zYCoroutineTest.test_for_assign_raising_stop_async_iteration.<locals>.BadTarget.__setitem__N)rrrr
rrrr�	BadTargetr�rcSs�dVdSrYrrrrr�sourcer�zJCoroutineTest.test_for_assign_raising_stop_async_iteration.<locals>.sourcec�sZ���t��}��2z3dHW�d<q
6Wd�n1swY��|jjd�dS)Nr�r�ro�r;r`rKr�r!rU�r
r�tgtrr�run_for����zKCoroutineTest.test_for_assign_raising_stop_async_iteration.<locals>.run_forroc�sZ���t��}�fdd���2�IdHWd�S1swY��|jjd�dS)Nc�s �g|z
3dHW�d<d�q6Sr\r�r{�rrrr|r�z`CoroutineTest.test_for_assign_raising_stop_async_iteration.<locals>.run_list.<locals>.<listcomp>rrorrUrrrr�s� �zLCoroutineTest.test_for_assign_raising_stop_async_iteration.<locals>.run_listc�sz��fdd���2�}|�d�}��t��
}|IdHWd�n1s%wY��|jjt���|jjjd�dS)Ncs"�|z3dHW�d<dVq6dSr\rrrrrr�"r�z^CoroutineTest.test_for_assign_raising_stop_async_iteration.<locals>.run_gen.<locals>.<genexpr>rro�	�asendr;rlr_r�r�r`rKr!�rTr�rVrrrr�!s�
�zKCoroutineTest.test_for_assign_raising_stop_async_iteration.<locals>.run_genr�)r
rrr�r�rrr�,test_for_assign_raising_stop_async_iteration
sz:CoroutineTest.test_for_assign_raising_stop_async_iterationcs�Gdd�d���fdd����fdd�}��t|��gdf���fdd	�}��t|��gdf���fd
d�}��t|��gdf�dS)Nc@rC)zQCoroutineTest.test_for_assign_raising_stop_async_iteration_2.<locals>.BadIterablecSr
r�rrrrrr�-rzZCoroutineTest.test_for_assign_raising_stop_async_iteration_2.<locals>.BadIterable.__iter__N)rrrr�rrrr�BadIterable,r�rcs���VdSr
rr)rrr�badpairs/rzNCoroutineTest.test_for_assign_raising_stop_async_iteration_2.<locals>.badpairsc�sZ���t��}��2z3dHW\}}q
6Wd�n1swY��|jjd�dS)Nrror)rVr+�j�rr
rrr2rzMCoroutineTest.test_for_assign_raising_stop_async_iteration_2.<locals>.run_forroc�sV���t��}dd���2�IdHWd�S1swY��|jjd�dS)Nc�s �g|z
3dHW\}}d�q6Sr\r�r{r+rrrrr|<r�zbCoroutineTest.test_for_assign_raising_stop_async_iteration_2.<locals>.run_list.<locals>.<listcomp>rrorrUr rrr�:s� �zNCoroutineTest.test_for_assign_raising_stop_async_iteration_2.<locals>.run_listc�sv�dd���2�}|�d�}��t��
}|IdHWd�n1s#wY��|jjt���|jjjd�dS)NcSs"�|z3dHW\}}dVq6dSr\rr!rrrr�Br�z`CoroutineTest.test_for_assign_raising_stop_async_iteration_2.<locals>.run_gen.<locals>.<genexpr>rrorrr rrr�As�
�zMCoroutineTest.test_for_assign_raising_stop_async_iteration_2.<locals>.run_genr�)r
rr�r�r)rrr
r�.test_for_assign_raising_stop_async_iteration_2+sz<CoroutineTest.test_for_assign_raising_stop_async_iteration_2csP�fdd�}�fdd��tjdd���|�}|�d�}|�t�}|�||�dS)Nc�r�r
rrr�rrr�Mrz6CoroutineTest.test_stack_in_coroutine_throw.<locals>.ac�r�r
rrrrrr�Prz6CoroutineTest.test_stack_in_coroutine_throw.<locals>.bcss:�z
tt���VWdStytt���VYdSwr
)r��	traceback�
extract_stackr�rrrrr�Ss��z6CoroutineTest.test_stack_in_coroutine_throw.<locals>.c)r`r�rr�r�rK)r
r�r"Zlen_sendZ	len_throwr)r�r�r�test_stack_in_coroutine_throwKs


z+CoroutineTest.test_stack_in_coroutine_throwN)SrrrrWrgrnrrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrr#r,r.r/r5r<rBrJrNrPrRrXrZrur�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr	rr"r%rrrrrR�s�	#
	(	


"(@H\ 
	
! rRc@rC)�CoroAsyncIOCompatTestc	s�t�d��Gdd�dt��g�G��fdd�d������fdd�}���}��|�zz|�|��Wn	�y=YnwW|����d�n
|����d�w|��gd��dS)	N�asyncioc@r�)z9CoroAsyncIOCompatTest.test_asyncio_1.<locals>.MyExceptionNr�rrrr�MyExceptionjr�r(cs(eZdZ��fdd�Z��fdd�ZdS)z0CoroAsyncIOCompatTest.test_asyncio_1.<locals>.CMc�s*���d���d�IdH��d�|S)Nr(�{�G�z�?r')r�sleepr�r'r#rrrps
�

z;CoroAsyncIOCompatTest.test_asyncio_1.<locals>.CM.__aenter__c�s"���d�IdH��|j�dS)Nr))r*rr)r
�exc_type�exc_val�exc_tbr+rrrvs�z:CoroAsyncIOCompatTest.test_asyncio_1.<locals>.CM.__aexit__Nr2rr+rrr%osr%c	�sJ���4IdH�}��d�IdH��1IdHswY��d�dS)Nr)Zunreachable)r*rr�r%r(r'r#rrrfzs��z/CoroAsyncIOCompatTest.test_asyncio_1.<locals>.f)r(r'r()	r�
import_moduler�Znew_event_loopZset_event_loopZrun_until_completerqZset_event_loop_policyrK)r
rfZlooprr/r�test_asyncio_1es$

���z$CoroAsyncIOCompatTest.test_asyncio_1N)rrrr1rrrrr&crQr&c@r3)
�OriginTrackingTestcCst�t��j�}|j|jfSr
)rMZgetframeinfo�currentframe�f_back�filename�lineno)r
�inforrr�here�szOriginTrackingTest.herec	st��}�zdd��t�d���t��d�t�����}��|j�Wd�n1s.wYt�d���t��d����\}}t�����}��|j||ddff�Wd�n1sdwYt�d���t��d���fdd�}���\}}|�\\}}}t�|����|j||d	f||ddff�Wd�n1s�wYt�d
�t�����}��	dt
|j�ko�d
kn�Wd�n1s�wY��t��
t�d�Wd�n1s�wY��t��d
�Wt�|�dSt�|�w)Nc�r�r
rrrrr�corofn�r[z7OriginTrackingTest.test_origin_tracking.<locals>.corofnrr(�test_origin_trackingr'cs�����fSr
)r8r�r9r
rr�nested�sz7OriginTrackingTest.test_origin_tracking.<locals>.nestedr<r����)
r~�#get_coroutine_origin_tracking_depth�#set_coroutine_origin_tracking_depthrK�
contextlib�closingr��	cr_originr8rLr�r;r�)r
�
orig_depthr"Zfnamer6r<Znested_fnameZ
nested_linenorr;rr:�sJ
�
��
���
&��z'OriginTrackingTest.test_origin_trackingc
sdd�����\}}�fdd��|d7}���\}}�fdd��|d7}��fdd	�}t��}zK|d
d�j�d��}|d
d�d�j�d�dd|�d|�d�dg��|dd�d�j�d�dd|�d|�d�dd|�d|�d�dg��Wt�|�dSt�|�w)Nc�r�r
rrrrrr9�r[z?OriginTrackingTest.test_origin_tracking_warning.<locals>.corofnc���Sr
rr)r9rr�a1��z;OriginTrackingTest.test_origin_tracking_warning.<locals>.a1r'crDr
rr)rErr�a2�rFz;OriginTrackingTest.test_origin_tracking_warning.<locals>.a2csXt�|���t��}��t��Wd�n1swY��|t|j��dSr
)	r~r?ZassertWarnsr�rr1rKr�warning)�depth�msgrV)rGr
rrr��s

�z>OriginTrackingTest.test_origin_tracking_warning.<locals>.checkrzcoroutine 'z' was never awaitedr(r�z' was never awaited
z-Coroutine created at (most recent call last)
z  File "z", line z, in a1
z$    return corofn()  # comment in a1z, in a2
z!    return a1()  # comment in a2
)r8r~r>rrJr?)r
Za1_filenameZ	a1_linenoZa2_filenameZ	a2_linenor�rCrJr)rErGr9r
r�test_origin_tracking_warning�s4�
�
z/OriginTrackingTest.test_origin_tracking_warningc	Csdd�}tj}zzdd�t_t���=}t�dtf��&|�}t|�}~t��|�	t|j
j�|�|�	|j
jt
�Wd�n1sBwYWd�n1sQwYt`t�dtf��|�t��Wd�n1sqwYW|t_dSW|t_dS|t_w)Nc�r�r
rrrrrr9�r[zLOriginTrackingTest.test_unawaited_warning_when_module_broken.<locals>.corofncSsddSr=rr�rrrrw�szNOriginTrackingTest.test_unawaited_warning_when_module_broken.<locals>.<lambda>zcoroutine .* was never awaited)r.�_warn_unawaited_coroutinerrrZcheck_warningsr�rpr1rKrrr,r�)r
r9Zorig_wucrVr"rrrr�)test_unawaited_warning_when_module_broken�s<

������
�
�z<OriginTrackingTest.test_unawaited_warning_when_module_brokenN)rrrr8r:rKrMrrrrr2�s
.*r2c@rC)�"UnawaitedWarningDuringShutdownTestcCs.d}td|�d}td|�d}td|�dS)NzWimport asyncio
async def f(): pass
async def t(): asyncio.gather(f())
asyncio.run(t())
z-cz.import sys
async def f(): pass
sys.coro = f()
zYimport sys
async def f(): pass
sys.corocycle = [f()]
sys.corocycle.append(sys.corocycle)
r)r
r7rrr�&test_unawaited_warning_during_shutdown	s

zIUnawaitedWarningDuringShutdownTest.test_unawaited_warning_during_shutdownN)rrrrOrrrrrN
	rQrNc@r)�CAPITestcs0ddlm��fdd�}|�|��d�d�dS)Nr��	awaitTypec�s��tdg��}|IdHSr�r���future��atrrrG(	s�
z%CAPITest.test_tp_await_1.<locals>.foor()�	_testcapirRrKrrmrrUr�test_tp_await_1%	szCAPITest.test_tp_await_1cCs2ddlm}|tdg��}|�t|���d�dS)NrrQr()rWrRr�rKr)r)r
rVrTrrr�test_tp_await_2.	szCAPITest.test_tp_await_2cs^ddlm��fdd�}|�td��|�|��d�d�Wd�dS1s(wYdS)NrrQc�s��d�}|IdHSr�rrSrUrrrG7	s�
z%CAPITest.test_tp_await_3.<locals>.fooz.__await__.*returned non-iterator of type 'int'r()rWrRrkrvrKrrmrrUr�test_tp_await_34	s�"�zCAPITest.test_tp_await_3N)rrrrXrYrZrrrrrP"	s	rP�__main__)!r@r�rMr�r~r`r#Zunittestr.�testrZtest.supportrrZtest.support.script_helperrrrr&r,�contextmanagerr2ZTestCaser4rDrRr&r2rNZcpython_onlyrPrr�rrrr�<module>s\
w*�