Your IP : 216.73.216.196


Current Path : /opt/alt/python310/lib64/python3.10/test/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/test/__pycache__/test_coroutines.cpython-310.pyc

o

0�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�;/opt/alt/python310/lib64/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
Zbufr/�nsrrr�test_oneline_defs�s
z#TokenizerRegrTest.test_oneline_defsN)rrrrSrrrrrH��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
rWrrr�
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_COROUTINErXZCO_GENERATOR�cr_coderOr*r0)r
rK�fr`rrr�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�rjr
rkrrrrrKr^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�rjr
rkrrrrrK!r^z&CoroutineTest.test_func_4.<locals>.fooc���td�S�Nz"'coroutine' object is not iterable�rl�	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�iterrr)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,rrrrrr`>��
z&CoroutineTest.test_func_5.<locals>.barc�����IdHdSr
rr�r`rrrKBrz&CoroutineTest.test_func_5.<locals>.foocrtrurvrrrrrxEryz+CoroutineTest.test_func_5.<locals>.<lambda>r,cSrzrr)r|�elrrrr}Qr~z-CoroutineTest.test_func_5.<locals>.<listcomp>�r,)r�	coroutinerrrOr�r-r�)r
rKr�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�rrrK[rz&CoroutineTest.test_func_6.<locals>.foor,r+)rr�rOr#r?r$)r
rKrgrr�r�test_func_6Us
"�zCoroutineTest.test_func_6cs\dd�}|���fdd�}|�td��
t|��Wd�n1s#wY���dS)Nc�r[r\rrrrrr`er^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)rlrwrrr�r
r`rKrr�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�r[�N�spamrrrrrrKyr^z&CoroutineTest.test_func_8.<locals>.foor�)rr�rOr*rrr�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?rw)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)�NrrrW�s���z'CoroutineTest.test_func_10.<locals>.genc�r�r
rr�rWrrrK�rz'CoroutineTest.test_func_10.<locals>.foor]r�r,�f)rr�r�assertIsr�r-rOr#rrr?r��throw)r
rKr&r.r)r�rWr�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�dirrrqrr)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)rl�
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�)rlrwr#rr)r
r�r&rrr�test_func_13�s��zCoroutineTest.test_func_13csdtjdd����fdd�}|�}|�d�|�td��
|��Wd�dS1s+wYdS)NcsrVr
rrrrrrW�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#rlrmrr)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)rlr$r#rm)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)
NcsrVr
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#rl�	Exceptionr�rm)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�)rlr$r#rmr�r�rr)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�rlr$r#rmr-r�r�rr)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#rOrrrL)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\rkrrrrrK|s�z?CoroutineTest.test_coro_wrapper_send_stop_iterator.<locals>.foor,r])r0rbr$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
rrrrrrg�r�z(CoroutineTest.test_corotype_1.<locals>.fzcoroutine object)rr!r�r#�__doc__rrr��__dict__rOrrq)r
Zctrgr�rrr�test_corotype_1�szCoroutineTest.test_corotype_1cCri)Nc�s�dIdHdSr�rrrrrrK�r�z'CoroutineTest.test_await_1.<locals>.foozobject int can.t.*await�rlrwr*rnrrr�test_await_1�s"�zCoroutineTest.test_await_1cCri)Nc�s�gIdHdSr
rrrrrrK�r�z'CoroutineTest.test_await_2.<locals>.foozobject list can.t.*awaitr�rnrrr�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*r0rnrrr�test_await_3�szCoroutineTest.test_await_3cs.dd���fdd�}|�t|��gdf�dS)Nc�r[�N�*rrrrrr`�r^z'CoroutineTest.test_await_4.<locals>.barc�����IdHSr
rrr�rrrK�rz'CoroutineTest.test_await_4.<locals>.foor��rOr*rnrr�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�rnrr�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�rnrr�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�rnrr�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�rnrr�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�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�rrrxraz9CoroutineTest.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�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�rrr`��z(CoroutineTest.test_await_10.<locals>.barc�s���IdHIdHSr
rrr�rrrK��z(CoroutineTest.test_await_10.<locals>.foor�r�rnr)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�r[r�rrrrrr`r^z(CoroutineTest.test_await_11.<locals>.barc�s����IdHd�S)Nrrr�r`rrrrK"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�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)rlrwr*rr)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�rnrr�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r	c@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�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�r#rlr$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)NcsrVr
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#rlrm)r
r�rr&rr�r�
test_await_15ks

�"�zCoroutineTest.test_await_15cs2dd���fdd�}t|��\}}|�|j�dS)Nc�s�t�Sr
)r�rrrrrg�r�z&CoroutineTest.test_await_16.<locals>.fc�s�zt���IdHYSr
)�KeyErrorr�rgrrr��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)rrrzexit-1-Bzexit-2-Bzexit-1-Azexit-2-Ac
�r)Nr�Crr,rr)r�r�r rrrK�r!)r*rOr?r�)r
rKrgr(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�rl�AttributeErrorr*r�rnrr(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*rnrr(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*rnrr(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�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%rrrK�s�.�z&CoroutineTest.test_with_6.<locals>.foozV'async with' received an object from __aenter__ that does not implement __await__: intr�rnrr;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;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*rwrpr%rPr�
isinstancer��fail�r
rKr1rr;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%�CNTrrrK.��
.�z&CoroutineTest.test_with_8.<locals>.foor>r,c
�s\�td�D]&}��4IdH��d7�	Wd�IdHdS1IdHs&wYqdS�Nr+r,�rLrIrDrrrK:s�0��r+c
�sX�td�D]$}��4IdH��d7�	Wd�IdHq1IdHs$wYqdSrGrHrIrDrrrKHs�,��r�c	�sL���4IdH��d7�	Wd�IdHdS1IdHswYdSr�rrrDrrrKVs
�0��)rlrwr*rOrnrrDr�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�rrrDrrrKmrFz&CoroutineTest.test_with_9.<locals>.foor,�r?r�r*rOrnrrDr�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
�rmrrDrrrK�s��.�z'CoroutineTest.test_with_10.<locals>.fooz*exception from __aexit__ did not propagate)r*r�rPrr?rmr@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�rjr
)�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
rOrrDrrrK�s��z'CoroutineTest.test_with_11.<locals>.fooz+exception from __aenter__ did not propagate)r*rQrPrr@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�r[�NTrr9rrrr�r^z0CoroutineTest.test_with_12.<locals>.CM.__aexit__Nr2rrrrr%�rr%c	�s>���4IdH�
}��|j��t�1IdHswYdSr
)r�rrm��cm�r%rEr
rrrK�s
��z'CoroutineTest.test_with_12.<locals>.foo)r*rnrrVr�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�r[rSrr9rrrr�r^z0CoroutineTest.test_with_13.<locals>.CM.__aexit__Nr2rrrrr%�rr%c	�sX��d7���4IdH��d7�Wd�IdHn1IdHs!wY�d7�dS)Nr,r��'rrrDrrrK�s�
(�z'CoroutineTest.test_with_13.<locals>.foor,rMrnrrDr�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^r`rr\rr�	AsyncIter�srbc�s.���2z3dHW\}}��||�q6dSr
�r")Zi1Zi2�rbr'rr�test1�s��z'CoroutineTest.test_for_1.<locals>.test1r,cS�g|]}|d�qS�r�rr{rrrr}��z,CoroutineTest.test_for_1.<locals>.<listcomp>�cSrf)r+rr{rrrr}�rh�ec�sN���2z3dHW}��|d�|ddkrnq6��d���d�dS�Nr��what?�endrcrIrdrr�test2�s���
z'CoroutineTest.test_for_1.<locals>.test2r+r���cSrzrrr{rrrr}r~�rnc�sL���2z3dHW}|ddkrq��|d�q6��d���d�dSrkrcrIrdrr�test3s��
z'CoroutineTest.test_for_1.<locals>.test3r�cSrfrgrr{rrrr}rhcSrzrrr{rrrr}r~rm)r*rOrL)r
reZyieldedr�rorrr)rbr]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�getrefcountrlrwr*rO)r
�refs_beforerKrrxr�
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�rtrurvrI��aiterrrrK-rzz%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__cSr6)Nrrrrrrr`>r�z-CoroutineTest.test_for_4.<locals>.I.__anext__N)rrrr^r`rrrrr�:rr�c�rtrurvrIr�rrrKDrzz%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)NrXrr�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>.IterablecSrZr[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/r_rrrrr`cs
�
z4CoroutineTest.test_for_6.<locals>.Iterable.__anext__Nrarrrr�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)r|r}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�rErrrK��
�
�z%CoroutineTest.test_for_7.<locals>.foorMrnrr�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*rOrnrr�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
rrrrrr`�r�z.CoroutineTest.test_for_11.<locals>.F.__anext__cSr�r=rrrrrr�r�z.CoroutineTest.test_for_11.<locals>.F.__await__N)rrrr^r`rrrrr�F�sr�c�s���2z3dHW}q6dSr
r)r��r�rrr��s��z'CoroutineTest.test_for_11.<locals>.mainz an invalid object from __anext__)rlrwr#�	exceptionrb�	__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_rrrrr`�s
�z5CoroutineTest.test_for_tuple.<locals>.AIter.__anext__N�rrrr/r^r`rrrr�AIter��r�c�s*��dg�2z3dHW}��|�q6��r�rcrI�r�r�r(rrrK�s
��z)CoroutineTest.test_for_tuple.<locals>.foor�)r�r�r?r#rOrnrr�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_rrrrrr`�s
�z>CoroutineTest.test_for_stop_iteration.<locals>.AIter.__anext__Nr�rrrrr��r�r�c�s(��d�2z3dHW}��|�q6��r�rcrIr�rrrKs
��z2CoroutineTest.test_for_stop_iteration.<locals>.foor�)r�r$r?r#rOrnrr�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
rrIrrrrgr^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
rrIrrrrg$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]�rlrrrrrr�/s���z*CoroutineTest.test_comp_2.<locals>.run_set>r]rlr�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]rlrrrrr�run_set2:s��z+CoroutineTest.test_comp_2.<locals>.run_set2r]rlr�)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/rrrrgD���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]rlrrrrrr�H��z+CoroutineTest.test_comp_3.<locals>.run_listrirqc�r�)Nc�s �h|z
3dHW}|d�q6Sr�rr{rrrr�Or�z=CoroutineTest.test_comp_3.<locals>.run_set.<locals>.<setcomp>r]rlrrrrrr�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]rlrrrrr�run_dictTr�z+CoroutineTest.test_comp_3.<locals>.run_dict��)rirqc��,�dd��ddg�2�}dd�|2�IdHS)NcSs"�|z3dHW}|dVq6dSr�rr{rrr�	<genexpr>[�� z=CoroutineTest.test_comp_3.<locals>.run_gen.<locals>.<genexpr>r]rlc�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�rrrrgbr�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]rlrrrrrr�fr�z+CoroutineTest.test_comp_4.<locals>.run_listrqc�r�)Nc�s(�h|z3dHW}|dkr|d�q6Sr�rr{rrrr�mr�z=CoroutineTest.test_comp_4.<locals>.run_set.<locals>.<setcomp>r]rlrrrrrr�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]rlrrrrrr�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]rlc�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�rrrrg�r�z&CoroutineTest.test_comp_4_2.<locals>.fc���dd��td��2�IdHS)Nc�s8�g|z3dHW}d|krdkrnn|d�q6S�NrrIr]rr{rrrr}���6zACoroutineTest.test_comp_4_2.<locals>.run_list.<locals>.<listcomp>�rHrrrrr��r�z-CoroutineTest.test_comp_4_2.<locals>.run_list)rir��
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�rHrrrrr��r�z,CoroutineTest.test_comp_4_2.<locals>.run_set>rir�r�c�r�)Nc�s>�i|z3dHW}d|krdkrnn|d|d�q6S)NrrIr]r�rr{rrrr��s�<zACoroutineTest.test_comp_4_2.<locals>.run_dict.<locals>.<dictcomp>r�rHrrrrr��r�z-CoroutineTest.test_comp_4_2.<locals>.run_dictrjr��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>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�rrrrg�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]rlr��(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�rrrrg�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]rl)r�rrrrrr��r�z+CoroutineTest.test_comp_6.<locals>.run_list)rirq�r�r�rrr�test_comp_6�s
�zCoroutineTest.test_comp_6csPdd���fdd�}|�td��t|��Wd�dS1s!wYdS)NcSs�dVdVtd��)Nr,r+�aaa)r�rrrrrg�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�)rlr�r*r�rrr�test_comp_7�s
"�zCoroutineTest.test_comp_7cCs&dd�}|�t|��ggd�f�dS)Nc�s�dd�dD�S)NcSrzrrr{rrrr}�r~z8CoroutineTest.test_comp_8.<locals>.f.<locals>.<listcomp>r�rrrrrrg�r�z$CoroutineTest.test_comp_8.<locals>.fr�r��r
rgrrr�test_comp_8�s

�zCoroutineTest.test_comp_8cs2dd���fdd�}|�t|��gddgf�dS)NcSs�dVdVdSr�rrrrrrW�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>cSrzrrr{rrrr}�r~r)�lr�rrrg�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��r~z8CoroutineTest.test_comp_10.<locals>.f.<locals>.<setcomp>r�cSsi|]}||�qSrr)r|�xrrrr��sz9CoroutineTest.test_comp_10.<locals>.f.<locals>.<dictcomp>r)Zxxrrrrg�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?rw�copyrrr)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�pickleZHIGHEST_PROTOCOLr?rwZ
PicklingError�dumpsrrr)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�filterwarningsrqr5r��str�
unraisable�	exc_valuerO�object)r
r�rUr&�	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��r_)r
�keyrrrr�__setitem__�zYCoroutineTest.test_for_assign_raising_stop_async_iteration.<locals>.BadTarget.__setitem__N)rrrrrrrr�	BadTargetr�r
cSs�dVdSr\rrrrr�sourcer�zJCoroutineTest.test_for_assign_raising_stop_async_iteration.<locals>.sourcec�sZ���t��}��2z3dHW�d<q
6Wd�n1swY��|jjd�dS)Nr�r�rn�r?r_rOr�r%rT�r
r�tgtrr�run_for����zKCoroutineTest.test_for_assign_raising_stop_async_iteration.<locals>.run_forrnc�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>rrnr
rTrrrr�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>rrn�	�asendr?rmrbr�r�r_rOr%�rWr�rUrrrr�!s�
�zKCoroutineTest.test_for_assign_raising_stop_async_iteration.<locals>.run_genr�)r
r
rr�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�rrrrrr�-r	zZCoroutineTest.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)Nrrnr
)rUr/�j�rr
rrr2rzMCoroutineTest.test_for_assign_raising_stop_async_iteration_2.<locals>.run_forrnc�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>rrnr
rTrrrr�: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[rrrrrr�Br�z`CoroutineTest.test_for_assign_raising_stop_async_iteration_2.<locals>.run_gen.<locals>.<genexpr>rrnrrrrrr�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)SrrrrZrhrorsr�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<rBrJrNrPrRrWrYrsrr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrr rrrrrU�s�	#
	(	


"(@H\ 
	
! rUc@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_typeZexc_valZexc_tbr&rrrvs�z:CoroAsyncIOCompatTest.test_asyncio_1.<locals>.CM.__aexit__Nr2rr&rrr%osr%c	�sJ���4IdH�}��d�IdH��1IdHswY��d�dS)Nr$Zunreachable)r%r"r�r%r#r"r'rrrgzs��z/CoroAsyncIOCompatTest.test_asyncio_1.<locals>.f)r,r+r#)	r�
import_moduler�Znew_event_loopZset_event_loopZrun_until_completerrZset_event_loop_policyrO)r
rgZlooprr(r�test_asyncio_1es$

���z$CoroAsyncIOCompatTest.test_asyncio_1N)rrrr*rrrrr!crTr!c@r7)
�OriginTrackingTestcCst�t��j�}|j|jfSr
)rQZgetframeinfoZ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
)r0r�r1r
rr�nested�sz7OriginTrackingTest.test_origin_tracking.<locals>.nestedr4r����)
r|�#get_coroutine_origin_tracking_depth�#set_coroutine_origin_tracking_depthrO�
contextlib�closingr��	cr_originr0rPr�r?r�)r
�
orig_depthr&Zfnamer.r4Znested_fnameZ
nested_linenorr3rr2�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
rrrrrr1�r^z?OriginTrackingTest.test_origin_tracking_warning.<locals>.corofnc���Sr
rr)r1rr�a1��z;OriginTrackingTest.test_origin_tracking_warning.<locals>.a1r+cr<r
rr)r=rr�a2�r>z;OriginTrackingTest.test_origin_tracking_warning.<locals>.a2csXt�|���t��}��t��Wd�n1swY��|t|j��dSr
)	r|r7ZassertWarnsr�rr5rOr�Zwarning)Zdepth�msgrU)r?r
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
)r0r|r6rrNr7)r
Za1_filenameZ	a1_linenoZa2_filenameZ	a2_linenor�r;r@r)r=r?r1r
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
rrrrrr1�r^zLOriginTrackingTest.test_unawaited_warning_when_module_broken.<locals>.corofncSsddSr=rr�rrrrx�szNOriginTrackingTest.test_unawaited_warning_when_module_broken.<locals>.<lambda>zcoroutine .* was never awaited)r2�_warn_unawaited_coroutinerr�rZcheck_warningsr�rqr5rOrrr'r�)r
r1Zorig_wucrUr&rrrr�)test_unawaited_warning_when_module_broken�s<

������
�
�z<OriginTrackingTest.test_unawaited_warning_when_module_brokenN)rrrr0r2rArCrrrrr+�s
.*r+c@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)rrrrErrrrrD
	rTrDc@r)�CAPITestcs0ddlm��fdd�}|�|��d�d�dS)Nr��	awaitTypec�s��tdg��}|IdHSr�r���future��atrrrK(	s�
z%CAPITest.test_tp_await_1.<locals>.foor,)�	_testcapirHrOr#rnrrKr�test_tp_await_1%	szCAPITest.test_tp_await_1cCs2ddlm}|tdg��}|�t|���d�dS)NrrGr,)rMrHr�rOr-r)r
rLrJrrr�test_tp_await_2.	szCAPITest.test_tp_await_2cs^ddlm��fdd�}|�td��|�|��d�d�Wd�dS1s(wYdS)NrrGc�s��d�}|IdHSr�rrIrKrrrK7	s�
z%CAPITest.test_tp_await_3.<locals>.fooz.__await__.*returned non-iterator of type 'int'r,)rMrHrlrwrOr#rnrrKr�test_tp_await_34	s�"�zCAPITest.test_tp_await_3N)rrrrNrOrPrrrrrF"	s	rF�__main__)!r8r�rQr�r|rrZunittestr2�testrZtest.supportrrZtest.support.script_helperrrrr*r0�contextmanagerr6ZTestCaser8rHrUr!r+rDZcpython_onlyrFrr�rrrr�<module>s\
w*�