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.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
Csv|jtjtjhvsJ�g}d}	z
|�|�d��Wnty9}z|jr*|jdnd}WYd}~||fSd}~wwq)NTr)�	__class__�types�
GeneratorType�
CoroutineType�append�send�
StopIteration�args)�coro�buffer�result�exrrr�	run_async s
���r*c
Cs�|jtjusJ�|��}g}d}d}	z|dr |�t|��n|�|�d��|d7}WntyL}z|jr=|jdnd}WYd}~||fSd}~wwq)NrT��)	rrr!rr"�nextr#r$r%)r&�awr'r(�ir)rrr�run_async__await__.s$
���r0ccsH�t���t�d�dVt��Wd�dS1swYdS)N�ignore)�warnings�catch_warnings�simplefilterr�
gc_collectrrrr�silence_coro_gcAs�


"�r6c@�,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
Zsamplesr;rrr�test_badsyntax_1Ks6����z#AsyncBadSyntaxTest.test_badsyntax_1c
Cr9)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)r:r<r=r>rBrrr�test_badsyntax_2�s"����z#AsyncBadSyntaxTest.test_badsyntax_2cCs<|�t��tddd�Wd�dS1swYdS)Nz	async = 1r<r=)r?r@rArrrr�test_badsyntax_3�s"�z#AsyncBadSyntaxTest.test_badsyntax_3c
Cr9)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
            r:r<r=r>rBrrr�test_badsyntax_4�s-����z#AsyncBadSyntaxTest.test_badsyntax_4N)rrrrCrDrErFrrrrr8Is;'r8c@�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�joinr=�assertEqual�
assertTrue�inspectZiscoroutinefunction)r
�bufr/�nsrrr�test_oneline_defs�s
z#TokenizerRegrTest.test_oneline_defsN)rrrrTrrrrrH��rHc@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
rXrrr�
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�
rrrrrrK���z&CoroutineTest.test_func_1.<locals>.foor^cS�dSr
rrrrr�bar�z&CoroutineTest.test_func_1.<locals>.bar)�assertIsInstancerr!rP�bool�__code__�co_flagsrQZCO_COROUTINErYZCO_GENERATOR�cr_coderOr*r0)r
rK�frarrr�test_func_1�szCoroutineTest.test_func_1cC�Ddd�}|�td��t|��Wd�dS1swYdS)Nc���t�r
�r$rrrrrKr_z&CoroutineTest.test_func_2.<locals>.foozcoroutine raised StopIteration)�assertRaisesRegex�RuntimeErrorr*�r
rKrrr�test_func_2s�"�zCoroutineTest.test_func_2cCs*dd�}|�}|�t|�d�|��dS)Nc�rkr
rlrrrrrKr_z&CoroutineTest.test_func_3.<locals>.fooz^<coroutine object.* at 0x.*>$)�assertRegex�repr�close)r
rKr&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�rkr
rlrrrrrK!r_z&CoroutineTest.test_func_4.<locals>.fooc���td�S�Nz"'coroutine' object is not iterable�rm�	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�iterrs)r
rKr&�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,rrrrrra>��
z&CoroutineTest.test_func_5.<locals>.barc�����IdHdSr
rr�rarrrKBrz&CoroutineTest.test_func_5.<locals>.foocrurvrwrrrrryErzz+CoroutineTest.test_func_5.<locals>.<lambda>r,cSr{rr)r}�elrrrr~Qrz-CoroutineTest.test_func_5.<locals>.<listcomp>�r,)r�	coroutinersrOr�r-r�)r
rKr�r&r�r)rar
r�test_func_5=s 
��
zCoroutineTest.test_func_5cs~tjdd����fdd�}|�}|�|�d�d�|�|�d�d�|�t��|�d�Wd�dS1s8wYdS)Ncss�dVdVdS�Nr,r+rrrrrraVs�
z&CoroutineTest.test_func_6.<locals>.barc�r�r
rrr�rrrK[rz&CoroutineTest.test_func_6.<locals>.foor,r+)rr�rOr#r?r$)r
rKrhrr�r�test_func_6Us
"�zCoroutineTest.test_func_6cs\dd�}|���fdd�}|�td��
t|��Wd�n1s#wY���dS)Nc�r\r]rrrrrraer_z&CoroutineTest.test_func_7.<locals>.barc3s��EdHdSr
rr�r&rrrKi��z&CoroutineTest.test_func_7.<locals>.foozCcannot 'yield from' a coroutine object in a non-coroutine generator)rmrxr�rs�r
rarKrr�r�test_func_7ds��zCoroutineTest.test_func_7csBtj�fdd��}dd�}|��|�t|��gdf����dS)Nc3s��EdHSr
rrr�rrraur�z&CoroutineTest.test_func_8.<locals>.barc�r\�N�spamrrrrrrKyr_z&CoroutineTest.test_func_8.<locals>.foor�)rr�rOr*rsr�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
rrrrrrK�r_z&CoroutineTest.test_func_9.<locals>.fooz0coroutine '.*test_func_9.*foo' was never awaited)ZassertWarnsRegex�RuntimeWarningrr5r?rx)r
rK�_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)�NrrrX�s���z'CoroutineTest.test_func_10.<locals>.genc�r�r
rr�rXrrrK�rz'CoroutineTest.test_func_10.<locals>.foor^r�r,�f)rr�r�assertIsr�r-rOr#rsr?r��throw)r
rKr&r.r)r�rXr�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�dirrrrrs)r
r�r&rrr�test_func_11�szCoroutineTest.test_func_11csN�fdd�}|��|�td����d�Wd�dS1s wYdS)Nc�s���d�}tIdHdSr
)r#rKrI��merr�g�s�
z%CoroutineTest.test_func_12.<locals>.gzcoroutine already executing)rm�
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�)rmrxr#rs)r
r�r&rrr�test_func_13�s��zCoroutineTest.test_func_13csdtjdd����fdd�}|�}|�d�|�td��
|��Wd�dS1s+wYdS)NcsrWr
rrrrrrX�r�z'CoroutineTest.test_func_14.<locals>.genc�s6�z	��IdHWdSty��IdHYdSwr
��
GeneratorExitrr�rrr&�s��z(CoroutineTest.test_func_14.<locals>.corozcoroutine ignored GeneratorExit)rr�r#rmrnrs)r
r&�crr�r�test_func_14�s

�
"�zCoroutineTest.test_func_14cCs�dd�}dd�}|�}|�td��||��d�Wd�n1s#wY|�td��||��d�Wd�dS1sAwYdS)Nc�r\r�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)rmr$r#rn)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)
NcsrWr
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)rr�r#rm�	Exceptionr�rn)r
r#r�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�r\r�rrrrrr�r_z-CoroutineTest.test_func_17.<locals>.coroutiner�r�r�)rmr$r#rnr�r�rs)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�r\r�rrrrrr�1r_z-CoroutineTest.test_func_18.<locals>.coroutiner�r�r�)
rr�rmr$r#rnr-r�r�rs)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)�CHKrrrKYs��z'CoroutineTest.test_func_19.<locals>.fooc�r�r
rr)rKrrr�brz-CoroutineTest.test_func_19.<locals>.coroutiner,�)rr�r#rOrsrL)r
r�r&r�r)r�rKr�test_func_19Vs

�zCoroutineTest.test_func_19cCs&dd�}t|��}|�|gdf�dS)Nc�r\)N�r^rrrrrrKur_z7CoroutineTest.test_coro_wrapper_send_tuple.<locals>.foor�)r0rO�r
rKr(rrr�test_coro_wrapper_send_tuplets
z*CoroutineTest.test_coro_wrapper_send_tuplecCs8dd�}t|��}|�|dt�|�|djd�dS)Nc�s
�td�Sr]rlrrrrrK|s�z?CoroutineTest.test_coro_wrapper_send_stop_iterator.<locals>.foor,r^)r0rcr$rOrr�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
)rOrQ�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�)rr�rOrQr�ZCORO_CREATEDr�r�r#ZCORO_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
rrrrrrh�r�z(CoroutineTest.test_corotype_1.<locals>.fzcoroutine object)rr!r�r#�__doc__rsr��__dict__rOrrr)r
�ctrhr�rrr�test_corotype_1�szCoroutineTest.test_corotype_1cCrj)Nc�s�dIdHdSr�rrrrrrK�r�z'CoroutineTest.test_await_1.<locals>.foozobject int can.t.*await�rmrxr*rorrr�test_await_1�s"�zCoroutineTest.test_await_1cCrj)Nc�s�gIdHdSr
rrrrrrK�r�z'CoroutineTest.test_await_2.<locals>.foozobject list can.t.*awaitr�rorrr�test_await_2�s"�zCoroutineTest.test_await_2cCs@dd�}|�t|��gd�df�|�t|��gd�df�dS)Nc�s�tgd��IdHdS)N�r,r+r�)rrrrrrK���z'CoroutineTest.test_await_3.<locals>.foor�)rOr*r0rorrr�test_await_3�szCoroutineTest.test_await_3cs.dd���fdd�}|�t|��gdf�dS)Nc�r\�N�*rrrrrra�r_z'CoroutineTest.test_await_4.<locals>.barc�����IdHSr
rrr�rrrK�rz'CoroutineTest.test_await_4.<locals>.foor��rOr*rorr�r�test_await_4�szCoroutineTest.test_await_4c�VGdd�d���fdd�}|�td��t|��Wd�dS1s$wYdS)Nc@rG)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�rrrK�rz'CoroutineTest.test_await_5.<locals>.foo�(__await__.*returned non-iterator of typer�rorr�r�test_await_5���"�zCoroutineTest.test_await_5cs6Gdd�d���fdd�}|�t|��dgdf�dS)Nc@rG)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�rrrK�rz'CoroutineTest.test_await_6.<locals>.foor�r�rorr�r�test_await_6�szCoroutineTest.test_await_6cs6Gdd�d���fdd�}|�t|��dgdf�dS)Nc@rG)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�rrrK�rz'CoroutineTest.test_await_7.<locals>.foor�r�r�rorr�r�test_await_7�szCoroutineTest.test_await_7cr�)Nc@�eZdZdS)z-CoroutineTest.test_await_8.<locals>.AwaitableN�rrrrrrrr���r�c�r�r
rrr�rrrK�s�z'CoroutineTest.test_await_8.<locals>.fooz4object Awaitable can't be used in 'await' expressionr�rorr�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�r\r�rrrrrra�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�rrryrbz9CoroutineTest.test_await_9.<locals>.foo.<locals>.<lambda>cseZdZ�ZdS)z3CoroutineTest.test_await_9.<locals>.foo.<locals>.DBN)rrrr�rr�rr�DBsr����r�)Zdbr��rar�rrrKs�,��z'CoroutineTest.test_await_9.<locals>.fooc�s���IdHSr
rrr�rr�foo2	r�z(CoroutineTest.test_await_9.<locals>.foo2i��i���r��r
rKr�rr�r�test_await_9�s	zCoroutineTest.test_await_9cs:dd���fdd���fdd�}|�t|��gdf�dS)Nc�r\r�rrrrr�bazr_z(CoroutineTest.test_await_10.<locals>.bazc�s���Sr
rr)r�rrra��z(CoroutineTest.test_await_10.<locals>.barc�s���IdHIdHSr
rrr�rrrK��z(CoroutineTest.test_await_10.<locals>.foor�r�ror)rar�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�r\r�rrrrrrar_z(CoroutineTest.test_await_11.<locals>.barc�s����IdHd�S)Nrrr�rarrrrK"rz(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�r\r�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�rrrK3rz(CoroutineTest.test_await_12.<locals>.fooz"__await__\(\) returned a coroutine)rmrxr*rs)r
r&rKr)r�r�r�
test_await_12*s��zCoroutineTest.test_await_12cr�)Nc@rG)z.CoroutineTest.test_await_13.<locals>.AwaitablecSrr
rrrrrr>r�z8CoroutineTest.test_await_13.<locals>.Awaitable.__await__Nr�rrrrr�=r�r�c�r�r
rrr�rrrKArz(CoroutineTest.test_await_13.<locals>.foor�r�rorr�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>.WrappercSs|jtjusJ�||_dSr
)rrr!r&)r
r&rrrrLs
z5CoroutineTest.test_await_14.<locals>.Wrapper.__init__cSs
|j��Sr
)r&rrrrrrOrz6CoroutineTest.test_await_14.<locals>.Wrapper.__await__Nrrrrr�WrapperJsrc@rG)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�r
c�s$�z��IdHWSty��wr
r�r)rr
rr�coro1Ys��z*CoroutineTest.test_await_14.<locals>.coro1c�s�����IdHSr
rr)rrrr�coro2^rz*CoroutineTest.test_await_14.<locals>.coro2r�)r�r#rmr$r?r�r�)r
rr�r)rr
rrr�
test_await_14Is
�
"�zCoroutineTest.test_await_14csrtjdd����fdd�}dd�}|�}|�d�|�td��||��d�Wd�dS1s2wYdS)NcsrWr
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)rr�r#rmrn)r
r�rr&rr�r�
test_await_15ks

�"�zCoroutineTest.test_await_15cs2dd���fdd�}t|��\}}|�|j�dS)Nc�s�t�Sr
)r�rrrrrh�r�z&CoroutineTest.test_await_16.<locals>.fc�s�zt���IdHYSr
)�KeyErrorr�rhrrr��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��rrrrK��
�$
X�z&CoroutineTest.test_with_1.<locals>.foo)	z	enter-1-Az	enter-2-Az	enter-1-Bz	enter-2-B)r!r rzexit-1-Bzexit-2-Bzexit-1-Azexit-2-Ac
�r)Nr �Cr!r,rr)r�r�r"rrrK�r#)r*rOr?r�)r
rKrhr(r�rr"r�test_with_1�s�"�zCoroutineTest.test_with_1c�fGdd�d��d���fdd�}|�td��
t|��Wd�n1s&wY|��d�dS)Nc@rG)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_executedrrrK��
�.�z&CoroutineTest.test_with_2.<locals>.foorF�rm�AttributeErrorr*r�rorr*r�test_with_2���zCoroutineTest.test_with_2cr&)Nc@rG)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*rrrK�r+z&CoroutineTest.test_with_3.<locals>.foorFr,rorr*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*rrrK�r+z&CoroutineTest.test_with_4.<locals>.foorFr,rorr*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,)rOr�r'r
rrr��s�.�z'CoroutineTest.test_with_5.<locals>.func)r?�AssertionErrorr*)r
r�rr5r�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__cWr8�Ni�r�r
�errrr�r�z/CoroutineTest.test_with_6.<locals>.CM.__aexit__Nr4rrrrr'�rr'c	�sB���4IdH�Wd�IdHdS1IdHswYdSr
rr�r'rrrK�s�.�z&CoroutineTest.test_with_6.<locals>.foozV'async with' received an object from __aenter__ that does not implement __await__: intr�rorr=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�r2r
rrrrrrr_z0CoroutineTest.test_with_7.<locals>.CM.__aenter__cWr8)Ni�rr;rrrrr�z/CoroutineTest.test_with_7.<locals>.CM.__aexit__Nr4rrrrr'
rr'c	�sJ���4IdH�ddWd�IdHdS1IdHswYdS�Nr,rrrr=rrrKs�
.�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*rxrqr%rPr�
isinstancer��fail�r
rKr3rr=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�r2r
rrrrrr'r_z0CoroutineTest.test_with_8.<locals>.CM.__aenter__cWr8r:rr;rrrr*r�z/CoroutineTest.test_with_8.<locals>.CM.__aexit__Nr4rrrrr'&rr'c	��J���4IdH��d7�Wd�IdHdS1IdHswYdSr�rr�r'�CNTrrrK.��
.�z&CoroutineTest.test_with_8.<locals>.foor@r,c
�s\�td�D]&}��4IdH��d7�	Wd�IdHdS1IdHs&wYqdS�Nr+r,�rLrIrFrrrK:s�0��r+c
�sX�td�D]$}��4IdH��d7�	Wd�IdHq1IdHs$wYqdSrIrJrIrFrrrKHs�,��r�c	�sL���4IdH��d7�	Wd�IdHdS1IdHswYdSr�rrrFrrrKVs
�0��)rmrxr*rOrorrFr�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�r2r
rrrrrrgr_z0CoroutineTest.test_with_9.<locals>.CM.__aenter__c���dddSr?rr;rrrrjrz/CoroutineTest.test_with_9.<locals>.CM.__aexit__Nr4rrrrr'frr'c	�rEr�rrrFrrrKmrHz&CoroutineTest.test_with_9.<locals>.foor,�r?r�r*rOrorrFr�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�r2r
rrrrrr{r_z1CoroutineTest.test_with_10.<locals>.CM.__aenter__c�rNr?rr;rrrr~rz0CoroutineTest.test_with_10.<locals>.CM.__aexit__Nr4rrrrr'zrr'c
�sl���4IdH�!��4IdH�t�1IdHswYWd�IdHdS1IdHs/wYdSr
�rnrrFrrrK�s��.�z'CoroutineTest.test_with_10.<locals>.fooz*exception from __aexit__ did not propagate)r*r�rPrrArnrBrCrrFr�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�rkr
)�NotImplementedErrorrrrrr�r_z1CoroutineTest.test_with_11.<locals>.CM.__aenter__c�rNr?rr;rrrr�rz0CoroutineTest.test_with_11.<locals>.CM.__aexit__Nr4rrrrr'�rr'c	�s0���4IdH�t�1IdHswYdSr
rQrrFrrrK�s��z'CoroutineTest.test_with_11.<locals>.fooz+exception from __aenter__ did not propagate)r*rSrPrrBrCrrFr�test_with_11�s��zCoroutineTest.test_with_11cs0d�Gdd�d�����fdd�}t|��dS)Nrc@r)z&CoroutineTest.test_with_12.<locals>.CMc�r2r
rrrrrr�r_z1CoroutineTest.test_with_12.<locals>.CM.__aenter__c�r\�NTrr;rrrr�r_z0CoroutineTest.test_with_12.<locals>.CM.__aexit__Nr4rrrrr'�rr'c	�s>���4IdH�
}��|j��t�1IdHswYdSr
)r�rrn��cm�r'rGr
rrrK�s
��z'CoroutineTest.test_with_12.<locals>.foo)r*rorrXr�test_with_12�szCoroutineTest.test_with_12crM)Nrc@r)z&CoroutineTest.test_with_13.<locals>.CMc�rNr?rrrrrr�rz1CoroutineTest.test_with_13.<locals>.CM.__aenter__c�r\rUrr;rrrr�r_z0CoroutineTest.test_with_13.<locals>.CM.__aexit__Nr4rrrrr'�rr'c	�sX��d7���4IdH��d7�Wd�IdHn1IdHs!wY�d7�dS)Nr,r��'rrrFrrrK�s�
(�z'CoroutineTest.test_with_13.<locals>.foor,rOrorrFr�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�NrrIrrrrr�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,r^r�)r/r�StopAsyncIterationrrrr�	__anext__�s�

z5CoroutineTest.test_for_1.<locals>.AsyncIter.__anext__N�rrrrr`rbrr^rr�	AsyncIter�srdc�s.���2z3dHW\}}��||�q6dSr
�r")Zi1Zi2�rdr'rr�test1�s��z'CoroutineTest.test_for_1.<locals>.test1r,cS�g|]}|d�qS�r�rr|rrrr~��z,CoroutineTest.test_for_1.<locals>.<listcomp>�cSrh)r+rr|rrrr~�rj�ec�sN���2z3dHW}��|d�|ddkrnq6��d���d�dS�Nr��what?�endrerIrfrr�test2�s���
z'CoroutineTest.test_for_1.<locals>.test2r+r���cSr{rrr|rrrr~r�rpc�sL���2z3dHW}|ddkrq��|d�q6��d���d�dSrmrerIrfrr�test3s��
z'CoroutineTest.test_for_1.<locals>.test3r�cSrhrirr|rrrr~rjcSr{rrr|rrrr~rro)r*rOrL)r
rg�yieldedr�rqrtr)rdr_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��printrI��tuprrrK��
�z%CoroutineTest.test_for_2.<locals>.fooz/async for' requires an object.*__aiter__.*tuple��sys�getrefcountrmrxr*rO)r
�refs_beforerKrr{r�
test_for_2s
��zCoroutineTest.test_for_2c�vGdd�d�}|��t���}�fdd�}|�td��
t|��Wd�n1s+wY|�t���|�dS)Nc@rG)z#CoroutineTest.test_for_3.<locals>.IcSrr
rrrrrr`'r�z-CoroutineTest.test_for_3.<locals>.I.__aiter__N�rrrr`rrrr�I&r�r�c�rwrxryrI��aiterrrrK-r}z%CoroutineTest.test_for_3.<locals>.fooz!that does not implement __anext__r~�r
r�r�rKrr�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__cSr8)Nrrrrrrrb>r�z-CoroutineTest.test_for_4.<locals>.I.__anext__N)rrrr`rbrrrrr�:rr�c�rwrxryrIr�rrrKDr}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)NrZrr�r�rrrT��z4CoroutineTest.test_for_6.<locals>.Manager.__aenter__c�r�)Ni��rrr�rrrXr�z3CoroutineTest.test_for_6.<locals>.Manager.__aexit__Nr4rr�rrrSsrc@r)z*CoroutineTest.test_for_6.<locals>.IterablecSr\r]rIrrrrr]rz3CoroutineTest.test_for_6.<locals>.Iterable.__init__cSrr
rrrrrr``r�z4CoroutineTest.test_for_6.<locals>.Iterable.__aiter__c�s$�|jdkrt�|jd7_|jS�Nr^r,)r/rarrrrrbcs
�
z4CoroutineTest.test_for_6.<locals>.Iterable.__anext__Nrcrrrr�Iterable\sr�c	�sb��4IdH��2z
3dHW}�d7�q
6Wd�IdHn1IdHs&wY�d7�dS�Nr,r�rrI)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�rrI�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�rrIr�rrr��s"�
�
(�
�
(�i��9)rr�r2r3r4r*rO)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@rG)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,r^rrI�r�rGrrrK��
�
�z%CoroutineTest.test_for_7.<locals>.foorOrorr�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@rG)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�rrIr�rrrK�r�z%CoroutineTest.test_for_8.<locals>.foor�)r?r�r2r3r4r*rOrorr�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
rrrrrrb�r�z.CoroutineTest.test_for_11.<locals>.F.__anext__cSr�r?rrrrrr�r�z.CoroutineTest.test_for_11.<locals>.F.__await__N)rrrr`rbrrrrr�F�sr�c�s���2z3dHW}q6dSr
r)r��r�rrr��s��z'CoroutineTest.test_for_11.<locals>.mainz an invalid object from __anext__)rmrxr#�	exceptionrc�	__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/�lenrarrrrrb�s
�z5CoroutineTest.test_for_tuple.<locals>.AIter.__anext__N�rrrr/r`rbrrrr�AIter��r�c�s*��dg�2z3dHW}��|�q6��r�rerI�r�r�r(rrrK�s
��z)CoroutineTest.test_for_tuple.<locals>.foor�)r�r�r?r#rOrorr�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/rarrrrrrb�s
�z>CoroutineTest.test_for_stop_iteration.<locals>.AIter.__anext__Nr�rrrrr��r�r�c�s(��d�2z3dHW}��|�q6��r�rerIr�rrrKs
��z2CoroutineTest.test_for_stop_iteration.<locals>.foor�)r�r$r?r#rOrorr�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�r2r
rrIrrrrhr_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�r2r
rrIrrrrh$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>r^�rnrrrrrr�/s���z*CoroutineTest.test_comp_2.<locals>.run_set>r^rnr�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>r^rnrrrrr�run_set2:s��z+CoroutineTest.test_comp_2.<locals>.run_set2r^rnr�)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/rrrrhD���z$CoroutineTest.test_comp_3.<locals>.fc���dd��ddg�2�IdHS)Nc�� �g|z
3dHW}|d�q6Sr�rr|rrrr~I��z?CoroutineTest.test_comp_3.<locals>.run_list.<locals>.<listcomp>r^rnrrrrrr�H��z+CoroutineTest.test_comp_3.<locals>.run_listrkrsc�r�)Nc�s �h|z
3dHW}|d�q6Sr�rr|rrrr�Or�z=CoroutineTest.test_comp_3.<locals>.run_set.<locals>.<setcomp>r^rnrrrrrr�Nr�z*CoroutineTest.test_comp_3.<locals>.run_setc�r�)Nc�s&�i|z
3dHW}|d|d�q6Sr�rr|rrrr�Us�$z?CoroutineTest.test_comp_3.<locals>.run_dict.<locals>.<dictcomp>r^rnrrrrr�run_dictTr�z+CoroutineTest.test_comp_3.<locals>.run_dict��)rkrsc��,�dd��ddg�2�}dd�|2�IdHS)NcSs"�|z3dHW}|dVq6dSr�rr|rrr�	<genexpr>[�� z=CoroutineTest.test_comp_3.<locals>.run_gen.<locals>.<genexpr>r^rnc�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�rrrrhbr�z$CoroutineTest.test_comp_4.<locals>.fc�r�)Nc�s(�g|z3dHW}|dkr|d�q6Sr�rr|rrrr~g��&z?CoroutineTest.test_comp_4.<locals>.run_list.<locals>.<listcomp>r^rnrrrrrr�fr�z+CoroutineTest.test_comp_4.<locals>.run_listrsc�r�)Nc�s(�h|z3dHW}|dkr|d�q6Sr�rr|rrrr�mr�z=CoroutineTest.test_comp_4.<locals>.run_set.<locals>.<setcomp>r^rnrrrrrr�lr�z*CoroutineTest.test_comp_4.<locals>.run_setc�r�)Nc�s.�i|z3dHW}|dkr|d|d�q6S)Nr^r,r+rr|rrrr�ss�,z?CoroutineTest.test_comp_4.<locals>.run_dict.<locals>.<dictcomp>r^rnrrrrrr�rr�z+CoroutineTest.test_comp_4.<locals>.run_dictr�c�r�)NcSs*�|z3dHW}|dkr|dVq6dSr�rr|rrrr�ys�(z=CoroutineTest.test_comp_4.<locals>.run_gen.<locals>.<genexpr>r^rnc�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�rrrrh�r�z&CoroutineTest.test_comp_4_2.<locals>.fc���dd��td��2�IdHS)Nc�s8�g|z3dHW}d|krdkrnn|d�q6S�NrrKr^rr|rrrr~���6zACoroutineTest.test_comp_4_2.<locals>.run_list.<locals>.<listcomp>�rJrrrrr��r�z-CoroutineTest.test_comp_4_2.<locals>.run_list)rkr��
c�r�)Nc�s8�h|z3dHW}d|krdkrnn|d�q6Sr�rr|rrrr��r�z?CoroutineTest.test_comp_4_2.<locals>.run_set.<locals>.<setcomp>r�rJrrrrr��r�z,CoroutineTest.test_comp_4_2.<locals>.run_set>rkr�r�c�r�)Nc�s>�i|z3dHW}d|krdkrnn|d|d�q6S)NrrKr^r�rr|rrrr��s�<zACoroutineTest.test_comp_4_2.<locals>.run_dict.<locals>.<dictcomp>r�rJrrrrr��r�z-CoroutineTest.test_comp_4_2.<locals>.run_dictrlr��gc�s,�dd��td��2�}dd�|2�IdHS)NcSs:�|z3dHW}d|krdkrnn|dVq6dSr�rr|rrrr��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>rJr�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�rrrrh�r�z$CoroutineTest.test_comp_5.<locals>.fc�s&��fdd�ddgddgfD�IdHS)Nc	�sB�g|]}|ddkr�|�2z3dHW}|dkr|d�q6qS)rr^Nr�r,r)r}Zpairr/rrrr~�s��
�
z?CoroutineTest.test_comp_5.<locals>.run_list.<locals>.<listcomp>r^rnr��(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�rrrrh�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>)r^rn)r�rrrrrr��r�z+CoroutineTest.test_comp_6.<locals>.run_list)rkrs�r�r�rrr�test_comp_6�s
�zCoroutineTest.test_comp_6csPdd���fdd�}|�td��t|��Wd�dS1s!wYdS)NcSs�dVdVtd��)Nr,r+�aaa)r�rrrrrh�s�z$CoroutineTest.test_comp_7.<locals>.fc�s�dd���2�IdHS)Nc���g|z3dHW}|�q6Sr
rr|rrrr~���z?CoroutineTest.test_comp_7.<locals>.run_list.<locals>.<listcomp>rrrrrr��r�z+CoroutineTest.test_comp_7.<locals>.run_listr�)rmr�r*r�rrr�test_comp_7�s
"�zCoroutineTest.test_comp_7cCs&dd�}|�t|��ggd�f�dS)Nc�s�dd�dD�S)NcSr{rrr|rrrr~�rz8CoroutineTest.test_comp_8.<locals>.f.<locals>.<listcomp>r�rrrrrrh�r�z$CoroutineTest.test_comp_8.<locals>.fr�r��r
rhrrr�test_comp_8�s

�zCoroutineTest.test_comp_8cs2dd���fdd�}|�t|��gddgf�dS)NcSs�dVdVdSr�rrrrrrX�s�
z&CoroutineTest.test_comp_9.<locals>.genc�s&�dd���2�IdH}dd�|D�S)Nc�r�r
rr|rrrr~�r�z8CoroutineTest.test_comp_9.<locals>.f.<locals>.<listcomp>cSr{rrr|rrrr~�rr)�lr�rrrh�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|]}|�qSrrr|rrrr��rz8CoroutineTest.test_comp_10.<locals>.f.<locals>.<setcomp>r�cSsi|]}||�qSrr)r}�xrrrr��sz9CoroutineTest.test_comp_10.<locals>.f.<locals>.<dictcomp>r)�xxrrrrh�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?rx�copyrrs)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,)	rL�pickle�HIGHEST_PROTOCOLr?rx�
PicklingError�dumpsrrs)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)
r2r3r�catch_unraisable_exception�filterwarningsrrr5r��str�
unraisable�	exc_valuerO�object)r
r�rWr&�	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@rG)zMCoroutineTest.test_for_assign_raising_stop_async_iteration.<locals>.BadTargetcS�td��r��ra)r
�keyrrrr�__setitem__�zYCoroutineTest.test_for_assign_raising_stop_async_iteration.<locals>.BadTarget.__setitem__N)rrrrrrrr�	BadTargetr�rcSs�dVdSr]rrrrr�sourcer�zJCoroutineTest.test_for_assign_raising_stop_async_iteration.<locals>.sourcec�sZ���t��}��2z3dHW�d<q
6Wd�n1swY��|jjd�dS)Nr�r�rp�r?rarOr�r%rV�r
r�tgtrr�run_for����zKCoroutineTest.test_for_assign_raising_stop_async_iteration.<locals>.run_forrpc�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>rrprrVrrrr�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>rrp�	�asendr?rnrcr�r�rarOr%�rXr�rWrrrr�!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@rG)zQCoroutineTest.test_for_assign_raising_stop_async_iteration_2.<locals>.BadIterablecSrr�rrrrrr�-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)Nrrpr)rWr/�j�rr
rrr2rzMCoroutineTest.test_for_assign_raising_stop_async_iteration_2.<locals>.run_forrpc�sV���t��}dd���2�IdHWd�S1swY��|jjd�dS)Nc�s �g|z
3dHW\}}d�q6Sr]r�r}r/r rrrr~<r�zbCoroutineTest.test_for_assign_raising_stop_async_iteration_2.<locals>.run_list.<locals>.<listcomp>rrprrVr!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>rrprrr!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)rr�r#r�r�rO)r
r�r&Zlen_sendZ	len_throwr)r�r�r�test_stack_in_coroutine_throwKs


z+CoroutineTest.test_stack_in_coroutine_throwN)Srrrr[rirprtr�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�rrr	r
rrrr%r.r0r1r7r>rDrLrPrRrTrYr[rvr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr
rr#r&rrrrrV�s�	#
	(	


"(@H\ 
	
! rVc@rG)�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+r"r)r
�exc_type�exc_val�exc_tbr,rrrvs�z:CoroAsyncIOCompatTest.test_asyncio_1.<locals>.CM.__aexit__Nr4rr,rrr'osr'c	�sJ���4IdH�}��d�IdH��1IdHswY��d�dS)Nr*Zunreachable)r+r"r�r'r)r(r'rrrhzs��z/CoroAsyncIOCompatTest.test_asyncio_1.<locals>.f)r,r+r))	r�
import_moduler�Znew_event_loopZset_event_loopZrun_until_completersZset_event_loop_policyrO)r
rhZlooprr0r�test_asyncio_1es$

���z$CoroAsyncIOCompatTest.test_asyncio_1N)rrrr2rrrrr'crUr'c@r7)
�OriginTrackingTestcCst�t��j�}|j|jfSr
)rQZ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
)r9r�r:r
rr�nested�sz7OriginTrackingTest.test_origin_tracking.<locals>.nestedr=r����)
r�#get_coroutine_origin_tracking_depth�#set_coroutine_origin_tracking_depthrO�
contextlib�closingr��	cr_originr9rPr�r?r�)r
�
orig_depthr&Zfnamer7r=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
rrrrrr:�r_z?OriginTrackingTest.test_origin_tracking_warning.<locals>.corofnc���Sr
rr)r:rr�a1��z;OriginTrackingTest.test_origin_tracking_warning.<locals>.a1r+crEr
rr)rFrr�a2�rGz;OriginTrackingTest.test_origin_tracking_warning.<locals>.a2csXt�|���t��}��t��Wd�n1swY��|t|j��dSr
)	rr@ZassertWarnsr�rr5rOr�warning)�depth�msgrW)rHr
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
)r9rr?rrNr@)r
Za1_filenameZ	a1_linenoZa2_filenameZ	a2_linenor�rDrKr)rFrHr:r
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
rrrrrr:�r_zLOriginTrackingTest.test_unawaited_warning_when_module_broken.<locals>.corofncSsddSr?rr�rrrry�szNOriginTrackingTest.test_unawaited_warning_when_module_broken.<locals>.<lambda>zcoroutine .* was never awaited)r2�_warn_unawaited_coroutinerrrZcheck_warningsr�rrr5rOrrr-r�)r
r:Zorig_wucrWr&r	rrr�)test_unawaited_warning_when_module_broken�s<

������
�
�z<OriginTrackingTest.test_unawaited_warning_when_module_brokenN)rrrr9r;rLrNrrrrr3�s
.*r3c@rG)�"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
r;rrr�&test_unawaited_warning_during_shutdown	s

zIUnawaitedWarningDuringShutdownTest.test_unawaited_warning_during_shutdownN)rrrrPrrrrrO
	rUrOc@r)�CAPITestcs0ddlm��fdd�}|�|��d�d�dS)Nr��	awaitTypec�s��tdg��}|IdHSr�r���future��atrrrK(	s�
z%CAPITest.test_tp_await_1.<locals>.foor,)�	_testcapirSrOr#rorrVr�test_tp_await_1%	szCAPITest.test_tp_await_1cCs2ddlm}|tdg��}|�t|���d�dS)NrrRr,)rXrSr�rOr-r)r
rWrUrrr�test_tp_await_2.	szCAPITest.test_tp_await_2cs^ddlm��fdd�}|�td��|�|��d�d�Wd�dS1s(wYdS)NrrRc�s��d�}|IdHSr�rrTrVrrrK7	s�
z%CAPITest.test_tp_await_3.<locals>.fooz.__await__.*returned non-iterator of type 'int'r,)rXrSrmrxrOr#rorrVr�test_tp_await_34	s�"�zCAPITest.test_tp_await_3N)rrrrYrZr[rrrrrQ"	s	rQ�__main__)!rAr�rQr�rrr$Zunittestr2�testrZtest.supportrrZtest.support.script_helperrrrr*r0�contextmanagerr6ZTestCaser8rHrVr'r3rOZcpython_onlyrQrr�rrrr�<module>s\
w*�