%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /vddos/python/lib/python3.9/test/__pycache__/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : //vddos/python/lib/python3.9/test/__pycache__/test_dataclasses.cpython-39.opt-2.pyc
a

�_g*��@s�ddlTddlZddlZddlZddlZddlmZddlmZm	Z	m
Z
mZmZm
Z
mZmZmZddlmZddlmZmZmZddlmZddlZddlZGdd	�d	e�ZGd
d�dej�ZGdd
�d
ej�ZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�dej�ZGdd�dej�Z Gdd�dej�Z!Gdd�dej�Z"Gdd�dej�Z#Gdd�dej�Z$Gd d!�d!ej�Z%Gd"d#�d#ej�Z&Gd$d%�d%ej�Z'e(d&k�r�e�)�dS)'�)�*N)�Mock)	�ClassVar�Any�List�Union�Tuple�Dict�Generic�TypeVar�Optional)�get_type_hints)�deque�OrderedDict�
namedtuple)�total_orderingc@seZdZdS)�CustomErrorN��__name__�
__module__�__qualname__�rr�4/vddos/python/lib/python3.9/test/test_dataclasses.pyr�rc@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�d��ZSd�d��ZTd�d��ZUd�d��ZVd�d��ZWd�d��ZXd�d��ZYd�d��ZZd�d��Z[d�d��Z\d�d��Z]d�d��Z^d�d��Z_d�S)��TestCasecCs0tGdd�d��}|�}|�tt|��d�dS)Nc@seZdZdS)z"TestCase.test_no_fields.<locals>.CNrrrrr�Csrr��	dataclass�assertEqual�len�fields��selfr�orrr�test_no_fieldsszTestCase.test_no_fieldscCs0tGdd�d��}|�}|�tt|��d�dS)Nc@seZdZdZdS)z6TestCase.test_no_fields_but_member_variable.<locals>.CrN)rrr�irrrrr!srrrr!rrr�"test_no_fields_but_member_variable sz+TestCase.test_no_fields_but_member_variablecCs,tGdd�d��}|d�}|�|jd�dS)Nc@seZdZUeed<dS)z-TestCase.test_one_field_no_default.<locals>.C�xN�rrr�int�__annotations__rrrrr)s
r�*�rrr'r!rrr�test_one_field_no_default(sz"TestCase.test_one_field_no_defaultcCsFd}|�t|��"tGdd�d��}Wd�n1s80YdS)Nz/cannot specify both default and default_factoryc@s"eZdZUeded�Zeed<dS)z<TestCase.test_field_default_default_factory_error.<locals>.C���default�default_factoryr'N)rrr�fieldr)r'r*rrrrr3s
r)�assertRaisesRegex�
ValueErrorr)r"�msgrrrr�(test_field_default_default_factory_error0sz1TestCase.test_field_default_default_factory_errorcCs8tdddd�}d|_t|�}dt�d�}|�||�dS)Nr.TF)r0�init�repr�idz4Field(name='id',type=None,default=1,default_factory=zX,init=True,repr=False,hash=None,compare=True,metadata=mappingproxy({}),_field_type=None))r2�namer8�MISSINGr)r"Z	int_fieldZrepr_outputZexpected_outputrrr�test_field_repr7s�zTestCase.test_field_reprcCs.tGdd�d��}|dd�}|�|jd�dS)Nc@seZdZUeed<dS)z*TestCase.test_named_init_params.<locals>.Cr'Nr(rrrrrDs
r� �r'r,r!rrr�test_named_init_paramsCs
zTestCase.test_named_init_paramscCstGdd�d��}|d�}|�|j|jfd�|�td��"tGdd�d��}Wd�n1sb0Y|�td��6tGdd�d��}tGd	d�d|��}Wd�n1s�0Y|�td��6tGd
d�d��}tGdd�d|��}Wd�n1�s0YdS)Nc@s"eZdZUeed<dZeed<dS)�/TestCase.test_two_fields_one_default.<locals>.Cr'r�yN�rrrr)r*rArrrrrLs
r�)rCrz1non-default argument 'y' follows default argumentc@s"eZdZUdZeed<eed<dS)r@rr'rAN�rrrr'r)r*rrrrrXs
c@seZdZUdZeed<dS)�/TestCase.test_two_fields_one_default.<locals>.Brr'NrDrrrr�Bas
rFc@seZdZUeed<dS)r@rANr(rrrrres
c@seZdZUeed<eed<dS)rEr'rANr(rrrrrFns
c@seZdZUdZeed<dS)r@rr'NrDrrrrrss
)rrr'rAr3�	TypeError)r"rr#rFrrr�test_two_fields_one_defaultKs.�.�0�z$TestCase.test_two_fields_one_defaultcCstdd�Gdd�d��}|�t|d��d�tdd�Gdd�d��}|�t|d��td��|�td	��(tdd
�Gdd�d��}Wd�n1s�0Ytdd
�Gdd�d��}|�t|d
��td��|�td	��(tdd
�Gdd�d��}Wd�n1�s0YdS)NT��frozenc@seZdZUeed<dd�ZdS)�'TestCase.test_overwrite_hash.<locals>.Cr'cSsdS�N�-r�r"rrr�__hash__}s�0TestCase.test_overwrite_hash.<locals>.C.__hash__N)rrrr)r*rOrrrrrzs
r�drMc@seZdZUeed<dd�ZdS)rKr'cSsdS�NFr�r"�otherrrr�__eq__�s�.TestCase.test_overwrite_hash.<locals>.C.__eq__N�rrrr)r*rUrrrrr�s
)rQ�#Cannot overwrite attribute __hash__��unsafe_hashc@seZdZdd�ZdS)rKcSsdS�NrrNrrrrO�srPN�rrrrOrrrrr�sc@seZdZUeed<dd�ZdS)rKr'cSsdSr[rrNrrrrU�srVNrWrrrrr�s
�
)r]c@s&eZdZUeed<dd�Zdd�ZdS)rKr'cSsdSr[rrNrrrrU�srVcSsdSr[rrNrrrrO�srPN)rrrr)r*rUrOrrrrr�s
)rr�hashr3rG�r"rrrr�test_overwrite_hashws&�.�zTestCase.test_overwrite_hashcCsptGdd�d��}tGdd�d|��}|�}|�t|�d�|�}|�t|�d�|dd�}|�t|�d	�dS)
Nc@s&eZdZUdZeed<dZeed<dS)z=TestCase.test_overwrite_fields_in_derived_class.<locals>.Baseg.@r'rrAN)rrrr'rr*rAr)rrrr�Base�s
rac@s&eZdZUdZeed<dZeed<dS)z;TestCase.test_overwrite_fields_in_derived_class.<locals>.C1r]�z�r'N)rrrrbr)r*r'rrrr�C1�s
rdzJTestCase.test_overwrite_fields_in_derived_class.<locals>.Base(x=15.0, y=0)zLTestCase.test_overwrite_fields_in_derived_class.<locals>.C1(x=15, y=0, z=10)�r>zKTestCase.test_overwrite_fields_in_derived_class.<locals>.C1(x=5, y=0, z=10)�rrr8)r"rardr#rrr�&test_overwrite_fields_in_derived_class�s
z/TestCase.test_overwrite_fields_in_derived_classcCs�tGdd�d��}|d�}|�|jd�t�|j�}tt|j��}|�	d|�tGdd�d��}t�|j�}tt|j��}|�d|�dS)Nc@seZdZUeed<dS)�)TestCase.test_field_named_self.<locals>.Cr"N�rrr�strr*rrrrr�s
r�foor"c@seZdZUeed<dS)rhZselfxNrirrrrr�s
)
rrr"�inspect�	signature�__init__�next�iter�
parameters�assertNotEqual)r"r�c�sig�firstrrr�test_field_named_self�szTestCase.test_field_named_selfcCs,tGdd�d��}|d�}|�|jd�dS)Nc@seZdZUeed<dS)z+TestCase.test_field_named_object.<locals>.C�objectNrirrrrr�s
rrk�rrrw�r"rrsrrr�test_field_named_object�sz TestCase.test_field_named_objectcCs2tdd�Gdd�d��}|d�}|�|jd�dS)NTrIc@seZdZUeed<dS)z2TestCase.test_field_named_object_frozen.<locals>.CrwNrirrrrr�s
rrkrxryrrr�test_field_named_object_frozen�sz'TestCase.test_field_named_object_frozencsnhd��t�fdd�tj��D��}dd�|D�}td|�}|dd�|D��}|D]}|�t||�|�qRdS)N>�None�False�Truec3s$|]}|�d�s|�vr|VqdS��__N��
startswith��.0�b�Z
exclusionsrr�	<genexpr>�s�z9TestCase.test_field_named_like_builtin.<locals>.<genexpr>cSsg|]}|tf�qSr�rj�r�r:rrr�
<listcomp>�rz:TestCase.test_field_named_like_builtin.<locals>.<listcomp>rcSsg|]}|�qSrrr�rrrr��r��sorted�builtins�__dict__�keys�make_dataclassr�getattr�r"Zbuiltins_namesZ
attributesrrsr:rr�r�test_field_named_like_builtin�s�
z&TestCase.test_field_named_like_builtincsrhd��t�fdd�tj��D��}dd�|D�}td|dd�}|d	d�|D��}|D]}|�t||�|�qVdS)
N>r|r}r~c3s$|]}|�d�s|�vr|VqdSrr�r�r�rrr��s�z@TestCase.test_field_named_like_builtin_frozen.<locals>.<genexpr>cSsg|]}|tf�qSrr�r�rrrr�rzATestCase.test_field_named_like_builtin_frozen.<locals>.<listcomp>rTrIcSsg|]}|�qSrrr�rrrr�rr�r�rr�r�$test_field_named_like_builtin_frozen�s�z-TestCase.test_field_named_like_builtin_frozencCsTtGdd�d��}tdd�Gdd�d��}||fD]�}|j|d���|�|�|��tdd	�d
d	�dd	�dd	�g�D]�\}}|j|d
��\|�td|j�d|j�d���||�|��Wd�n1s�0YWd�qt1s�0YqtWd�q21�s0Yq2tdd�Gdd�d��}|�|�|��|�|�|��dS)Nc@seZdZdS)z)TestCase.test_0_field_compare.<locals>.C0Nrrrrr�C0sr�F��orderc@seZdZdS)z)TestCase.test_0_field_compare.<locals>.C1Nrrrrrrdsrd��clscSs||kSr[r��ar�rrr�<lambda>rz/TestCase.test_0_field_compare.<locals>.<lambda>cSs||kSr[rr�rrrr�rcSs||kSr[rr�rrrr�rcSs||kSr[rr�rrrr�r��idx�$not supported between instances of '�' and '�'Tc@seZdZdS)z(TestCase.test_0_field_compare.<locals>.CNrrrrrrsr)	r�subTestr�	enumerater3rGr�assertLessEqual�assertGreaterEqual�r"r�rdr�r��fnrrrr�test_0_field_compare	s*��nzTestCase.test_0_field_comparecCs�tGdd�d��}tdd�Gdd�d��}||fD�]}|j|d���|�|d�|d��|�|d	�|d��td
d�dd�d
d�dd�g�D]�\}}|j|d��`|�td|j�d|j�d���"||d	�|d	��Wd�n1s�0YWd�q�1�s
0Yq�Wd�q21�s,0Yq2tdd�Gdd�d��}|�|d	�|d��|�	|d	�|d��|�	|d�|d��|�
|d�|d	��|�|d�|d	��|�|d�|d��dS)Nc@seZdZUeed<dS)z)TestCase.test_1_field_compare.<locals>.C0r'Nr(rrrrr�'s
r�Fr�c@seZdZUeed<dS)z)TestCase.test_1_field_compare.<locals>.C1r'Nr(rrrrrd+s
rdr�r.rcSs||kSr[rr�rrrr�3rz/TestCase.test_1_field_compare.<locals>.<lambda>cSs||kSr[rr�rrrr�4rcSs||kSr[rr�rrrr�5rcSs||kSr[rr�rrrr�6rr�r�r�r�Tc@seZdZUeed<dS)z(TestCase.test_1_field_compare.<locals>.Cr'Nr(rrrrr<s
r)rr�rrrr�r3rGr�
assertLessr��
assertGreaterr�r�rrr�test_1_field_compare%s4��tzTestCase.test_1_field_comparecCsTtGdd�d��}tdd�Gdd�d��}||fD�]B}|j|d���|�|dd�|dd��|�|d	d
�|d	d
��|�|d	d�|dd��|�|d	d�|d	d	��tdd�d
d�dd�dd�g�D]�\}}|j|d��f|�td|j�d|j�d���&||dd�|dd��Wd�n1�s*0YWd�q�1�sJ0Yq�Wd�q21�sl0Yq2tdd�Gdd�d��}tdd�dd�dd�g�D]T\}}|j|d��,|�||dd�|dd���Wd�n1�s�0Y�q�tdd�dd�dd�g�D]�\}}|j|d��d|�||dd�|dd	���|�||dd	�|d	d���|�||d	d�|d	d	���Wd�n1�s�0Y�qtdd�dd�dd�g�D]�\}}|j|d��d|�||dd	�|dd���|�||d	d�|dd	���|�||d	d	�|d	d���Wd�n1�sB0Y�q�dS) Nc@seZdZUeed<eed<dS)z(TestCase.test_simple_compare.<locals>.C0r'rANr(rrrrr�Hs
r�Fr�c@seZdZUeed<eed<dS)z(TestCase.test_simple_compare.<locals>.C1r'rANr(rrrrrdMs
rdr�rr.�cSs||kSr[rr�rrrr�Xrz.TestCase.test_simple_compare.<locals>.<lambda>cSs||kSr[rr�rrrr�YrcSs||kSr[rr�rrrr�ZrcSs||kSr[rr�rrrr�[rr�r�r�r�Tc@seZdZUeed<eed<dS)z'TestCase.test_simple_compare.<locals>.Cr'rANr(rrrrras
rcSs||kSr[rr�rrrr�frcSs||kSr[rr�rrrr�grcSs||kSr[rr�rrrr�hrcSs||kSr[rr�rrrr�lrcSs||kSr[rr�rrrr�mrcSs||kSr[rr�rrrr�nrcSs||kSr[rr�rrrr�trcSs||kSr[rr�rrrr�urcSs||kSr[rr�rrrr�vr)	rr�rrrr�r3rGr�
assertTruer�rrr�test_simple_compareFsX��z�@�@�zTestCase.test_simple_comparec
Cs2tGdd�d��}tGdd�d|��}tdd�dfdd�d	fg�D]R\}\}}|j|d
��*|�||d�|d��|�Wd�qB1s�0YqBtdd�d
d�dd�dd�g�D]v\}}|j|d
��P|�td��"||d�|d��Wd�n1�s0YWd�q�1�s"0Yq�dS)Nc@seZdZUeed<dS)z+TestCase.test_compare_subclasses.<locals>.Br%Nr(rrrrrFs
rFc@seZdZdS)z+TestCase.test_compare_subclasses.<locals>.CNrrrrrr�srcSs||kSr[rr�rrrr��rz2TestCase.test_compare_subclasses.<locals>.<lambda>FcSs||kSr[rr�rrrr��rTr�rcSs||kSr[rr�rrrr��rcSs||kSr[rr�rrrr��rcSs||kSr[rr�rrrr��rcSs||kSr[rr�rrrr��rz.not supported between instances of 'B' and 'C')rr�r�rr3rG)r"rFrr�r��expectedrrr�test_compare_subclasses|s&
�:��z TestCase.test_compare_subclassesc
Cs�dD�]�\}}}|j||d���p|dkrt|�td��*t||d�Gdd�d��}Wd�n1sf0Y�nt||d�Gdd�d��}|dkr�|�d	|j�|�d
|j�|�d|j�|�d|j�|�d
|j�n�|dk�r0|�d	|j�|�d
|j�|�d|j�|�d|j�|�d
|j�nR|dk�r�|�d	|j�|�d
|j�|�d|j�|�d|j�|�d
|j�nWd�q1�s�0YqdS)N))FF�neither)FT�	exception)TF�eq_only)TT�both)�eqr�r�z eq must be true if order is truec@seZdZdS�z!TestCase.test_eq_order.<locals>.CNrrrrrr�src@seZdZdSr�rrrrrr�sr�rU�__lt__�__le__�__gt__�__ge__r�r�)r�r3r4r�assertNotInr��assertIn)r"r�r��resultrrrr�
test_eq_order�s6
2


zTestCase.test_eq_ordercCsZtGdd�d��}|�|d�jd�|�td��|�Wd�n1sL0YdS)Nc@seZdZUe�Zeed<dS)z)TestCase.test_field_no_default.<locals>.Cr'N�rrrr2r'r)r*rrrrr�s
rre�8__init__\(\) missing 1 required positional argument: 'x')rrr'r3rGr_rrr�test_field_no_default�s�zTestCase.test_field_no_defaultcsft��tG�fdd�d��}|�|j��|d�}|�|jd�|`|�|j��|�|�j��dS)Ncs eZdZUe�d�Zeed<dS)z&TestCase.test_field_default.<locals>.C�r0r'N)rrrr2r'rwr*rr�rrr�s
rr])rwr�assertIsr'rryrr�r�test_field_default�szTestCase.test_field_defaultcCs�tGdd�d��}|�t��|�Wd�n1s80Y|d�}|�t|�d�tGdd�d��}|dd�}|�t|�d�dS)Nc@s eZdZUedd�Zeed<dS)�$TestCase.test_not_in_repr.<locals>.CF�r8r'Nr�rrrrr�s
rr]z&TestCase.test_not_in_repr.<locals>.C()c@s(eZdZUedd�Zeed<eed<dS)r�Fr�r'rANr�rrrrr�s
�z*TestCase.test_not_in_repr.<locals>.C(y=20))r�assertRaisesrGrr8ryrrr�test_not_in_repr�s$
zTestCase.test_not_in_reprcCsptGdd�d��}|�|�|dd��|�|dd�|dd��|�|d�|dd��|�|dd�|dd��dS)	Nc@s.eZdZUdZeed<eddd�Zeed<dS)z'TestCase.test_not_in_compare.<locals>.Crr'F�)�comparer0rAN)rrrr'r)r*r2rArrrrr�s
rrr�r.r]rCr��rrrrr_rrr�test_not_in_compare�szTestCase.test_not_in_comparec	s�dD]�\��}|j��d��rtdd�G��fdd�d��}|dkr^|�t|d��td	��n"|d
kr�|�t|d��td��nWd�q1s�0YqdS)N))TFr2)TTr2)FF�absent)FTr�)NFr�)NTr2)r^r�TrYcs$eZdZUe��dd�Zeed<dS)z)TestCase.test_hash_field_rules.<locals>.Cre)r�r^r0r'Nr�r�r�Zhash_rrrs
rr2re)rer�r)r�rrr^)r"r�rrr�r�test_hash_field_rules�szTestCase.test_hash_field_rulescCsftGdd�d��}|�d|�j�tGdd�d��}|�d|d�j�|�t|d��dddd	��dS)
Nc@s eZdZUedd�Zeed<dS)�.TestCase.test_init_false_no_default.<locals>.CF�r7r'Nr�rrrrrs
rr'c@s@eZdZUeed<dZeed<edd�Zeed<dZeed<d	S)
r�r'rrAFr�rbr]�tN)	rrrr)r*rAr2rbr�rrrrrs
rbrrer])r�r'rA)rr�r�r�varsr_rrr�test_init_false_no_defaultsz#TestCase.test_init_false_no_defaultcCs`tGdd�d��}t|�}|�|t�|D]$}|�t|�t�|�|j|j	�q*|�
t|�d�|�
|djd�|�
|djt�|�
t|d��|�|dj�|�|dj�|�
|djd�|�
|djt�|�t|d��|�
|dj�|�|dj�|�
|djd	�|�
|djt�|�
t|d	��|�|dj�|�
|dj�dS)
Nc@s<eZdZUeed<eddd�Zeed<edd�Zeed<dS)z%TestCase.test_class_marker.<locals>.Cr'FN�r7r0rAr�rb)	rrrr)r*r2rArjrbrrrrr#s
rrCrr'r.rAr�rb)rr �assertIsInstance�tupler��typeZFieldr�r:r*rrr)�assertFalse�hasattrr�r7r8rj�assertIsNoner�)r"rZ
the_fields�frrr�test_class_marker"s.zTestCase.test_class_markercCs�tGdd�d��}tGdd�d|��}|�dd�t|�D�gd��tGdd	�d	|��}|�d
d�t|�D�gd��tGdd
�d
|��}|�dd�t|�D�gd��dS)Nc@s2eZdZUdZeed<dZeed<dZeed<dS)z$TestCase.test_field_order.<locals>.B�B:ar��B:br��B:crsN)rrrr�rjr*r�rsrrrrrFDs
rFc@seZdZUdZeed<dS)z$TestCase.test_field_order.<locals>.C�C:br�N)rrrr�rjr*rrrrrJs
rcSsg|]}|j|jf�qSr�r:r0�r�r�rrrr�Nrz-TestCase.test_field_order.<locals>.<listcomp>)�r�r�)r�r�)rsr�c@seZdZUdZeed<dS)z$TestCase.test_field_order.<locals>.D�D:crsN)rrrrsrjr*rrrr�DSs
r�cSsg|]}|j|jf�qSrr�r�rrrr�Wr)r��r�r��rsr�c@s&eZdZUdZeed<dZeed<dS)z$TestCase.test_field_order.<locals>.E�E:ar��E:d�dN)rrrr�rjr*r�rrrr�E\s
r�cSsg|]}|j|jf�qSrr�r�rrrr�ar))r�r�r�r�)r�r��rrr )r"rFrr�r�rrr�test_field_orderCs"���zTestCase.test_field_ordercs\t��tG�fdd�d��}|�t|d��|�t|d��|�|j��|�|jd�dS)NcsFeZdZUeed<edd�Zeed<�Zeed<edd�Z	eed<d	S)
z$TestCase.test_class_attrs.<locals>.Cr'Fr�rArbrQr�r�N)
rrrr)r*r2rArbrwr�rr�rrrks
rr'rArQ)rwrr�r�r�rbrr�r_rr�r�test_class_attrsgszTestCase.test_class_attrsc
s�tgdgftiddiftt�tdg�ffD�]V\���|j�d���,|�td��d���(tG��fdd�d��}Wd�n1s�0Y|�td��d���(tG��fd	d�d��}Wd�n1s�0YGd
d�d���|�td��(tG��fd
d�d��}Wd�n1�s*0YtG�fdd�d��}tG��fdd�d��}Wd�q*1�sx0Yq*dS)Nr.r��typzmutable default z for field x is not allowedcseZdZU�Z�ed<dS)�8TestCase.test_disallowed_mutable_defaults.<locals>.Pointr'N)rrrr'r*r)�emptyr�rr�Point�s
r�z for field y is not allowedcseZdZU�Z�ed<dS)r�rAN)rrrrAr*r)�	non_emptyr�rrr��s
c@seZdZdS)z;TestCase.test_disallowed_mutable_defaults.<locals>.SubclassNrrrrr�Subclass�rr�z7mutable default .*Subclass'> for field z is not allowedcseZdZU��Z�ed<dS)r�rbN)rrrrbr*r�r�r�rrr��s
cs eZdZU��Ze�ed<dS)�4TestCase.test_disallowed_mutable_defaults.<locals>.CrbN)rrrrbrr*rr�rrr�s
rcs eZdZU��Ze�ed<dS)r�r'N)rrrr'rr*rr�rrr�s
)�list�dict�setr�r3r4r�r"r�rr)r�r�r�r�r� test_disallowed_mutable_defaultsws2
�
�4
�4�6z)TestCase.test_disallowed_mutable_defaultscs�Gdd�d��tG�fdd�d��}��}||�}||�}|�||�|jj�ddg�|�||�|�|jjddg�|�|j|j�dS)Nc@seZdZdd�ZdS)z<TestCase.test_deliberately_mutable_defaults.<locals>.MutablecSs
g|_dSr[��lrNrrrrn�szETestCase.test_deliberately_mutable_defaults.<locals>.Mutable.__init__N�rrrrnrrrr�Mutable�srcseZdZU�ed<dS)z6TestCase.test_deliberately_mutable_defaults.<locals>.Cr'N�rrrr*r�rrrr�s
rr.r�)rrr'r�extendr�)r"r�lstZo1Zo2rrr�"test_deliberately_mutable_defaults�sz+TestCase.test_deliberately_mutable_defaultscCs*t�Gdd�d��}|�|d�jd�dS)Nc@seZdZUeed<dS)z#TestCase.test_no_options.<locals>.Cr'Nr(rrrrr�s
rr+r,r_rrr�test_no_options�szTestCase.test_no_optionscCsRtGdd�d��}|�|dd�d�tGdd�d��}|�|dd�|dd��dS)	Nc@seZdZUeed<eed<dS)z&TestCase.test_not_tuple.<locals>.Pointr'rANr(rrrrr��s
r�r.r��r.r�c@seZdZUeed<eed<dS)z"TestCase.test_not_tuple.<locals>.Cr'rANr(rrrrr�s
rrC)rrrr�rrr�test_not_tuple�szTestCase.test_not_tuplecCs�tGdd�d��}tGdd�d��}|�|ddd�|ddd��|�|dd	d�d
�|�td��"|dd
d�\}}}Wd�n1s�0YtGdd�d��}|�|ddd�|��dS)Nc@s&eZdZUeed<eed<eed<dS)z2TestCase.test_not_other_dataclass.<locals>.Point3Dr'rArbNr(rrrr�Point3D�s
rc@s&eZdZUeed<eed<eed<dS)z/TestCase.test_not_other_dataclass.<locals>.DateZyearZmonthZdayNr(rrrr�Date�s
ri��rCr.r�)r.r�rC�unpackr�rec@s2eZdZUdZeed<dZeed<dZeed<dS)z4TestCase.test_not_other_dataclass.<locals>.Point3Dv1rr'rArbN)rrrr'r)r*rArbrrrr�	Point3Dv1�s
rr)rrrr3rG)r"rrr'rArbrrrr�test_not_other_dataclass�s0z!TestCase.test_not_other_dataclasscsnGdd�d�������fdd�}tG��fdd�d��}||�tddd�G��fd	d�d��}||�dS)
Nc@seZdZdS)z-TestCase.test_function_annotations.<locals>.FNrrrrr�F�srcs���|jdt���|jdt���|jd����|jdt���|jdt�t�|j�}��	|j
d�t|j�
��}t|�}��|jd�t|�}��|jd���	|jt���|jtjj���|jtjj�t|�}��|jd���	|jt���|jtjj���|jtjj�t|�}��|jd���	|j����|jtjj�t|�}��|jd���	|jt���|jtjj���tt|�dS)Nr%�j�krrbr")rr*r)rj�float�complexrlrmrnr�Zreturn_annotationrprq�valuesror:�
annotationr0Z	Parameterr��kindZPOSITIONAL_OR_KEYWORDr��
StopIteration)r�rm�paramsZparam)rr"rr�validate_class�s:z:TestCase.test_function_annotations.<locals>.validate_classcsPeZdZUeed<eed<�Z�ed<edd�Ze	ed<eddd	�Z
eed
<dS�z-TestCase.test_function_annotations.<locals>.Cr%rrNr�ry@@F�r0r7rb�rrrr)r*rjrr2rrrbrr�rr�rrr s

rT)rJrZcsPeZdZUeed<eed<�Z�ed<edd�Ze	ed<eddd	�Z
eed
<dSrrrrrrr+s

)r)r"rrr)rr�r"r�test_function_annotations�s+
z"TestCase.test_function_annotationscCs�tGdd�d��}|�td��|�Wd�n1s:0Y|�d|j�tGdd�d��}|�td��|�Wd�n1s�0Y|�d|j�dS)Nc@s eZdZUeed�Zeed<dS)z(TestCase.test_missing_default.<locals>.Cr�r'N�rrrr2r;r'r)r*rrrrr8s
r�3__init__\(\) missing 1 required positional argumentr'c@seZdZUeed<dS)z(TestCase.test_missing_default.<locals>.Dr'Nr(rrrrr�As
r��rr3rGr�r��r"rr�rrr�test_missing_default5s�$�$zTestCase.test_missing_defaultcCs�tGdd�d��}|�td��|�Wd�n1s:0Y|�d|j�tGdd�d��}|�td��|�Wd�n1s�0Y|�d|j�dS)Nc@s eZdZUeed�Zeed<dS)z0TestCase.test_missing_default_factory.<locals>.C�r1r'Nr!rrrrrNs
rr"r'c@s"eZdZUeeed�Zeed<dS)z0TestCase.test_missing_default_factory.<locals>.Dr/r'Nr!rrrrr�Ws
r�r#r$rrr�test_missing_default_factoryJs�$�$z%TestCase.test_missing_default_factorycCs|�dtt��dS)NzMISSING_TYPE object)r�r8r;rNrrr�test_missing_repr`szTestCase.test_missing_reprcCsbtGdd�d��}|�t|j�dg�|�|d���d�|�|d�jd�|�|d�jd�dS)Nc@s6eZdZUeed<ed�dd�Zeed�dd��ZdS)z7TestCase.test_dont_include_other_annotations.<locals>.Cr%)�returncSsdS�Nr�rrNrrrrkgsz;TestCase.test_dont_include_other_annotations.<locals>.C.foocSsdS�NrerrNrrr�barisz;TestCase.test_dont_include_other_annotations.<locals>.C.barN)rrrr)r*rk�propertyr,rrrrrds
rr%r]r�re)rrr�r*rkr,r%r_rrr�#test_dont_include_other_annotationscsz,TestCase.test_dont_include_other_annotationscCs,tGdd�d��}|�t��|�Wd�n1s80YtGdd�d��}|�t��|�Wd�n1sz0Y|d�tdd�Gdd�d��}|�tGdd�d��}|�|�jd	�|�|d
�jd�tdd
�Gdd�d��}|�t��|�Wd�n1�s0YdS)Nc@seZdZdd�ZdS)�"TestCase.test_post_init.<locals>.CcSs
t��dSr[�rrNrrr�
__post_init__us�0TestCase.test_post_init.<locals>.C.__post_init__N�rrrr1rrrrrssrc@s"eZdZUdZeed<dd�ZdS)r/r]r%cSs|jdkrt��dS�Nr])r%rrNrrrr1}s
r2N)rrrr%r)r*r1rrrrrzs
reFr�c@seZdZdd�ZdS)r/cSs
t��dSr[r0rNrrrr1�sr2Nr3rrrrr�sc@s"eZdZUdZeed<dd�ZdS)r/rr'cSs|jd9_dS�Nr�r>rNrrrr1�sr2N�rrrr'r)r*r1rrrrr�s
rr�r�TrIc@s"eZdZUdZeed<dd�ZdS)r/rr'cSs|jd9_dSr5r>rNrrrr1�sr2Nr6rrrrr�s
)rr�rrr'�FrozenInstanceErrorr_rrr�test_post_initqs($$zTestCase.test_post_initcCs�Gdd�d�}tGdd�d|��}|�|�jd�tGdd�d|��}|�t��|�Wd�n1sl0YtGdd�d|��}|�t��|�Wd�n1s�0YdS)Nc@seZdZdd�ZdS)z(TestCase.test_post_init_super.<locals>.BcSs
t��dSr[r0rNrrrr1�sz6TestCase.test_post_init_super.<locals>.B.__post_init__Nr3rrrrrF�srFc@seZdZdd�ZdS)�(TestCase.test_post_init_super.<locals>.CcSs
d|_dSr+r>rNrrrr1�s�6TestCase.test_post_init_super.<locals>.C.__post_init__Nr3rrrrr�srrecseZdZ�fdd�Z�ZS)r9cst���dSr[)�superr1rN��	__class__rrr1�sr:)rrrr1�
__classcell__rrr<rr�sc@seZdZdS)r9Nrrrrrr�s)rrr'r�r�r"rFrrrr�test_post_init_super�s$zTestCase.test_post_init_supercsPd�tG�fdd�d��}|���|dd�}|�|j|jfd�|���dS)NFcs.eZdZUeed<eed<e�fdd��ZdS)z/TestCase.test_post_init_staticmethod.<locals>.Cr'rAcsd�dS�NTrr��flagrrr1�sz=TestCase.test_post_init_staticmethod.<locals>.C.__post_init__N)rrrr)r*�staticmethodr1rrBrrr�s
rrCr��rCr�)rr�rr'rAr�ryrrBr�test_post_init_staticmethod�s

z$TestCase.test_post_init_staticmethodcCsLtGdd�d��}|�|j�|dd�}|�|j|jfd�|�|j�dS)Nc@s.eZdZUdZeed<eed<edd��ZdS)z.TestCase.test_post_init_classmethod.<locals>.CFr'rAcSs
d|_dSrArBr�rrrr1�sz<TestCase.test_post_init_classmethod.<locals>.C.__post_init__N)rrrrCr)r*�classmethodr1rrrrr�s

rrCr�rE)rr�rCrr'rAr�ryrrr�test_post_init_classmethod�s
z#TestCase.test_post_init_classmethodcCs�tGdd�d��}|d�}|�t|�d�|�tt|��d�|�t|j�d�|�|jd�|�|jd�|�|jd	�|�|j	d
�|jd7_|�|jd�|d
�}|�|j
|jfd�|�|jd�|�|jd�|�|jd	�|�|j	d
�dS)Nc@s^eZdZUeed<dZeed<dZeeed<dZeeed<dZ	eeed	<d
Z
eed<dS)
z"TestCase.test_class_var.<locals>.Cr'r]rA��rb���w�r���sN)rrrr)r*rArbrrKr�rNrrrrr�s
rrez-TestCase.test_class_var.<locals>.C(x=5, y=10)r�r
rIrJrLrMr.��r��r�r])rrr8rr r*rbrKr�rNr'rAryrrr�test_class_var�s$zTestCase.test_class_varcCs$tGdd�d��}|�d|j�dS)Nc@seZdZUeeed<dS)z-TestCase.test_class_var_no_default.<locals>.Cr'N)rrrrr)r*rrrrr�s
rr'�rr�r�r_rrr�test_class_var_no_default�sz"TestCase.test_class_var_no_defaultcCsP|�td��0tGdd�d��}|�d|j�Wd�n1sB0YdS)N�cannot have a default factoryc@s$eZdZUeed�Zeeed<dS)z2TestCase.test_class_var_default_factory.<locals>.Cr&r'N�rrrr2r)r'rr*rrrrrs
rr'�r3rGrr�r�r_rrr�test_class_var_default_factorys�z'TestCase.test_class_var_default_factorycCsDtGdd�d��}|�|jd�tGdd�d��}|�|jd�dS)Nc@seZdZUdZeeed<dS)�/TestCase.test_class_var_with_default.<locals>.Cr]r'N)rrrr'rr)r*rrrrrs
rr]c@s$eZdZUedd�Zeeed<dS)rXr]r�r'N)rrrr2r'rr)r*rrrrrs
r,r_rrr�test_class_var_with_default
sz$TestCase.test_class_var_with_defaultcCs�tdd�Gdd�d��}|d�}|�t|d��d�|�tt|��d�|�t|j�d�|�|jd�|�|jd	�|�|jd
�|jd7_|�|jd�|d
�}|�|j	|j
fd�|�|jd�|�|jd	�|�|jd
�dS)NTrIc@sReZdZUeed<dZeed<dZeeed<dZeeed<dZ	eeed	<d
S)z)TestCase.test_class_var_frozen.<locals>.Cr'r]rArIrbrJrKrLr�N)
rrrr)r*rArbrrKr�rrrrrs

rrez4TestCase.test_class_var_frozen.<locals>.C(x=5, y=10)r�rIrJrLr.rOr�rP)rrr8rr r*rbrKr�r'rAryrrr�test_class_var_frozens zTestCase.test_class_var_frozencCs$tGdd�d��}|�d|j�dS)Nc@seZdZUeeed<dS)z,TestCase.test_init_var_no_default.<locals>.Cr'N)rrr�InitVarr)r*rrrrr6s
rr'rRr_rrr�test_init_var_no_default4sz!TestCase.test_init_var_no_defaultcCsP|�td��0tGdd�d��}|�d|j�Wd�n1sB0YdS)NrTc@s$eZdZUeed�Zeeed<dS)z1TestCase.test_init_var_default_factory.<locals>.Cr&r'N)rrrr2r)r'r[r*rrrrrAs
rr'rVr_rrr�test_init_var_default_factory<s�z&TestCase.test_init_var_default_factorycCsDtGdd�d��}|�|jd�tGdd�d��}|�|jd�dS)Nc@seZdZUdZeeed<dS)�.TestCase.test_init_var_with_default.<locals>.Cr]r'N)rrrr'r[r)r*rrrrrIs
rr]c@s$eZdZUedd�Zeeed<dS)r^r]r�r'N)rrrr2r'r[r)r*rrrrrNs
r,r_rrr�test_init_var_with_defaultGsz#TestCase.test_init_var_with_defaultcCs.tGdd�d��}|dd�}|�|jd�dS)Nc@s2eZdZUdZeed<dZeeed<dd�ZdS)z!TestCase.test_init_var.<locals>.CNr'�
init_paramcSs|jdur|d|_dSr5r>)r"r`rrrr1Ys
z/TestCase.test_init_var.<locals>.C.__post_init__)	rrrr'r)r*r`r[r1rrrrrTs
rr])r`r�r,ryrrr�
test_init_varSs
zTestCase.test_init_varcCsB|�ttjt�|�ttt�d�|�tttt�d�dS)N�dataclasses.InitVar[int]z%dataclasses.InitVar[typing.List[int]])rr[r)r�r8rrNrrr�test_init_var_preserve_type`s
�z$TestCase.test_init_var_preserve_typecCsltGdd�d��}|dd�}|�t|�ddi�tGdd�d|��}|ddd	d
�}|�t|�ddd
��dS)Nc@s"eZdZUeed<eeed<dS)z0TestCase.test_init_var_inheritance.<locals>.Baser'�	init_baseN)rrrr)r*r[rrrrrals
rarr]r'c@s*eZdZUeed<eeed<dd�ZdS)z-TestCase.test_init_var_inheritance.<locals>.CrA�init_derivedcSs|j||_|j||_dSr[�r'rA)r"rdrerrrr1{sz;TestCase.test_init_var_inheritance.<locals>.C.__post_init__N�rrrr)r*r[r1rrrrrvs
r��2�3��erf)rrr�)r"rar�rrsrrr�test_init_var_inheritancehs
z"TestCase.test_init_var_inheritancecs�tGdd�d��}|d�}|d�}|�|jd�|�|jg�|�||�|�|j|j�|�t|ddg��ddgf�g�tG�fdd�d��}|d�}|d�}|�|jd�|�|jg�|�||�|�|j|j�|�t|ddg��ddgf�tGdd�d��}|�t|��d�|�|�jg�td	d
�Gdd�d��}|�t|��gf�|�t|��td��tGd
d�d��}|�t|��gf�tGdd�d��}|�|�|dg��dS)Nc@s(eZdZUeed<eed�Zeed<dS)�(TestCase.test_default_factory.<locals>.Cr'r&rAN)rrrr)r*r2r�rArrrrr�s
rrCrer.cs0eZdZUeed<e�fdd�d�Zeed<dS)rnr'cs�Sr[rrr�rrr��rz1TestCase.test_default_factory.<locals>.C.<lambda>r&rAN)rrrr)r*r2rAr�rr�rrr�s
c@s"eZdZUeedd�Zeed<dS)rnF)r1r8r'N�rrrr2r�r'r*rrrrr�s
z*TestCase.test_default_factory.<locals>.C()TrYc@s"eZdZUeedd�Zeed<dS)rnF)r1r^r'Nrorrrrr�s
rc@s"eZdZUeedd�Zeed<dS)rnF�r1r7r'Nrorrrrr�s
c@s"eZdZUeedd�Zeed<dS)rnF)r1r�r'Nrorrrrr�s
)	rrr'rA�assertIsNot�astupler�r8r^)r"rZc0�c1rr�r�test_default_factory�sBzTestCase.test_default_factorycsLt��tG�fdd�d��}|�j|��jd�|�j|��jd�dS)Ncs"eZdZUe�dd�Zeed<dS)z5TestCase.test_default_factory_with_no_init.<locals>.CFrpr'N)rrrr2r'r�r*r��factoryrrr�s
rr.r��rrr'r�
call_countr_rrur�!test_default_factory_with_no_init�sz*TestCase.test_default_factory_with_no_initcslt��tG�fdd�d��}|�j|��jd�|�|d�jd�|��jd�|�j|��jd�dS)Ncs eZdZUe�d�Zeed<dS)zBTestCase.test_default_factory_not_called_if_value_given.<locals>.Cr&r'Nr�rrurrr�s
rr.r]r�rwr_rrur�.test_default_factory_not_called_if_value_given�sz7TestCase.test_default_factory_not_called_if_value_givencCs~tGdd�d��}tGdd�d|��}|�|�ji�|�|�ji�|�|�jd�tGdd�d|��}|�|�ji�dS)Nc@s eZdZUeed�Zeed<dS)z2TestCase.test_default_factory_derived.<locals>.Foor&r'N)rrrr2r�r'r*rrrr�Foo�s
r{c@seZdZUdZeed<dS)z2TestCase.test_default_factory_derived.<locals>.Barr.rAN�rrrrAr)r*rrrr�Bar�s
r}r.c@seZdZdS)z2TestCase.test_default_factory_derived.<locals>.BazNrrrrr�Baz�sr~)rrr'rA)r"r{r}r~rrr�test_default_factory_derived�sz%TestCase.test_default_factory_derivedcCs�tGdd�d��}Gdd�d|�}tGdd�d|��}|dd�}|�|j|jfd	�|�td
��|jWd�n1s|0YGdd�d|�}|d
d�}|�|j|jfd�dS)Nc@seZdZUeed<dS)z3TestCase.test_intermediate_non_dataclass.<locals>.Ar'Nr(rrrr�A�s
r�c@seZdZUeed<dS)z3TestCase.test_intermediate_non_dataclass.<locals>.BrANr(rrrrrF�s
rFc@seZdZUeed<dS)z3TestCase.test_intermediate_non_dataclass.<locals>.CrbNr(rrrrr�s
rr.rC)r.rCzobject has no attributec@seZdZUeed<dS)z3TestCase.test_intermediate_non_dataclass.<locals>.Dr�Nr(rrrrr�s
r�r�re)r�re)rrr'rbr3�AttributeErrorrA)r"r�rFrrsr�r�rrr�test_intermediate_non_dataclass�s
�$
z(TestCase.test_intermediate_non_dataclasscCsB|�td��"tGdd�d��}Wd�n1s40YdS)NrTc@s$eZdZUeed�Zeeed<dS)z1TestCase.test_classvar_default_factory.<locals>.Cr&r'NrUrrrrrs
r�r3rGrr_rrr�test_classvar_default_factory
s
�z&TestCase.test_classvar_default_factorycs�Gdd�d�}|�td��|�tt��|�t|��|�t|���tGdd�d���tG�fdd�d��}�d�}||d	�}|�t���|�t|��|�t|j��|�t|j��|�t|j��dS)
Nc@seZdZdS)z0TestCase.test_is_dataclass.<locals>.NotDataClassNrrrrr�NotDataClasssr�rc@seZdZUeed<dS)z%TestCase.test_is_dataclass.<locals>.Cr'Nr(rrrrrs
rcseZdZU�ed<eed<dS)z%TestCase.test_is_dataclass.<locals>.Dr��eN�rrrr*r)r�rrrr�s
r�r]r�)r��is_dataclassr)rr�r'r�r�)r"r�r�rsr�rr�r�test_is_dataclasss 
zTestCase.test_is_dataclassc
Cs*Gdd�d�}|�t|��|�}Gdd�d�}|�}g|_||fD]�}|j|d���|�t|��|�td��t|�Wd�n1s�0Y|�td��t|�Wd�n1s�0Y|�td��t|dd�Wd�n1s�0YWd�qD1�s0YqDdS)	Nc@seZdZdd�ZdS)zATestCase.test_is_dataclass_when_getattr_always_returns.<locals>.AcSsdS�Nrr)r"�keyrrr�__getattr__0szMTestCase.test_is_dataclass_when_getattr_always_returns.<locals>.A.__getattr__N)rrrr�rrrrr�/sr�c@seZdZdS)zATestCase.test_is_dataclass_when_getattr_always_returns.<locals>.BNrrrrrrF6srF)�objz'should be called on dataclass instancesrr>)	r�r�Z__dataclass_fields__r�r3rG�asdictrr�replace)r"r�r�rFr�r�rrr�-test_is_dataclass_when_getattr_always_returns-s&&z6TestCase.test_is_dataclass_when_getattr_always_returnscCs0tGdd�d��}|�t|�t|dd���dS)Nc@seZdZUeed<eed<dS)z:TestCase.test_helper_fields_with_class_instance.<locals>.Cr'rAN)rrrr)r*rrrrrrJs
rrgr�r_rrr�&test_helper_fields_with_class_instanceGsz/TestCase.test_helper_fields_with_class_instancecCs�|�td��td�Wd�n1s*0YGdd�d�}|�td��t|�Wd�n1sl0Y|�td��t|��Wd�n1s�0YdS)Nzdataclass type or instancerc@seZdZdS)z0TestCase.test_helper_fields_exception.<locals>.CNrrrrrrWrr)r3rGr r_rrr�test_helper_fields_exceptionQs&&z%TestCase.test_helper_fields_exceptioncCs�tGdd�d��}|dd�}|�t|�ddd��|�t|�t|��|�t|�t|��d|_|�t|�ddd��|�tt|��t�dS)Nc@seZdZUeed<eed<dS)z&TestCase.test_helper_asdict.<locals>.Cr'rANr(rrrrr_s
rr.r�rfr+)rrr�rqr'r�r�r�ryrrr�test_helper_asdict]s
zTestCase.test_helper_asdictcCs~tGdd�d��}|�td��t|�Wd�n1s<0Y|�td��tt�Wd�n1sp0YdS)Nc@seZdZUeed<eed<dS)z8TestCase.test_helper_asdict_raises_on_classes.<locals>.Cr'rANr(rrrrrns
r�dataclass instance)rr3rGr�r)r_rrr�$test_helper_asdict_raises_on_classesls&z-TestCase.test_helper_asdict_raises_on_classescCsxtGdd�d��}g}|d|�}t|�}|�|d|�|�|d|�|d�}t|�}|d�d�|�|jg�dS)Nc@s,eZdZUeed<eed�Zeeed<dS)z2TestCase.test_helper_asdict_copy_values.<locals>.Cr'r&rAN�	rrrr)r*r2r�rArrrrrrxs
rr.rA)rr�rrq�appendrA)r"r�initialrsr�rrr�test_helper_asdict_copy_valuesws
z'TestCase.test_helper_asdict_copy_valuescs�tGdd�d���tG�fdd�d��}|d�dd��}t|�}|�|dddd�d	��|�t|�t|��d
|j_|�t|�ddd
d�d	��dS)Nc@seZdZUeed<eed<dS)z2TestCase.test_helper_asdict_nested.<locals>.UserId�token�groupNr(rrrr�UserId�s
r�cseZdZUeed<�ed<dS)z0TestCase.test_helper_asdict_nested.<locals>.Userr:r9Nrir�r�rr�User�s
r��Joe�{r.)r�r��r:r9r�)rr�rrqr9r�)r"r��ur�rr�r�test_helper_asdict_nested�s�z"TestCase.test_helper_asdict_nestedc	stGdd�d���tG�fdd�d��}tG�fdd�d��}tG�fdd�d��}�d	d
�}�dd�}|d
||g�}|d
||f�}|d
||d��}|�t|�d
d	d
d�ddd�gd��|�t|�d
d	d
d�ddd�fd��|�t|�d
d	d
d�ddd�d�d��dS)Nc@seZdZUeed<eed<dS)z<TestCase.test_helper_asdict_builtin_containers.<locals>.Userr:r9N�rrrrjr*r)rrrrr��s
r�cs"eZdZUeed<e�ed<dS)zATestCase.test_helper_asdict_builtin_containers.<locals>.GroupListr9�usersN�rrrr)r*rr�r�rr�	GroupList�s
r�cs&eZdZUeed<e�dfed<dS)zBTestCase.test_helper_asdict_builtin_containers.<locals>.GroupTupler9.r�N�rrrr)r*rrr�rr�
GroupTuple�s
r�cs&eZdZUeed<ee�fed<dS)zATestCase.test_helper_asdict_builtin_containers.<locals>.GroupDictr9r�N�rrrr)r*r	rjrr�rr�	GroupDict�s
r��Alicer.�Bobr�r�ru�secondr�)r9r��rrr��	r"r�r�r�r�r��gl�gt�gdrr�r�%test_helper_asdict_builtin_containers�s,

�
�
�z.TestCase.test_helper_asdict_builtin_containerscsxtGdd�d���tG�fdd�d��}|�t|�dg���dddgii�|�t|�ddi���ddddiii�dS)	Nc@seZdZUeed<dS)zDTestCase.test_helper_asdict_builtin_object_containers.<locals>.Childr�N�rrrrwr*rrrr�Child�s
r�cseZdZU�ed<dS)zETestCase.test_helper_asdict_builtin_object_containers.<locals>.Parent�childNrr�r�rr�Parent�s
r�r.r�r�r�r��r"r�rr�r�,test_helper_asdict_builtin_object_containers�s$z5TestCase.test_helper_asdict_builtin_object_containerscCs�tGdd�d��}|dd�}t|td�}|�|tddg��|�|t|td��d|_t|td�}|�|td	dg��|�t|�t�dS)
Nc@seZdZUeed<eed<dS)z.TestCase.test_helper_asdict_factory.<locals>.Cr'rANr(rrrrr�s
rr.r��Zdict_factory)r'r.)rAr�r+)r'r+)rr�rrrqr'r�r��r"rrsr�rrr�test_helper_asdict_factory�s
z#TestCase.test_helper_asdict_factorycs�tdd��tG�fdd�d��}|d�d|d�dd	d
��d��}t|�}|�|d�dd�dd	d
�d�d�d��t|td
�}|�|d�dd�dd	d
�d�d�d��|�t|�t�|�t|dd�t�dS)N�T�a b ccseZdZUeed<�ed<dS)z1TestCase.test_helper_asdict_namedtuple.<locals>.Cr'rANrir�r�rrr�s
r�outerr.�innerrh��
r�rfr�rA)rrr�rrr�r�r�rr�r�test_helper_asdict_namedtuple�s0
 
���
���	z&TestCase.test_helper_asdict_namedtuplecCsNtGdd�d��}tdd�}||d�di�}|�t|�d|dd�dii�dS)	Nc@seZdZUeed<dS)z5TestCase.test_helper_asdict_namedtuple_key.<locals>.Cr�N)rrrr�r*rrrrr�s
rr�r�zan arr��r�)rrrr�)r"rr�rsrrr�!test_helper_asdict_namedtuple_key�s

z*TestCase.test_helper_asdict_namedtuple_keycs�Gdd�dtdd���tG�fdd�d��}�d�}||�}t|�}|�|d�dd	�i�|�|d|�|�|d��d�dS)
Nc@seZdZdd�ZdS)z9TestCase.test_helper_asdict_namedtuple_derived.<locals>.TcSs|jSr[r�rNrrr�my_a�sz>TestCase.test_helper_asdict_namedtuple_derived.<locals>.T.my_aN)rrrr�rrrrr��sr�ZTbaser�cseZdZU�ed<dS)z9TestCase.test_helper_asdict_namedtuple_derived.<locals>.Cr�Nrrr�rrrs
rr
r�r�)rrr�rrqr�)r"rr�rsr�rr�r�%test_helper_asdict_namedtuple_derived�sz.TestCase.test_helper_asdict_namedtuple_derivedcCs�tGdd�d��}|d�}|�t|�d�|�t|�t|��|�t|�t|��d|_|�t|�d�|�tt|��t�dS)Nc@s"eZdZUeed<dZeed<dS)z'TestCase.test_helper_astuple.<locals>.Cr'rrANrBrrrrrs
rr.)r.rr+)r.r+)rrrrrqrAr�r�r�ryrrr�test_helper_astupleszTestCase.test_helper_astuplecCs~tGdd�d��}|�td��t|�Wd�n1s<0Y|�td��tt�Wd�n1sp0YdS)Nc@seZdZUeed<eed<dS)z9TestCase.test_helper_astuple_raises_on_classes.<locals>.Cr'rANr(rrrrrs
rr�)rr3rGrrr)r_rrr�%test_helper_astuple_raises_on_classess&z.TestCase.test_helper_astuple_raises_on_classescCsxtGdd�d��}g}|d|�}t|�}|�|d|�|�|d|�|d�}t|�}|d�d�|�|jg�dS)Nc@s,eZdZUeed<eed�Zeeed<dS)z3TestCase.test_helper_astuple_copy_values.<locals>.Cr'r&rANr�rrrrr)s
rr.)rrrrrqr�rA)r"rr�rsr�rrr�test_helper_astuple_copy_values(s
z(TestCase.test_helper_astuple_copy_valuescs|tGdd�d���tG�fdd�d��}|d�dd��}t|�}|�|d�|�t|�t|��d	|j_|�t|�d
�dS)Nc@seZdZUeed<eed<dS)z3TestCase.test_helper_astuple_nested.<locals>.UserIdr�r�Nr(rrrrr�8s
r�cseZdZUeed<�ed<dS)z1TestCase.test_helper_astuple_nested.<locals>.Userr:r9Nrirr�rrr�<s
r�r�r�r.)r�)r�r.r�)r�)r�r�)rrrrrqr9r�)r"r�r�r�rr�r�test_helper_astuple_nested7sz#TestCase.test_helper_astuple_nestedc	s�tGdd�d���tG�fdd�d��}tG�fdd�d��}tG�fdd�d��}�d	d
�}�dd�}|d
||g�}|d
||f�}|d
||d��}|�t|�d
ddgf�|�t|�d�|�t|�d
ddd�f�dS)Nc@seZdZUeed<eed<dS)z=TestCase.test_helper_astuple_builtin_containers.<locals>.Userr:r9Nr�rrrrr�Hs
r�cs"eZdZUeed<e�ed<dS)zBTestCase.test_helper_astuple_builtin_containers.<locals>.GroupListr9r�Nr�rr�rrr�Ls
r�cs&eZdZUeed<e�dfed<dS)zCTestCase.test_helper_astuple_builtin_containers.<locals>.GroupTupler9.r�Nr�rr�rrr�Ps
r�cs&eZdZUeed<ee�fed<dS)zBTestCase.test_helper_astuple_builtin_containers.<locals>.GroupDictr9r�Nr�rr�rrr�Ts
r�r�r.r�r�rr��r�r.�r�r�)r)r�r��rrrrr�rr�r�&test_helper_astuple_builtin_containersGs 

z/TestCase.test_helper_astuple_builtin_containerscsptGdd�d���tG�fdd�d��}|�t|�dg���dgff�|�t|�ddi���ddiff�dS)Nc@seZdZUeed<dS)zETestCase.test_helper_astuple_builtin_object_containers.<locals>.Childr�Nr�rrrrr�bs
r�cseZdZU�ed<dS)zFTestCase.test_helper_astuple_builtin_object_containers.<locals>.Parentr�Nrrr�rrr�fs
r�r.r�r�r�rr�r�-test_helper_astuple_builtin_object_containersas z6TestCase.test_helper_astuple_builtin_object_containerscs�tGdd�d��}tdd���fdd�}|dd�}t||d	�}|�|�dd��|�|t||d	��d
|_t||d	�}|�|�d
d��|�t|���dS)Nc@seZdZUeed<eed<dS)z/TestCase.test_helper_astuple_factory.<locals>.Cr'rANr(rrrrrns
r�NTzx ycs�|�Sr[r)r�r�rr�ntssz0TestCase.test_helper_astuple_factory.<locals>.ntr.r��Z
tuple_factoryr+)rrrrrrqr'r�r�)r"rr�rsr�rr�r�test_helper_astuple_factoryms

z$TestCase.test_helper_astuple_factorycs�tdd��tG�fdd�d��}|d�d|d�dd	d
��d��}t|�}|�|d�ddd�f�t|td
�}|�|d�dd�dd	d
�gd�g�dS)Nr�r�cseZdZUeed<�ed<dS)z2TestCase.test_helper_astuple_namedtuple.<locals>.Cr'rANrirr�rrr�s
rr�r.r�rhr�r�r�)r�)rhr�r�r�)rrrrrr�)r"rrsr�rr�r�test_helper_astuple_namedtuple~s
 z'TestCase.test_helper_astuple_namedtuplecCsNdttd�i}tdd|�}t|�}|�||�|�t|dd��ddd��dS)Nr*rfrrr.r�)r)r�rrr��r"Zcls_dictr�Zcls1rrr�test_dynamic_class_creation�s
z$TestCase.test_dynamic_class_creationcCsTttd�tdd�d�}tdd|�}t|�}|�||�|�t|d��ddd��dS)Nrfrer�)r*rArrr.)r)r2r�rrr�r�rrr�'test_dynamic_class_creation_using_field�s�z0TestCase.test_dynamic_class_creation_using_fieldcs�tGdd�d��}g��fdd�}||_|dd�}|�d�d�|�d�d�|�d	gf�d
�|�dgf�d�|�d
��|�d�d�dS)Nc@sjeZdZUeed<e�Zeed<eedd�Zeed<eed�Z	eed<eddd	�Z
eed
<dZeed<dS)
z&TestCase.test_init_in_order.<locals>.Cr�r�Frprsr&r�r�rr�r�N)rrrr)r*r2r�r�rsr�r�r�rrrrr�s
rcs��||f�dSr[)r��r"r:�value�Zcallsrr�setattr�sz,TestCase.test_init_in_order.<locals>.setattrrr.)r�r)r�r.rsr�r�rC)r�r�)r�r�r�)r�__setattr__rr�)r"rr�rsrr�r�test_init_in_order�s
zTestCase.test_init_in_ordercCs�tGdd�d��}|d�}|�d|j�|�d|j�|�d|j�|�d|j�|�|jd�|�d	|j�|�|jd�|�d|j�|�|jd�|�d|j�|�|jg�|�d|j�|�|j	g�|�d|j�|�d	|j�|�|jd�dS)
Nc@s\eZdZUeed<eedd�Zeed<eed�Zeed<eddd�Z	eed	<d
Z
eed<dS)
z'TestCase.test_items_in_dicts.<locals>.Cr�Frpr�r&rsr�rr�rr�N)rrrr)r*r2r�r�rsr�r�rrrrr�s

rrr�r�rsr�r�r�)
rr�r�r�rr�r�r�r�rsryrrr�test_items_in_dicts�s&zTestCase.test_items_in_dictscCs*tGdd�d��}|�|�d�jd�dS)Nc@s"eZdZUeed<edd��ZdS)z:TestCase.test_alternate_classmethod_constructor.<locals>.Cr'cSsd}||�S)Nr�r)r��filenameZ
value_in_filerrr�	from_file�szDTestCase.test_alternate_classmethod_constructor.<locals>.C.from_fileN)rrrr)r*rGr�rrrrr�s
rr�r�)rrr�r'r_rrr�&test_alternate_classmethod_constructor�s	z/TestCase.test_alternate_classmethod_constructorcCs�tGdd�d��}|�t|�dj�|�tt|�dj�d�|�td��"dt|�djd<Wd�n1st0YdS)Nc@seZdZUeed<dS)z/TestCase.test_field_metadata_default.<locals>.Cr%Nr(rrrrr�s
rr� does not support item assignmentrC�test)rr�r �metadatarrr3rGr_rrr�test_field_metadata_default�s�z$TestCase.test_field_metadata_defaultcsF|�t��"tGdd�d��}Wd�n1s20Yi�tG�fdd�d��}|�t|�dj�|�tt|�dj�d�d�d<|�tt|�dj�d�|�t|�djdd�|�td��"dt|�djd	<Wd�n1s�0Yd
ddd
��tG�fdd�d��}|�tt|�dj�d�|�t|�djd	d
�|�t|�djdd�|�t|�djdd�d�d<|�tt|�dj�d�|�t|�djdd�|�t	��"t|�djdWd�n1�s�0Y|�td��"dt|�djd	<Wd�n1�s80YdS)Nc@s eZdZUedd�Zeed<dS)�/TestCase.test_field_metadata_mapping.<locals>.Cr�r�r%N�rrrr2r%r)r*rrrrr�s
rcs eZdZUe�d�Zeed<dS�r�r�r%Nr�r�r�rrrs
rr.rkr�rCr�r]Z42Zthree)r�r,rCcs eZdZUe�d�Zeed<dSr�r�rr�rrrs
r,r�Zbaz)
r�rGrr�r r�rrr3�KeyErrorr_rr�r�test_field_metadata_mapping�s>.�02�z$TestCase.test_field_metadata_mappingcs�Gdd�d��tG�fdd�d��}|�tt|�dj�d�|�t|�djdd�|�t��"t|�djd	Wd�n1s�0Y|�t|�djd
d�dS)Nc@s$eZdZdd�Zdd�Zdd�ZdS)zDTestCase.test_field_metadata_custom_mapping.<locals>.SimpleNameSpacec[s|j�|�dSr[)r��update)r"�kwrrrrn'szMTestCase.test_field_metadata_custom_mapping.<locals>.SimpleNameSpace.__init__cSs|dkrdSt||�S)N�xyzzy�plugh)r�)r"�itemrrr�__getitem__*szPTestCase.test_field_metadata_custom_mapping.<locals>.SimpleNameSpace.__getitem__cSs
|j��Sr[)r��__len__rNrrrr�/szLTestCase.test_field_metadata_custom_mapping.<locals>.SimpleNameSpace.__len__N)rrrrnr�r�rrrr�SimpleNameSpace&sr�cs&eZdZUe�dd�d�Zeed<dS)z6TestCase.test_field_metadata_custom_mapping.<locals>.Cr]r�r�r%Nr�r�r�rrr2s
rrr.r�r]r�r�r�)rrrr r�r�r�r_rr�r�"test_field_metadata_custom_mapping$s0z+TestCase.test_field_metadata_custom_mappingcsXtd��tG�fdd�dt���}|d�}|�|jd�|�|jd�t|t}dS)Nr�cs"eZdZU�ed<dZeed<dS)z5TestCase.test_generic_dataclasses.<locals>.LabeledBox�content�	<unknown>�labelN)rrrr*rrjrr�rr�
LabeledBox@s
rr+r)rrr
rr�rrr))r"rZbox�Aliasrr�r�test_generic_dataclasses=sz!TestCase.test_generic_dataclassescs�td��td��tG��fdd�dt��f��}tGdd�d|t�f��}|t}|ddd	�}|�t|�d
�Gdd�d|t�f�}|t}|d
d�}|�|��d�dS)N�Sr�cseZdZU�ed<�ed<dS)z-TestCase.test_generic_extending.<locals>.Baser'rANrr�rr�rrraPs
rac@seZdZUeed<dS)z4TestCase.test_generic_extending.<locals>.DataDerivedZ	new_fieldNrirrrr�DataDerivedUs
rr�test1�test2)rrr	c@seZdZdd�ZdS)z7TestCase.test_generic_extending.<locals>.NonDataDerivedcSs|jSr[�rArNrrr�
new_method]szBTestCase.test_generic_extending.<locals>.NonDataDerived.new_methodN)rrrrrrrr�NonDataDerived\srr]��?)	rrr
r)rjrrrrr)r"rarrrsrrrr�test_generic_extendingLs 
zTestCase.test_generic_extendingcs�td��tG�fdd�dt���}tdd�fdt�dfg|tt�fddid	�}|�|td
d�jd�|�|td
dd�jd�|�|td
dd�j	d�|�}|�|td
d�j
d
�|�|j||ttf�dS)
Nr�cseZdZU�ed<dS)z-TestCase.test_generic_dynamic.<locals>.Parentr'Nrrr�rrr�fs
r�r�rArbrTr+)�bases�	namespacer.r�rC)
rrr
r�rr)r�rbrrTr'�__mro__rw)r"r�r�rrr�r�test_generic_dynamiccs�zTestCase.test_generic_dynamicc
Cs8tGdd�d��atGdd�d��atGdd�d��atd�}d|_td�tdd�td�|td�tdgd	��g}|D]�}ttjd�D]�}|j||d
���t�	t�
||��}|�|j|j�|�|j|j�|�
||�d|_t�	t�
||��}|�|j|j�|�|j|j�Wd�q�1�s&0Yq�qtdS)Nc@s"eZdZUeed<dZeed<dS)�Pr'rrANrBrrrrrvs
rc@s*eZdZUeed<eddd�Zeed<dS)�Qr'rFrrAN�rrrr)r*r2rArrrrrzs
rc@s,eZdZUeed<eed�Zeeed<dS)�Rr'r&rANr�rrrrr~s
rr.r�)r�rCr�)�sample�protor+)rrrrrA�range�pickle�HIGHEST_PROTOCOLr��loads�dumpsrr'rq)r"�qZsamplesrrZ
new_sampleZanother_new_samplerrr�test_dataclassses_pickleablets(,z%TestCase.test_dataclassses_pickleableN)`rrrr$r&r-r6r<r?rHr`rgrvrzr{r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr
rr r%r'r(r.r8r@rFrHrQrSrWrYrZr\r]r_rarcrmrtryrzrr�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�r�r�rrrrrrrrrs�,5!6(!$-F/
9
!


+rc@s$eZdZdd�Zdd�Zdd�ZdS)�TestFieldNoAnnotationcCsB|�td��"tGdd�d��}Wd�n1s40YdS)N�)'f' is a field but has no type annotationc@seZdZe�ZdS)z>TestFieldNoAnnotation.test_field_without_annotation.<locals>.CN�rrrr2r�rrrrr�srr�r_rrr�test_field_without_annotation�s
�z3TestFieldNoAnnotation.test_field_without_annotationcCsVtGdd�d��}|�td��$tGdd�d|��}Wd�n1sH0YdS)Nc@seZdZUeed<dS)zUTestFieldNoAnnotation.test_field_without_annotation_but_annotation_in_base.<locals>.Br�Nr(rrrrrF�s
rFr!c@seZdZe�ZdS)zUTestFieldNoAnnotation.test_field_without_annotation_but_annotation_in_base.<locals>.CNr"rrrrr�sr�rr3rGr?rrr�4test_field_without_annotation_but_annotation_in_base�s�zJTestFieldNoAnnotation.test_field_without_annotation_but_annotation_in_basecCsRGdd�d�}|�td��$tGdd�d|��}Wd�n1sD0YdS)Nc@seZdZUeed<dS)zcTestFieldNoAnnotation.test_field_without_annotation_but_annotation_in_base_not_dataclass.<locals>.Br�Nr(rrrrrF�s
rFr!c@seZdZe�ZdS)zcTestFieldNoAnnotation.test_field_without_annotation_but_annotation_in_base_not_dataclass.<locals>.CNr"rrrrr�srr�r?rrr�Btest_field_without_annotation_but_annotation_in_base_not_dataclass�s�zXTestFieldNoAnnotation.test_field_without_annotation_but_annotation_in_base_not_dataclassN)rrrr#r%r&rrrrr �s
r c@sleZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�ZdS)�
TestDocStringcCs |�|�dd�|�dd��dS)N� �)rr�)r"r�r�rrr�assertDocStrEqual�szTestDocString.assertDocStrEqualcCs$tGdd�d��}|�|jd�dS)Nc@seZdZUeed<dS)z?TestDocString.test_existing_docstring_not_overridden.<locals>.Cr'Nr(rrrrr�s
rzLorem ipsum)rr�__doc__r_rrr�&test_existing_docstring_not_overridden�sz4TestDocString.test_existing_docstring_not_overriddencCs$tGdd�d��}|�|jd�dS)Nc@seZdZdS)z1TestDocString.test_docstring_no_fields.<locals>.CNrrrrrr�srzC()�rr*r+r_rrr�test_docstring_no_fields�sz&TestDocString.test_docstring_no_fieldscCs$tGdd�d��}|�|jd�dS)Nc@seZdZUeed<dS)z1TestDocString.test_docstring_one_field.<locals>.Cr'Nr(rrrrr�s
rzC(x:int)r-r_rrr�test_docstring_one_field�sz&TestDocString.test_docstring_one_fieldcCs$tGdd�d��}|�|jd�dS)Nc@seZdZUeed<eed<dS)z2TestDocString.test_docstring_two_fields.<locals>.Cr'rANr(rrrrr�s
rzC(x:int, y:int)r-r_rrr�test_docstring_two_fields�sz'TestDocString.test_docstring_two_fieldscCs$tGdd�d��}|�|jd�dS)Nc@s&eZdZUeed<eed<eed<dS)z4TestDocString.test_docstring_three_fields.<locals>.Cr'rArbN�rrrr)r*rjrrrrr�s
rzC(x:int, y:int, z:str)r-r_rrr�test_docstring_three_fields�sz)TestDocString.test_docstring_three_fieldscCs$tGdd�d��}|�|jd�dS)Nc@seZdZUdZeed<dS)z>TestDocString.test_docstring_one_field_with_default.<locals>.CrCr'NrDrrrrr�s
rz
C(x:int=3)r-r_rrr�%test_docstring_one_field_with_default�sz3TestDocString.test_docstring_one_field_with_defaultcCs$tGdd�d��}|�|jd�dS)Nc@s&eZdZUdZeeed�fed<dS)zCTestDocString.test_docstring_one_field_with_default_none.<locals>.CNr')rrrr'rr)r�r*rrrrr�s
rzC(x:Optional[int]=None)r-r_rrr�*test_docstring_one_field_with_default_none�sz8TestDocString.test_docstring_one_field_with_default_nonecCs$tGdd�d��}|�|jd�dS)Nc@seZdZUeeed<dS)z2TestDocString.test_docstring_list_field.<locals>.Cr'N)rrrrr)r*rrrrr�s
rzC(x:List[int])r-r_rrr�test_docstring_list_field�sz'TestDocString.test_docstring_list_fieldcCs$tGdd�d��}|�|jd�dS)Nc@s$eZdZUeed�Zeeed<dS)zGTestDocString.test_docstring_list_field_with_default_factory.<locals>.Cr&r'N)	rrrr2r�r'rr)r*rrrrr�s
rzC(x:List[int]=<factory>)r-r_rrr�.test_docstring_list_field_with_default_factory�sz<TestDocString.test_docstring_list_field_with_default_factorycCs$tGdd�d��}|�|jd�dS)Nc@seZdZUeed<dS)z3TestDocString.test_docstring_deque_field.<locals>.Cr'N)rrrrr*rrrrrs
rzC(x:collections.deque)r-r_rrr�test_docstring_deque_field�sz(TestDocString.test_docstring_deque_fieldcCs$tGdd�d��}|�|jd�dS)Nc@s eZdZUeed�Zeed<dS)zHTestDocString.test_docstring_deque_field_with_default_factory.<locals>.Cr&r'N)rrrr2rr'r*rrrrrs
rz C(x:collections.deque=<factory>)r-r_rrr�/test_docstring_deque_field_with_default_factorysz=TestDocString.test_docstring_deque_field_with_default_factoryN)rrrr*r,r.r/r0r2r3r4r5r6r7r8rrrrr'�s	r'c@s$eZdZdd�Zdd�Zdd�ZdS)�TestInitcCs�Gdd�d�}tGdd�d|��}|d�}|�|jd�|�dt|��tdd�Gd	d�d|��}|�}|�|jd�|�|jd
�dS)Nc@seZdZdd�ZdS)z&TestInit.test_base_has_init.<locals>.BcSs
d|_dS)NrQ�rbrNrrrrnsz/TestInit.test_base_has_init.<locals>.B.__init__NrrrrrrFsrFc@seZdZUdZeed<dS)�&TestInit.test_base_has_init.<locals>.Crr'NrDrrrrrs
rr]rbFr�c@seZdZUdZeed<dS)r;r]r'NrDrrrrr"s
rQ)rrr'r�r�rb)r"rFrrsrrr�test_base_has_inits	zTestInit.test_base_has_initcCsTtdd�Gdd�d�}|�|�jd�tdd�Gdd�d�}|�|�jd�dS)NFr�c@seZdZUdZeed<dS)� TestInit.test_no_init.<locals>.Crr%N)rrrr%r)r*rrrrr+s
rrc@s"eZdZUdZeed<dd�ZdS)r=r�r%cSs
d|_dS�NrC�r%rNrrrrn2sz)TestInit.test_no_init.<locals>.C.__init__N)rrrr%r)r*rnrrrrr0s
rC)rrr%r_rrr�test_no_init)s

zTestInit.test_no_initcCs|tGdd�d��}|�|d�jd�tdd�Gdd�d��}|�|d�jd	�td
d�Gdd�d��}|�|d�jd
�dS)Nc@seZdZUeed<dd�ZdS)�)TestInit.test_overwriting_init.<locals>.Cr'cSsd||_dSr5r>�r"r'rrrrn=s�2TestInit.test_overwriting_init.<locals>.C.__init__N�rrrr)r*rnrrrrr:s
rrCr
Tr�c@seZdZUeed<dd�ZdS)rAr'cSsd||_dSr5r>rBrrrrnDsrCNrDrrrrrAs
r��Fc@seZdZUeed<dd�ZdS)rAr'cSsd||_dSr5r>rBrrrrnKsrCNrDrrrrrHs
rer]r,r_rrr�test_overwriting_init6szTestInit.test_overwriting_initN)rrrr<r@rFrrrrr9s
r9c@s$eZdZdd�Zdd�Zdd�ZdS)�TestReprcCs�tGdd�d��}tGdd�d|��}|d�}|�t|�d�tGdd�d|��}|�t|��d	�tGd
d�d��}|�t|�d��d�|�t|���d
�dS)Nc@seZdZUeed<dS)zTestRepr.test_repr.<locals>.Br'Nr(rrrrrFRs
rFc@seZdZUdZeed<dS)�TestRepr.test_repr.<locals>.Cr]rANr|rrrrrVs
rr�z(TestRepr.test_repr.<locals>.C(x=4, y=10)c@seZdZUdZeed<dS)zTestRepr.test_repr.<locals>.Dr�r'NrDrrrrr�]s
r�z)TestRepr.test_repr.<locals>.D(x=20, y=10)c@s0eZdZeGdd�d��ZeGdd�d��ZdS)rHc@seZdZUeed<dS)zTestRepr.test_repr.<locals>.C.Dr%Nr(rrrrr�ds
r�c@seZdZdS)zTestRepr.test_repr.<locals>.C.ENrrrrrr�gsr�N)rrrrr�r�rrrrrbsrz$TestRepr.test_repr.<locals>.C.D(i=0)z!TestRepr.test_repr.<locals>.C.E())rrr8r�r�)r"rFrr#r�rrr�	test_reprQszTestRepr.test_reprcCsbtdd�Gdd�d��}|�t�d�t|d���tdd�Gdd�d��}|�t|d��d�dS)	NFr�c@seZdZUeed<dS)� TestRepr.test_no_repr.<locals>.Cr'Nr(rrrrros
rz+.TestRepr.test_no_repr.<locals>.C object atrCc@seZdZUeed<dd�ZdS)rJr'cSsdS)N�C-classrrNrrr�__repr__ysz)TestRepr.test_no_repr.<locals>.C.__repr__N�rrrr)r*rLrrrrrvs
rK)rr�rr8rr_rrr�test_no_reprms
�zTestRepr.test_no_reprcCs�tGdd�d��}|�t|d��d�tdd�Gdd�d��}|�t|d��d�tdd�Gd	d�d��}|�t|d��d�dS)
Nc@seZdZUeed<dd�ZdS)�)TestRepr.test_overwriting_repr.<locals>.Cr'cSsdS�Nr'rrNrrrrL�s�2TestRepr.test_overwriting_repr.<locals>.C.__repr__NrMrrrrr�s
rrr'Tr�c@seZdZUeed<dd�ZdS)rOr'cSsdSrPrrNrrrrL�srQNrMrrrrr�s
Fc@seZdZUeed<dd�ZdS)rOr'cSsdSrPrrNrrrrL�srQNrMrrrrr�s
rfr_rrr�test_overwriting_repr}szTestRepr.test_overwriting_reprN)rrrrIrNrRrrrrrGPsrGc@seZdZdd�Zdd�ZdS)�TestEqcCsltdd�Gdd�d��}|�|d�|d��|d�}|�||�tdd�Gdd�d��}|�|d�d�dS)	NF�r�c@seZdZUeed<dS)�TestEq.test_no_eq.<locals>.Cr'Nr(rrrrr�s
rrrCc@seZdZUeed<dd�ZdS)rUr'cSs|dkSr4rrSrrrrU�sz#TestEq.test_no_eq.<locals>.C.__eq__NrWrrrrr�s
r])rrrrryrrr�
test_no_eq�szTestEq.test_no_eqcCs�tGdd�d��}|�|d�d�|�|d�d�tdd�Gdd�d��}|�|d�d�|�|d�d�td	d�Gd
d�d��}|�|d�d�|�|d�d�dS)Nc@seZdZUeed<dd�ZdS)�%TestEq.test_overwriting_eq.<locals>.Cr'cSs|dkSr>rrSrrrrU�s�,TestEq.test_overwriting_eq.<locals>.C.__eq__NrWrrrrr�s
rr.rCTrTc@seZdZUeed<dd�ZdS)rWr'cSs|dkSr*rrSrrrrU�srXNrWrrrrr�s
r�Fc@seZdZUeed<dd�ZdS)rWr'cSs|dkSr+rrSrrrrU�srXNrWrrrrr�s
rer�r_rrr�test_overwriting_eq�szTestEq.test_overwriting_eqN)rrrrVrYrrrrrS�srSc@s$eZdZdd�Zdd�Zdd�ZdS)�TestOrderingcCsZttGdd�d���}|�|d�d�|�|d�d�|�|d�d�|�|d�d�dS)Nc@seZdZUeed<dd�ZdS)z5TestOrdering.test_functools_total_ordering.<locals>.Cr'cSs
|j|kSr[r>rSrrrr��sz<TestOrdering.test_functools_total_ordering.<locals>.C.__lt__N�rrrr)r*r�rrrrr�s
rr���r.)rrr�r�r�r�r_rrr�test_functools_total_ordering�sz*TestOrdering.test_functools_total_orderingcCs�tdd�Gdd�d��}|�d|j�|�d|j�|�d|j�|�d|j�tdd�Gd	d�d��}|�d|j�|�d|j�|�d|j�dS)
NFr�c@seZdZUeed<dS)�%TestOrdering.test_no_order.<locals>.Cr'Nr(rrrrr�s
rr�r�r�r�c@seZdZUeed<dd�ZdS)r^r'cSsdSrRrrSrrrr��sz,TestOrdering.test_no_order.<locals>.C.__lt__Nr[rrrrr�s
rRr_rrr�
test_no_order�szTestOrdering.test_no_ordercCs|�td��(tdd�Gdd�d��}Wd�n1s:0Y|�td��(tdd�Gdd�d��}Wd�n1s~0Y|�td��(tdd�Gd	d�d��}Wd�n1s�0Y|�td
��(tdd�Gdd�d��}Wd�n1�s0YdS)NzACannot overwrite attribute __lt__.*using functools.total_orderingTr�c@seZdZUeed<dd�ZdS)�.TestOrdering.test_overwriting_order.<locals>.Cr'cSsdSr[rrNrrrr��sz5TestOrdering.test_overwriting_order.<locals>.C.__lt__Nr[rrrrr�s
rzACannot overwrite attribute __le__.*using functools.total_orderingc@seZdZUeed<dd�ZdS)r`r'cSsdSr[rrNrrrr��sz5TestOrdering.test_overwriting_order.<locals>.C.__le__N)rrrr)r*r�rrrrr�s
zACannot overwrite attribute __gt__.*using functools.total_orderingc@seZdZUeed<dd�ZdS)r`r'cSsdSr[rrNrrrr�	sz5TestOrdering.test_overwriting_order.<locals>.C.__gt__N)rrrr)r*r�rrrrr	s
zACannot overwrite attribute __ge__.*using functools.total_orderingc@seZdZUeed<dd�ZdS)r`r'cSsdSr[rrNrrrr�	sz5TestOrdering.test_overwriting_order.<locals>.C.__ge__N)rrrr)r*r�rrrrr	s
r�r_rrr�test_overwriting_order�s(�.�.�.�z#TestOrdering.test_overwriting_orderN)rrrr]r_rarrrrrZ�srZc@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�TestHashcCs6tdd�Gdd�d��}|�t|dd��td��dS)NTrYc@seZdZUeed<eed<dS)z$TestHash.test_unsafe_hash.<locals>.Cr'rANr1rrrrr	s
rr.rk)r.rk�rrr^r_rrr�test_unsafe_hash	szTestHash.test_unsafe_hashc	s�dd�}�fdd�}tgd�d�D]r\}\}}}}}|||||d|�|||||d|�||||�||�||�d|�||||�||�||�d|�q"dS)	NcSs|durdS|rdSdS)N)rCrr)r�rrr�non_bool	s
z*TestHash.test_hash_rules.<locals>.non_boolc	sB�j||||d���|dkr\|r@t|||d�Gdd�d��}nt|||d�Gdd�d��}|dkr���d|j���|jd�n�|d	kr�|s���d|j�n~|d
krȈ�d|j���|jd�nV|dk�r��td��,t|||d�Gdd�d��}Wd�n1�s0YnWd�n1�s40YdS)
N)�caserZr�rJr�)rZr�rJc@seZdZdd�ZdS)�1TestHash.test_hash_rules.<locals>.test.<locals>.CcSsdSr�rrNrrrrO*	s�:TestHash.test_hash_rules.<locals>.test.<locals>.C.__hash__Nr\rrrrr(	src@seZdZdS)rgNrrrrrr-	sr�rOr)�nonerXc@seZdZdd�ZdS)rgcSsdSr�rrNrrrrOH	srhNr\rrrrrF	s)	r�rr�r�ZassertIsNotNoner�r�r3rG)rfrZr�rJZ	with_hashr�rrNrrr�#	s.
�

2z&TestHash.test_hash_rules.<locals>.test))FFFr)r))FFTr)r))FTFrir))FTTr�r))TFFr�r�)TFTr�r�)TTFr�r�)TTTr�r�r.FT)r�)	r"rer�rfrZr�rJZres_no_defined_hashZres_defined_hashrrNr�test_hash_rules	s1	�
zTestHash.test_hash_rulescCs�tGdd�d��}|�|d�|d��|�|d�|d��tdd�Gdd�d��}|�|d�|d��|�t|d��t|d���tddd	�Gd
d�d��}|�|d�|d��|�|d�|d��|�t|d��t|d���dS)Nc@seZdZUeed<dd�ZdS)� TestHash.test_eq_only.<locals>.Cr%cSs|j|jkSr[r?rSrrrrUq	s�'TestHash.test_eq_only.<locals>.C.__eq__NrWrrrrrn	s
rr.r�TrYc@seZdZUeed<dd�ZdS)rkr%cSs|j|jkSr[r?rSrrrrU{	srlNrWrrrrrx	s
r
)rZr�c@seZdZUeed<dd�ZdS)rkr%cSs|jdko|j|jkSr>r?rSrrrrU�	srlNrWrrrrr�	s
rC)rrrrr^r_rrr�test_eq_onlyh	s
zTestHash.test_eq_onlycCs`tdd�Gdd�d��}|�t|��td��tdd�Gdd�d��}|�t|��td��dS)NTrIc@seZdZdS�z%TestHash.test_0_field_hash.<locals>.CNrrrrrr�	srrrYc@seZdZdSrnrrrrrr�	srcr_rrr�test_0_field_hash�	szTestHash.test_0_field_hashcCs�tdd�Gdd�d��}|�t|d��td��|�t|d��td��tdd	�Gd
d�d��}|�t|d��td��|�t|d��td��dS)NTrIc@seZdZUeed<dS�z%TestHash.test_1_field_hash.<locals>.Cr'Nr(rrrrr�	s
rr�)r�r+�r+rYc@seZdZUeed<dSrpr(rrrrr�	s
rcr_rrr�test_1_field_hash�	szTestHash.test_1_field_hashcCsLGdd�d�}ddtdfdd|dfddtdfdd|dfddtdfdd|dfddtdfdd|dfddtdfdd|dfddtdfdd|dfddtdfdd|dfddtdfdd|dfddtdfdd|dffD�]~\}}}}|j||||d	���L|du�r|du�rtGd
d�d|��}nh|du�r:t|d�Gd
d�d|��}nB|du�r`t|d�Gdd�d|��}nt||d�Gdd�d|��}|dk�r�|d�}|�td��t|�Wd�n1�s�0Yn`|dk�r�|�t|d��d�n@|dk�r|�|jtj�n$|dk�r&|�t|d��td��nWd�q�1�s<0Yq�dS)Nc@seZdZdd�ZdS)z(TestHash.test_hash_no_args.<locals>.BasecSsdSrLrrNrrrrO�	sz1TestHash.test_hash_no_args.<locals>.Base.__hash__Nr\rrrrra�	sraZ
unhashableFrw�baseTr�)rJr�rsr�c@seZdZUeed<dS�z%TestHash.test_hash_no_args.<locals>.Cr%Nr(rrrrr�	s
rrTc@seZdZUeed<dSrtr(rrrrr�	s
rIc@seZdZUeed<dSrtr(rrrrr�	s
)rJr�c@seZdZUeed<dSrtr(rrrrr�	s
r]�unhashable typerMr+rq)	rwr�rr3rGr^rr�rO)r"rarJr�rsr�rrsrrr�test_hash_no_args�	sV

















�



*


zTestHash.test_hash_no_argsN)	rrrrdrjrmrorrrvrrrrrb	sN#
rbc@s\eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�ZdS)�
TestFrozencCsptdd�Gdd�d��}|d�}|�|jd�|�t��d|_Wd�n1sT0Y|�|jd�dS)NTrIc@seZdZUeed<dS)z!TestFrozen.test_frozen.<locals>.Cr%Nr(rrrrr�	s
rr]re)rrr%r�r7ryrrr�test_frozen�	s$zTestFrozen.test_frozencCs�tdd�Gdd�d��}tdd�Gdd�d|��}|dd�}|�t��d	|_Wd�n1sb0Y|�t��d
|_Wd�n1s�0Y|�|jd�|�|jd�dS)NTrIc@seZdZUeed<dS)z"TestFrozen.test_inherit.<locals>.Cr%Nr(rrrrr�	s
rc@seZdZUeed<dS)z"TestFrozen.test_inherit.<locals>.DrNr(rrrrr��	s
r�rr]rer
)rr�r7r%rr�r"rr�r�rrr�test_inherit�	s
$$zTestFrozen.test_inheritcCs\tdd�Gdd�d��}|�td��$tGdd�d|��}Wd�n1sN0YdS)NTrIc@seZdZdS)z>TestFrozen.test_inherit_nonfrozen_from_empty_frozen.<locals>.CNrrrrrr
sr�5cannot inherit non-frozen dataclass from a frozen onec@seZdZUeed<dS)z>TestFrozen.test_inherit_nonfrozen_from_empty_frozen.<locals>.DrNr(rrrrr�
s
r�r$r$rrr�(test_inherit_nonfrozen_from_empty_frozen
s�z3TestFrozen.test_inherit_nonfrozen_from_empty_frozencCsLtGdd�d��}tGdd�d|��}|d�}|�|jd�|�||�dS)Nc@seZdZdS)z7TestFrozen.test_inherit_nonfrozen_from_empty.<locals>.CNrrrrrr
src@seZdZUeed<dS)z7TestFrozen.test_inherit_nonfrozen_from_empty.<locals>.DrNr(rrrrr�
s
r�rC)rrrr�ryrrr�!test_inherit_nonfrozen_from_empty
sz,TestFrozen.test_inherit_nonfrozen_from_emptyc
Cs�dD]�}|j|d���tdd�Gdd�d��}|rDGdd�d|�}n|}|�td	��$tGd
d�d|��}Wd�n1s~0YWd�q1s�0YqdS)N�TF��intermediate_classTrIc@seZdZUeed<dS)z8TestFrozen.test_inherit_nonfrozen_from_frozen.<locals>.Cr%Nr(rrrrr(
s
rc@seZdZdS)z8TestFrozen.test_inherit_nonfrozen_from_frozen.<locals>.INrrrrr�I-
rr�r{c@seZdZdS)z8TestFrozen.test_inherit_nonfrozen_from_frozen.<locals>.DNrrrrrr�3
sr��r�rr3rG�r"r�rr�r�rrr�"test_inherit_nonfrozen_from_frozen%
s�z-TestFrozen.test_inherit_nonfrozen_from_frozenc
Cs�dD]�}|j|d���tGdd�d��}|r>Gdd�d|�}n|}|�td��*tdd	�Gd
d�d|��}Wd�n1s~0YWd�q1s�0YqdS)Nr~rc@seZdZUeed<dS)z8TestFrozen.test_inherit_frozen_from_nonfrozen.<locals>.Cr%Nr(rrrrr:
s
rc@seZdZdS)z8TestFrozen.test_inherit_frozen_from_nonfrozen.<locals>.INrrrrrr�?
rr�z5cannot inherit frozen dataclass from a non-frozen oneTrIc@seZdZdS)z8TestFrozen.test_inherit_frozen_from_nonfrozen.<locals>.DNrrrrrr�E
sr�r�r�rrr�"test_inherit_frozen_from_nonfrozen7
s�z-TestFrozen.test_inherit_frozen_from_nonfrozenc	Cs�dD]�}|j|d��RGdd�d�}|r:Gdd�d|�}n|}tdd�Gd	d
�d
|��}Wd�n1sl0Y|d�}|�t��d|_Wd�q1s�0YqdS)
Nr~rc@seZdZdS)z4TestFrozen.test_inherit_from_normal_class.<locals>.CNrrrrrrL
src@seZdZdS)z4TestFrozen.test_inherit_from_normal_class.<locals>.INrrrrrr�P
rr�TrIc@seZdZUeed<dS)z4TestFrozen.test_inherit_from_normal_class.<locals>.Dr%Nr(rrrrr�T
s
r�r]re)r�rr�r7r%)r"r�rr�r�r�rrr�test_inherit_from_normal_classI
s0z)TestFrozen.test_inherit_from_normal_classcCs�tdd�Gdd�d��}Gdd�d|�}|d�}|�|jd�|�|jd�d|_|�t��d	|_Wd�n1sx0Y|�t��d	|_Wd�n1s�0Y|�|jd�|�|jd�|�|jd�dS)
NTrIc@s"eZdZUeed<dZeed<dS)z4TestFrozen.test_non_frozen_normal_derived.<locals>.Dr'r]rANrBrrrrr�_
s
r�c@seZdZdS)z4TestFrozen.test_non_frozen_normal_derived.<locals>.SNrrrrrrd
srrCr]re)rrr'rA�cachedr�r7)r"r�rrNrrr�test_non_frozen_normal_derived\
s$$z)TestFrozen.test_non_frozen_normal_derivedcCs�|�td��(tdd�Gdd�d��}Wd�n1s:0Y|�td��(tdd�Gdd�d��}Wd�n1s~0Ytdd�Gd	d�d��}|�|d
�jd�dS)Nz&Cannot overwrite attribute __setattr__TrIc@seZdZUeed<dd�ZdS)�-TestFrozen.test_overwriting_frozen.<locals>.Cr'cSsdSr[rrNrrrr�|
s�9TestFrozen.test_overwriting_frozen.<locals>.C.__setattr__N�rrrr)r*r�rrrrry
s
rz&Cannot overwrite attribute __delattr__c@seZdZUeed<dd�ZdS)r�r'cSsdSr[rrNrrr�__delattr__�
sz9TestFrozen.test_overwriting_frozen.<locals>.C.__delattr__N)rrrr)r*r�rrrrr�
s
Fc@seZdZUeed<dd�ZdS)r�r'cSs|d|jd<dS)Nr�r')r�r�rrrr��
sr�Nr�rrrrr�
s
r]r�)r3rGrrr'r_rrr�test_overwriting_frozenu
s�.�.z"TestFrozen.test_overwriting_frozencCs`tdd�Gdd�d��}t|d��|�td��t|i��Wd�n1sR0YdS)NTrIc@seZdZUeed<dS)z&TestFrozen.test_frozen_hash.<locals>.Cr'N)rrrrr*rrrrr�
s
rrCru)rr^r3rGr_rrr�test_frozen_hash�
s
zTestFrozen.test_frozen_hashN)
rrrrxrzr|r}r�r�r�r�r�r�rrrrrw�	srwc@seZdZdd�Zdd�ZdS)�	TestSlotscCs�tGdd�d��}|�td��|�Wd�n1s:0Y|d�}|�|jd�d|_|�|jd�|�td��d|_Wd�n1s�0YdS)Nc@seZdZUdZeed<dS)z TestSlots.test_simple.<locals>.Cr>r'N�rrr�	__slots__rr*rrrrr�
s
rr�r]rez'C' object has no attribute 'y')rr3rGrr'r�rAryrrr�test_simple�
s�$zTestSlots.test_simplecCsNtGdd�d��}tGdd�d|��}|dd�}|�|j|jfd�d|_dS)	Nc@seZdZUdZeed<dS)z0TestSlots.test_derived_added_field.<locals>.Baser>r'Nr�rrrrra�
s
rac@seZdZUeed<eed<dS)z3TestSlots.test_derived_added_field.<locals>.Derivedr'rANr(rrrr�Derived�
s
r�r.r�r	r])rrr'rArb)r"rar�r�rrr�test_derived_added_field�
s
z"TestSlots.test_derived_added_fieldN)rrrr�r�rrrrr��
sr�c@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�TestDescriptorscsnGdd�d��tG�fdd�d��}|�|jjd�tG�fdd�d��}|�|jjd�|�|�jd�dS)Nc@seZdZdd�Zdd�ZdS)z(TestDescriptors.test_set_name.<locals>.DcSs|d|_dSrP�r:�r"�ownerr:rrr�__set_name__�
sz5TestDescriptors.test_set_name.<locals>.D.__set_name__cSs|durdS|S�Nr.r)r"�instancer�rrr�__get__�
sz0TestDescriptors.test_set_name.<locals>.D.__get__N)rrrr�r�rrrrr��
sr�cseZdZU��Zeed<dS)�(TestDescriptors.test_set_name.<locals>.CrsN)rrrrsr)r*r�r�rrr�
s
r�cxcs$eZdZUe��dd�Zeed<dS)r�FrrsN�rrrr2rsr)r*rr�rrr�
s
r.�rrrsr:r_rr�r�
test_set_name�
s
zTestDescriptors.test_set_namecs8Gdd�d��tG�fdd�d��}|�|jjd�dS)Nc@seZdZdd�ZdS)z.TestDescriptors.test_non_descriptor.<locals>.DcSs|d|_dSrPr�r�rrrr��
sz;TestDescriptors.test_non_descriptor.<locals>.D.__set_name__N)rrrr�rrrrr��
sr�cs$eZdZUe��dd�Zeed<dS)z.TestDescriptors.test_non_descriptor.<locals>.CFrrsNr�rr�rrr�
s
rr�r�r_rr�r�test_non_descriptor�
sz#TestDescriptors.test_non_descriptorcsFGdd�d�}|��t��_tG�fdd�d��}|��jjd�dS)Nc@seZdZdS)z2TestDescriptors.test_lookup_on_instance.<locals>.DNrrrrrr��
sr�cs"eZdZUe�dd�Zeed<dS)z2TestDescriptors.test_lookup_on_instance.<locals>.CFrr%Nr�rr�rrr�
s
rr�rr�rrrx)r"r�rrr�r�test_lookup_on_instance�
sz'TestDescriptors.test_lookup_on_instancecs@Gdd�d��t��_tG�fdd�d��}|��jjd�dS)Nc@seZdZdS)z/TestDescriptors.test_lookup_on_class.<locals>.DNrrrrrr�sr�cs$eZdZUe��dd�Zeed<dS)z/TestDescriptors.test_lookup_on_class.<locals>.CFrr%Nr�rr�rrrs
rr.r�r_rr�r�test_lookup_on_classs
z$TestDescriptors.test_lookup_on_classN)rrrr�r�r�r�rrrrr��
s
r�c@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�TestStringAnnotationsc	sddD]Z�|j�d��:tG�fdd�d��}|�|�d|j�Wd�q1sT0YqdS)N)
z
ClassVar[int]zClassVar [int] ClassVar [int]rz
 ClassVar ztyping.ClassVar[int]ztyping.ClassVar[str]z typing.ClassVar[str]ztyping .ClassVar[str]ztyping. ClassVar[str]ztyping.ClassVar [str]ztyping.ClassVar [ str]ztyping.ClassVar.[int]ztyping.ClassVar+�ZtypestrcseZdZU�ed<dS)z.TestStringAnnotations.test_classvar.<locals>.Cr'Nrrr�rrr(s
rr')r�rr�r�r_rr�r�
test_classvarsz#TestStringAnnotations.test_classvarc	sbdD]X�|j�d��8tG�fdd�d��}|�|d�jd�Wd�q1sR0YqdS)N)
�CVz
t.ClassVarzt.ClassVar[int]ztyping..ClassVar[int]ZClassvarz
Classvar[int]ztyping.ClassVarx[int]ztypong.ClassVar[int]zdataclasses.ClassVar[int]ztypingxClassVar[str]r�cseZdZU�ed<dS)z3TestStringAnnotations.test_isnt_classvar.<locals>.Cr'Nrrr�rrr@s
rr]�r�rrr'r_rr�r�test_isnt_classvar3s
z(TestStringAnnotations.test_isnt_classvarc
s�dD]|�|j�d��\tG�fdd�d��}|�td��|d�jWd�n1sX0YWd�q1sv0YqdS)N)
zInitVar[int]zInitVar [int] InitVar [int]r[z	 InitVar rbzdataclasses.InitVar[str]z dataclasses.InitVar[str]zdataclasses .InitVar[str]zdataclasses. InitVar[str]zdataclasses.InitVar [str]zdataclasses.InitVar [ str]zdataclasses.InitVar.[int]zdataclasses.InitVar+r�cseZdZU�ed<dS)z-TestStringAnnotations.test_initvar.<locals>.Cr'Nrrr�rrr]s
rzobject has no attribute 'x'r.)r�rr3r�r'r_rr�r�test_initvarGs�z"TestStringAnnotations.test_initvarc	sbdD]X�|j�d��8tG�fdd�d��}|�|d�jd�Wd�q1sR0YqdS)N)�IVz
dc.InitVarzxdataclasses.xInitVarztyping.xInitVar[int]r�cseZdZU�ed<dS)z2TestStringAnnotations.test_isnt_initvar.<locals>.Cr'Nrrr�rrrms
rr]r�r_rr�r�test_isnt_initvarfs
z'TestStringAnnotations.test_isnt_initvarcCsXddlm}ddlm}ddlm}ddlm}||||fD�]}|j|d���|jrb|�d�}n|��}|�|j	d�|�
dd	d
dd�}d
D]n}|j|d��N|�td|�d���t
||�Wd�n1s�0YWd�q�1s�0Yq�|j�r$|�d|j�|�|jd�n|�d|j�Wd�q<1�sH0Yq<dS)Nr)�dataclass_module_1)�dataclass_module_1_str)�dataclass_module_2)�dataclass_module_2_str)�mr]r�r.r�rCr�)Ziv0Ziv1Ziv2Ziv3)�
field_namezobject has no attribute 'r��not_iv4)r�r�r�r�r�r�Z
USING_STRINGSr�rZcv0r�r3r�r�r�r�r�r�)r"r�r�r�r�r�rsr�rrr�!test_classvar_module_level_importts*�
Hz7TestStringAnnotations.test_classvar_module_level_importcCsHddlm}|�t|j�d|ji�|�t|jj�|jtd�d��dS)Nr)�dataclass_textannork)rkr))r�r�rr
r}r{rnr�)r"r�rrr�test_text_annotations�s�
��z+TestStringAnnotations.test_text_annotationsN)	rrrr�r�r�r�r�r�rrrrr�s$)r�c@s|eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�ZdS)�TestMakeDataclasscCsZtddtfdttdd�fgddd�id	�}|d
�}|�|j|jfd�|�|��d�dS)
Nrr'rArer��add_onecSs
|jdSr�r>rNrrrr��rz/TestMakeDataclass.test_simple.<locals>.<lambda>�rr])r]rerh)r�r)r2rr'rAr�ryrrrr��s�
�zTestMakeDataclass.test_simplecCs6i}tddtfdttdd�fg|d�}|�|i�dS)Nrr'rArer�r�)r�r)r2r)r"�nsrrrr�test_no_mutate_namespace�s��z*TestMakeDataclass.test_no_mutate_namespacecCsdGdd�d�}Gdd�d�}tddtfg||fd�}|d�}|�||�|�||�|�||�dS)	Nc@seZdZdS)z*TestMakeDataclass.test_base.<locals>.Base1Nrrrrr�Base1�sr�c@seZdZdS)z*TestMakeDataclass.test_base.<locals>.Base2Nrrrrr�Base2�sr�rr'�rr�)r�r)r��r"r�r�rrsrrr�	test_base�s�zTestMakeDataclass.test_basecCs�tGdd�d��}Gdd�d�}tddtfg||fd�}|�td��|d	�}Wd�n1sb0Y|d
d	�}|�||�|�||�|�||�|�|j|jfd�dS)Nc@seZdZUeed<dS)z4TestMakeDataclass.test_base_dataclass.<locals>.Base1r'Nr(rrrrr��s
r�c@seZdZdS)z4TestMakeDataclass.test_base_dataclass.<locals>.Base2Nrrrrrr��sr�rrAr�zrequired positionalr�r.r	)	rr�r)r3rGr�rr'rAr�rrr�test_base_dataclass�s�&
z%TestMakeDataclass.test_base_dataclasscCs`dd�}tddtfdttfgd|id�}|dd	�}|�t|�dd
i�|�tt|��d�dS)NcSs|j|9_dSr[r>�r"rArrr�	post_init�sz2TestMakeDataclass.test_init_var.<locals>.post_initrr'rAr1r�r�rCr
r.)r�r)r[rr�rr )r"r�rrsrrrra�s
��
zTestMakeDataclass.test_init_varc	Cs~tddtfdttdfdtttdd�fg�}|d�}|�t|�ddi�|�tt|��d�|�|jd�|�|j	d�dS)	Nrr'rAr]rbr�r�r.)
r�r)rr2rr�rr rArbryrrrrQ�s��z TestMakeDataclass.test_class_varc	Cs�tddtfdttdfdtttdd�fgdd	�}|�d
t|��|�dt|��|�td��tdgdd
�}Wd�n1s�0YdS)Nrr'rAr]rbr�r�Fr�rnrLzunexpected keyword argument)Zxxinit)	r�r)rr2r�r�r�r3rGr_rrr�test_other_params�s���z#TestMakeDataclass.test_other_paramscCs�tdgd��}|ddd�}|�t|�dddd��|�|jdddd��tdddtfd	g�}|ddd�}|�t|�dddd��|�|jdtdd��dS)
Nr��r'rArbr.r�rCz
typing.Anyr'rArb)r�rr�r*r)ryrrr�
test_no_typess
�
�zTestMakeDataclass.test_no_typesc
Cs�dD]j}|j|d��J|�td��tdd|g�Wd�n1sF0YWd�q1sd0Yqtdd�fD]j}|j|d��J|�td��tdd|g�Wd�n1s�0YWd�q|1s�0Yq|dS)	N)r)r.r�rCr�)�	bad_fieldzInvalid field: rr�cSs|Sr[rr>rrrr� rzCTestMakeDataclass.test_invalid_type_specification.<locals>.<lambda>zhas no len\(\))r�r3rGr�r)r"r�rrr�test_invalid_type_specificationsL�z1TestMakeDataclass.test_invalid_type_specificationc
CsvdD]l}|j|d��L|�td�� td|d|g�Wd�n1sH0YWd�q1sf0YqdS)N)r��ab�r2zField name duplicatedrr��r�r3rGr��r"r2rrr�test_duplicate_field_names&sz,TestMakeDataclass.test_duplicate_field_namesc
Cs�dD]�}|j|d���|�td��tdd|g�Wd�n1sF0Y|�td��td|g�Wd�n1s~0Y|�td��td|dg�Wd�n1s�0YWd�q1s�0YqdS)N)�for�async�await�asr�zmust not be keywordsrr�r�r�rrr�test_keyword_field_names,s,*z*TestMakeDataclass.test_keyword_field_namesc
Cs�dD]�}|j|d���|�td��tdd|g�Wd�n1sF0Y|�td��td|g�Wd�n1s~0Y|�td��td|dg�Wd�n1s�0YWd�q1s�0YqdS)N)�()�x,yr�2@3r)zlittle johnny tablesr�zmust be valid identifiersrr�r�r�rrr�test_non_identifier_field_names6s,*z1TestMakeDataclass.test_non_identifier_field_namescCstdgd��dS)Nr)�_Z_aZa_aZa_)r�rNrrr�test_underscore_field_names@sz-TestMakeDataclass.test_underscore_field_namesc	CsVdD]L}|j|d��,t|ddg�}|�|j|�Wd�q1sF0YqdS)N)r�r�rr�r))�	classnamer�r�)r�r�rr)r"r�rrrr�test_funny_class_names_namesEsz.TestMakeDataclass.test_funny_class_names_namesN)rrrr�r�r�r�rarQr�r�r�r�r�r�r�r�rrrrr��s
	


r�c@steZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�ZdS)�TestReplacecCsNtdd�Gdd�d��}|dd�}t|dd�}|�|jd�|�|jd�dS)	NTrIc@seZdZUeed<eed<dS)zTestReplace.test.<locals>.Cr'rANr(rrrrrOs
rr.r�rCr>)rr�rr'rA�r"rrsrsrrrr�Ns
zTestReplace.testcCs^tdd�Gdd�d��}|dd�}t|dd�}|�|j|j|j|jfd	�|�|j|j|j|jfd
�|�td�� t|ddd
d�Wd�n1s�0Y|�td��,t|dd�t|ddd
d�Wd�n1s�0Y|�t	d��d|_Wd�n1�s0Y|�t
d��t|ddd�}Wd�n1�sP0YdS)NTrIc@sFeZdZUeed<eed<eddd�Zeed<eddd�Zeed<d	S)
z"TestReplace.test_frozen.<locals>.Cr'rAFr]r�rbrQr�N)rrrr)r*r2rbr�rrrrrZs
rr.r�rCr>)r.r�r]rQ)rCr�r]rQ�
init=Falser�ri)r'rbr�r:zcannot assign to field 'x'z3__init__\(\) got an unexpected keyword argument 'a're)r'r�)rr�rr'rArbr�r3r4r7rGr�rrrrxYs
..&zTestReplace.test_frozencCs^tdd�Gdd�d��}|dd�}|�td��t|dd	�}Wd�n1sP0YdS)
NTrIc@seZdZUeed<eed<dS)z.TestReplace.test_invalid_field_name.<locals>.Cr'rANr(rrrrrzs
rr.r�z3__init__\(\) got an unexpected keyword argument 'z'rCr:�rr3rGr�r�rrr�test_invalid_field_nameys

z#TestReplace.test_invalid_field_namecCs�tdd�Gdd�d��}|�td��t|dd�Wd�n1sF0Y|�td��tddd�Wd�n1s~0YdS)	NTrIc@seZdZUeed<eed<dS)z*TestReplace.test_invalid_object.<locals>.Cr'rANr(rrrrr�s
rr�rCr>rr�r_rrr�test_invalid_object�s*zTestReplace.test_invalid_objectcCs�tGdd�d��}|d�}d|_t|dd�}|�|j|jfd�|�td��t|d	d
d�Wd�n1sp0Y|�td��t|d
d�Wd�n1s�0YdS)
Nc@s*eZdZUeed<eddd�Zeed<dS)z#TestReplace.test_no_init.<locals>.Cr'Fr]r�rANrrrrrr�s
rr.r�rer>)rer]r�r��rfr
)rrAr�rr'r3r4r�rrrr@�s,zTestReplace.test_no_initcCs�tGdd�d��}|d�}|d�}|�|j|j�|�|jd�|�td��t|dd�Wd�n1sn0Yt|d	d
�dS)Nc@s&eZdZUeed<dZeeed<dS)z$TestReplace.test_classvar.<locals>.Cr'rIrAN)rrrr)r*rArrrrrr�s
rr.r�rIz3__init__\(\) got an unexpected keyword argument 'y'r�r
rer>)rr�rArr3rGr�r�rrrr��s*zTestReplace.test_classvarcCs�tGdd�d��}|dd�}|�|jd�|�td��t|dd�Wd�n1sX0Yt|ddd	�}|�|jd
�dS)Nc@s*eZdZUeed<eeed<dd�ZdS)z0TestReplace.test_initvar_is_specified.<locals>.Cr'rAcSs|j|9_dSr[r>r�rrrr1�sz>TestReplace.test_initvar_is_specified.<locals>.C.__post_init__Nrgrrrrr�s
rr.r]z,InitVar 'y' must be specified with replace()rCr>rerfrc)rrr'r3r4r�ryrrr�test_initvar_is_specified�s
*z%TestReplace.test_initvar_is_specifiedcCsxtGdd�d��}|dddd�}|�t|�|dd��|�t|dd	�|ddd
d��|�t|ddd�|dddd��dS)Nc@s>eZdZUeed<dZeeed<dZeeed<dd�ZdS)z6TestReplace.test_initvar_with_default_value.<locals>.Cr'NrAr+rbcSs0|dur|j|7_|dur,|j|7_dSr[r>)r"rArbrrrr1�szDTestReplace.test_initvar_with_default_value.<locals>.C.__post_init__)	rrrr)r*rAr[rbr1rrrrr�s
rr.r]r�r�r>r�r
r+)rArb)rrr�ryrrr�test_initvar_with_default_value�sz+TestReplace.test_initvar_with_default_valuecCs4tGdd�d��}|d�}||_|�t|�d�dS)Nc@seZdZUded<dS)z*TestReplace.test_recursive_repr.<locals>.Crr�Nrrrrrr�s
rz1TestReplace.test_recursive_repr.<locals>.C(f=...)�rr�rr8ryrrr�test_recursive_repr�s
zTestReplace.test_recursive_reprcCs<tGdd�d��}|dd�}||_||_|�t|�d�dS)Nc@seZdZUded<ded<dS)z4TestReplace.test_recursive_repr_two_attrs.<locals>.Crr��gNrrrrrr�s
rzBTestReplace.test_recursive_repr_two_attrs.<locals>.C(f=..., g=...))rr�r�rr8ryrrr�test_recursive_repr_two_attrs�s
z)TestReplace.test_recursive_repr_two_attrscCsTtGdd�d��}tGdd�d��}|d�}|d�}||_||_|�t|�d�dS)Nc@seZdZUded<dS)z6TestReplace.test_recursive_repr_indirection.<locals>.Cr�r�Nrrrrrr�s
rc@seZdZUded<dS)z6TestReplace.test_recursive_repr_indirection.<locals>.Drr�Nrrrrrr��s
r�zwTestReplace.test_recursive_repr_indirection.<locals>.C(f=TestReplace.test_recursive_repr_indirection.<locals>.D(f=...))r�)r"rr�rsr�rrr�test_recursive_repr_indirection�sz+TestReplace.test_recursive_repr_indirectioncCsttGdd�d��}tGdd�d��}tGdd�d��}|d�}|d�}|d�}||_||_||_|�t|�d�dS)Nc@seZdZUded<dS)z:TestReplace.test_recursive_repr_indirection_two.<locals>.Cr�r�Nrrrrrr
s
rc@seZdZUded<dS)z:TestReplace.test_recursive_repr_indirection_two.<locals>.Dr�r�Nrrrrrr�
s
r�c@seZdZUded<dS)z:TestReplace.test_recursive_repr_indirection_two.<locals>.Err�Nrrrrrr�	
s
r�z�TestReplace.test_recursive_repr_indirection_two.<locals>.C(f=TestReplace.test_recursive_repr_indirection_two.<locals>.D(f=TestReplace.test_recursive_repr_indirection_two.<locals>.E(f=...)))r�)r"rr�r�rsr�r�rrr�#test_recursive_repr_indirection_two
sz/TestReplace.test_recursive_repr_indirection_twocCs6tGdd�d��}|dd�}||_|�t|�d�dS)Nc@seZdZUded<eed<dS)z5TestReplace.test_recursive_repr_misc_attrs.<locals>.Crr�r�Nr�rrrrr
s
rr.zATestReplace.test_recursive_repr_misc_attrs.<locals>.C(f=..., g=1)r�ryrrr�test_recursive_repr_misc_attrs
s

z*TestReplace.test_recursive_repr_misc_attrsN)rrrr�rxr�r�r@r�r�r�r�r�r�r�r�rrrrr�Ms 	r��__main__)*Zdataclassesrrlr�ZunittestZ
unittest.mockr�typingrrrrrr	r
rrr
�collectionsrrr�	functoolsr�	Exceptionrrr r'r9rGrSrZrbrwr�r�r�r�r�r�mainrrrr�<module>s`,
#YBG/L]/*H%f


Kontol Shell Bypass