o
    ڷi                 
   @   s  d dl Z d dlmZmZmZmZmZmZ d dlZd dl	Z	d dl
Z
d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlmZ d dlmZ d dlmZmZmZmZmZmZmZmZ d dlmZm Z m!Z!m"Z" d dlm#Z# d dlm$Z$m%Z% d d	l&m'Z' d d
l(m)Z)m*Z*m+Z+m,Z, d dl-m.Z. d dlm/Z/ ej0dd Z1e2Z3e34dd Z5G dd dZ6e6 Z7z
G dd deZ8W n e9y Z: ze:Z8W Y dZ:[:ndZ:[:ww zG dd de;eZ<W n e9y Z: ze:Z<W Y dZ:[:ndZ:[:ww zG dd de=eZ>W n e9y Z: ze:Z>W Y dZ:[:ndZ:[:ww z
G dd deZ?W n e9y- Z: ze:Z?W Y dZ:[:ndZ:[:ww G dd deZ@G dd deZAG dd deZBG d d! d!eZCz	ed"d#e2d$ZDW n e9yl Z: ze:ZDW Y dZ:[:ndZ:[:ww zed%d&ZEW n e9y Z: ze:ZEW Y dZ:[:ndZ:[:ww z	ed'd(d)d*ZFW n e9y Z: ze:ZFW Y dZ:[:ndZ:[:ww z
G d+d, d,eZGW n
 e9y   Y nw dd-d.ZHd/d0 ZIG d1d2 d2ejJZKG d3d4 d4ZLeG d5d6 d6eej"d7ZMeG d8d9 d9eej d7ZNeG d:d; d;eZOG d<d= d=ZPG d>d? d?ZQG d@dA dAZRG dBdC dCZSG dDdE dEZTG dFdG dGePeQejJZUG dHdI dIePeQeTejJZVG dJdK dKePeSejJZWG dLdM dMePeSejJZXG dNdO dOePeSeTejJZYG dPdQ dQePeRejJZZG dRdS dSePeRejJZ[G dTdU dUePeReTejJZ\G dVdW dWePeRejJZ]G dXdY dYePeSejJZ^G dZd[ d[ePeRejJZ_G d\d] d]ePeSejJZ`G d^d_ d_ejJZaG d`da daejJZbG dbdc dcejJZcG ddde deejJZdG dfdg dgejJZeG dhdi diejJZfG djdk dkejJZgG dldm dmejJZhG dndo doejJZidpZjdqZkG drds dsejJZlG dtdu duejJZmdvZndvZodvZpdvZqdvZrdvZsdvZtdvZudvZvdvZwdvZxdvZydwZzdxZ{dvZ|dyZ}dzZ~d{Zd|Zd}ZG d~d dejJZdd Zdd Ze2dkrPe  dS dS )    N)verifyUNIQUE
CONTINUOUSNAMED_FLAGS_iter_bits_lsbglobal_enum)OrderedDictdate)EnumIntEnumStrEnumEnumTypeFlagIntFlaguniqueauto)STRICTCONFORMEJECTKEEP)ReprEnum)member	nonmember)StringIO)dumpsloadsPicklingErrorHIGHEST_PROTOCOL)dedent)	timedelta   .c                   @      e Zd Zdd ZdS )AlwaysEqualc                 C      dS NT selfotherr(   r(   M/home/ubuntu/vllm_env/lib/python3.10/site-packages/aenum/test_stdlib_tests.py__eq__      zAlwaysEqual.__eq__N)__name__
__module____qualname__r-   r(   r(   r(   r,   r%          r%   c                   @      e Zd ZdZdZdZdS )Stooges   r!      Nr/   r0   r1   LARRYCURLYMOEr(   r(   r(   r,   r4   %       r4   c                   @   r3   )
IntStoogesr5   r!   r6   Nr7   r(   r(   r(   r,   r<   -   r;   r<   c                   @   r3   )FloatStoogesg=
ףp=?g(\@gR$_	$	@Nr7   r(   r(   r(   r,   r=   5   r;   r=   c                   @   r3   )FlagStoogesr5   r!      Nr7   r(   r(   r(   r,   r>   =   r;   r>   c                   @      e Zd ZdZdZdZdZdS )FlagStoogesWithZeror   r5   r!   r?   Nr/   r0   r1   NOFLAGr8   r9   r:   r(   r(   r(   r,   rA   D   
    rA   c                   @   r3   )IntFlagStoogesr5   r!   r?   Nr7   r(   r(   r(   r,   rE   J   r;   rE   c                   @   r@   )IntFlagStoogesWithZeror   r5   r!   r?   NrB   r(   r(   r(   r,   rF   O   rD   rF   c                   @      e Zd ZdZdZdS )NameGuido van RossumzBarry WarsawN)r/   r0   r1   BDFLFLUFLr(   r(   r(   r,   rH   V       rH   Questionzwho what when where whymoduleAnswerzhim this then there becauseTheoryzrule law suppositionspanish_inquisition)qualnamec                   @   r3   )Fruitr5   r!   r6   N)r/   r0   r1   TOMATOBANANACHERRYr(   r(   r(   r,   rT   k   r;   rT   c                 C   s8   |d u r|}t td D ]}| tt||d| qd S Nr5   )protocol)ranger   r   r   )	assertionsourcetargetrY   r(   r(   r,   test_pickle_dump_loadr   s
   r^   c              	   C   sJ   t td D ]}| | t||d W d    n1 sw   Y  qd S rX   )rZ   r   r   )r[   	exceptionobjrY   r(   r(   r,   test_pickle_exceptionx   s   
ra   c                   @   sH   e Zd ZdZdZdZdZdZdd Zdd	 Z	d
d Z
dd Zdd ZdS )TestHelpers_bad__good_	_what_ho___mal____bien____que_que___MyEnum__private_MyEnum__still_private_MyEnum__private__MyEnum__also_private_okay_semi_private_weird__	_MyEnum__c                 C   sN   G dd d}dD ]}| }|  t| t||d | t| q	d S )Nc                   @      e Zd ZdS )z+TestHelpers.test_is_descriptor.<locals>.fooNr/   r0   r1   r(   r(   r(   r,   foo       rx   )__get____set__
__delete__r5   )assertFalseenumis_descriptorsetattr
assertTrue)r*   rx   attrr`   r(   r(   r,   test_is_descriptor   s   zTestHelpers.test_is_descriptorc                 C   s   | j | j D ]}| t|d|  q| j| j | j D ]}| t|d|  qdD ]
}| t| q-dD ]
}| t| q:d S )N%r is a not sunder name?%r is a sunder name?)_a__aa_)aa__a__aa____a___a____a________________	sunder_namesprivate_and_sunder_namesr   r~   	is_sunderdunder_namesprivate_namesrandom_namesr}   r*   namesr(   r(   r,   test_sunder   s   zTestHelpers.test_sunderc                 C   s   | j D ]}| t|d|  q| j| j | j | j D ]}| t|d|  qdD ]
}| t| q-dD ]
}| t| q:d S )N%r is a not dunder name?%r is a dunder name?)r   __aa__)r   r   r   r   r   r   r   r   r   r   r   r   r   	r   r   r~   	is_dunderr   r   r   r   r}   r   r(   r(   r,   test_dunder   s   
zTestHelpers.test_dunderc                 C   V   | j | j D ]}| td|d q| j| j | j D ]}| td|d qd S NMyEnumz%r is a not private name?z%r is a private name?	r   r   r   r~   
is_privater   r   r   r}   r*   r   r(   r(   r,   test_is_private   
   zTestHelpers.test_is_privatec                 C   s0   |  ttdg d | tdttd d S )N   r5   r!   r?   z-8 is not a positive integeri)assertEquallistr   assertRaisesRegex
ValueErrorr*   r(   r(   r,   test_iter_bits_lsb      zTestHelpers.test_iter_bits_lsbN)r/   r0   r1   r   r   r   r   r   r   r   r   r   r   r(   r(   r(   r,   rb   }   s    	rb   c                   @   s   e Zd ZdddZdd ZdS )classpropertyNc                 C   s2   || _ || _|| _|d u r|d ur|j}|| _d S N)fgetfsetfdel__doc__)r*   r   r   r   docr(   r(   r,   __init__   s   
zclassproperty.__init__c                 C   s
   |  |S r   )r   )r*   instance
ownerclassr(   r(   r,   rz         
zclassproperty.__get__)NNNN)r/   r0   r1   r   rz   r(   r(   r(   r,   r      s    
r   c                   @   "   e Zd ZdZe Ze Ze ZdS )HeadlightsKr   N)r/   r0   r1   OFF_Kr   
LOW_BEAM_KHIGH_BEAM_KFOG_Kr(   r(   r(   r,   r      
    
r   boundaryc                   @   r   )HeadlightsCr   N)r/   r0   r1   OFF_Cr   
LOW_BEAM_CHIGH_BEAM_CFOG_Cr(   r(   r(   r,   r      r   r   c                   @   rG   )NoNamer5   r!   Nr/   r0   r1   ONETWOr(   r(   r(   r,   r          r   c                   @   s   e Zd ZdZdZdd Zdd Zdd Zd	d
 Zdd Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd  Zd!d" Zd#d$ Zd%d& Zd'd( Zd)d* Zd+d, Zd-d. Zd/d0 Zd1d2 Zd3d4 Zd5d6 Zd7d8 Zd9d: Z d;d< Z!dS )=
_EnumTestszX
    Test for behavior that is the same across the different types of enumerations.
    Nc                    s*  G dd d j }G  fddd|}| _G dd d j }| _G dd d j }| _G d	d
 d
 j }| _G dd d j }G dd d|}| _d _g d _t|t	r` j _
n'|jtu rkg d _
nt j trg d _
d _|d _n j
pg d _
t dds j
 _d S d S )Nc                   @      e Zd Zejdd ZdS )z"_EnumTests.setUp.<locals>.BaseEnumc                 S   
   d| j  S )Nz%s is first!r   r   r(   r(   r,   first   s   
z(_EnumTests.setUp.<locals>.BaseEnum.firstN)r/   r0   r1   r~   propertyr   r(   r(   r(   r,   BaseEnum       r   c                       s6   e Zd Ze Ze Ze Ze je	rdZ
dS eZ
dS )z"_EnumTests.setUp.<locals>.MainEnumr6   N)r/   r0   r1   r   r   secondthird
issubclass	enum_typer   duper(   r   r(   r,   MainEnum   s    r   c                   @      e Zd Zdd Ze ZdS )z$_EnumTests.setUp.<locals>.NewStrEnumc                 S   
   | j  S r   r   upperr   r(   r(   r,   __str__   r   z,_EnumTests.setUp.<locals>.NewStrEnum.__str__N)r/   r0   r1   r   r   r   r(   r(   r(   r,   
NewStrEnum       
r   c                   @   r   )z'_EnumTests.setUp.<locals>.NewFormatEnumc                 S   r   r   r   r*   specr(   r(   r,   
__format__   r   z2_EnumTests.setUp.<locals>.NewFormatEnum.__format__N)r/   r0   r1   r   r   r   r(   r(   r(   r,   NewFormatEnum   r   r   c                   @   s"   e Zd Zdd Zdd Ze ZdS )z*_EnumTests.setUp.<locals>.NewStrFormatEnumc                 S   r   r   r   titler   r(   r(   r,   r      r   z2_EnumTests.setUp.<locals>.NewStrFormatEnum.__str__c                 S      d t| jS N joinreversedr   r   r(   r(   r,   r         z5_EnumTests.setUp.<locals>.NewStrFormatEnum.__format__N)r/   r0   r1   r   r   r   r   r(   r(   r(   r,   NewStrFormatEnum   s    
r   c                   @      e Zd Zdd Zdd ZdS )z%_EnumTests.setUp.<locals>.NewBaseEnumc                 S   r   r   r   r   r(   r(   r,   r     r   z-_EnumTests.setUp.<locals>.NewBaseEnum.__str__c                 S   r   r   r   r   r(   r(   r,   r     r   z0_EnumTests.setUp.<locals>.NewBaseEnum.__format__N)r/   r0   r1   r   r   r(   r(   r(   r,   NewBaseEnum      r   c                   @      e Zd Ze ZdS )z$_EnumTests.setUp.<locals>.NewSubEnumN)r/   r0   r1   r   r   r(   r(   r(   r,   
NewSubEnum	      
r   F)r   r   r   )123r   T   r5   r!   r6   source_values)r   r   r   r   r   r   is_flagnamesr   r   values_member_type_strr   dupe2getattrr  )r*   r   r   r   r   r   r   r   r(   r   r,   setUp   s4   




z_EnumTests.setUpc                 C   s   |  ||||j d S r   )r   formatvaluer*   r   r   r(   r(   r,   assertFormatIsValue  s   z_EnumTests.assertFormatIsValuec                 C   s    |  |||t| d S r   )r   r  r  r  r(   r(   r,   assertFormatIsStr   s    z_EnumTests.assertFormatIsStrc                 C   s   G dd d| j }| t|d |`| t|d | t
 |`W d    n1 s-w   Y  | t
 |`W d    n1 sDw   Y  | t |j`	W d    d S 1 s]w   Y  d S )Nc                   @   &   e Zd Ze Ze Ze Zdd ZdS )z2_EnumTests.test_attribute_deletion.<locals>.Seasonc                 S      d S r   r(   )clsr(   r(   r,   spam)  r.   z7_EnumTests.test_attribute_deletion.<locals>.Season.spamN)r/   r0   r1   r   SPRINGSUMMERAUTUMNr  r(   r(   r(   r,   Season$  s
    r  r  )
r   r   hasattrr  r}   assertRaisesAttributeErrorr  DRYr   r*   r  r(   r(   r,   test_attribute_deletion#  s   "z"_EnumTests.test_attribute_deletionc                 C   s$  | j }| jr)| t|d | t|d | t|d | |d| ju  n| t|d | t|d | t|d | t||j	|j
|jg | dd |D | j | dd |D | j | dd |D g d t|| jd	d
D ]\}}| || | q|t|| jd	d
D ]\}}| ||| qt|tr| |j|d  u o|d u  d S    d S |jtu r| |j|d  u o|d u  d S    d S t|tr| |j|d  u o|d u  d S    d S | |j|| jd   u o|d u n   d S )Nz<flag 'MainEnum'>r  z<enum 'MainEnum'>c                 S      g | ]}|j qS r(   r   .0mr(   r(   r,   
<listcomp>D      z*_EnumTests.test_basics.<locals>.<listcomp>c                 S   r  r(   r  r   r(   r(   r,   r#  H  r$  c                 S   r  r(   )r   r   r(   r(   r,   r#  L  r$  )zfirst is first!zsecond is first!zthird is first!Tstrictr   r   r   r6   r!   )r   r  r   reprr  r  r   r	  r   r   r   r   r  r  zipassertIsr   r   r   r  r   )r*   TEr   r   r  r(   r(   r,   test_basics7  sB   
2
2
24z_EnumTests.test_basicsc                 C   sB   G dd d| j }| | | | j | jD ]}| | qd S )Nc                   @   rv   )z+_EnumTests.test_bool_is_true.<locals>.EmptyNrw   r(   r(   r(   r,   Empty]  ry   r-  )r   r   r   )r*   r-  r   r(   r(   r,   test_bool_is_true\  s   

z_EnumTests.test_bool_is_truec                 C   s>   | j }| t d| j _W d    d S 1 sw   Y  d S )Nzreally first)r   r  r  r   )r*   r   r(   r(   r,   test_changing_member_failse  s   
"z%_EnumTests.test_changing_member_failsc                    s    j } |j|   jd |v  t tur! d|v  |j} || G dd dt	} 
|j| |jtu rYG  fddd j} 
|j|  
|j| d S G  fddd j} |j|  |j| d S )	Nr   r   c                   @   s   e Zd Ze Ze ZdS )z._EnumTests.test_contains_tf.<locals>.OtherEnumN)r/   r0   r1   r   onetwor(   r(   r(   r,   	OtherEnums  s    
r2  c                           e Zd Z jd Z jd ZdS )z1_EnumTests.test_contains_tf.<locals>.NotEqualEnumr   r5   Nr/   r0   r1   r  thisthatr(   r   r(   r,   NotEqualEnumz      
r7  c                       r3  )z._EnumTests.test_contains_tf.<locals>.EqualEnumr   r5   Nr4  r(   r   r(   r,   	EqualEnum  r8  r9  )r   assertInr   r   r  typeTestStrEnumr}   r   r   assertNotInr1  r  objectr   r5  r6  )r*   r   valr2  r7  r9  r(   r   r,   test_contains_tfj  s    
z_EnumTests.test_contains_tfc                 C   s   | j }G dd dt}| |j| | |j| | |j| | |j| | |j| | |j| | |j| | |j| | |j| | |j| | |j| | |j| d S )Nc                   @   r3   )zK_EnumTests.test_contains_same_name_diff_enum_diff_values.<locals>.OtherEnumbrandnewr  Nr/   r0   r1   r   r   r   r(   r(   r(   r,   r2    r;   r2  )r   r   r:  r   r   r   r=  )r*   r   r2  r(   r(   r,   -test_contains_same_name_diff_enum_diff_values  s   z8_EnumTests.test_contains_same_name_diff_enum_diff_valuesc                 C   s&   | j }| tt|tt| d S r   )r   r   setdirenum_dirr*   r+  r(   r(   r,   test_dir_on_class  s    z_EnumTests.test_dir_on_classc                 C   s*   | j }| tt|jtt|j d S r   )r   r   rE  rF  r   
member_dirrH  r(   r(   r,   test_dir_on_item  s   $z_EnumTests.test_dir_on_itemc                 C   s<   G dd d| j }| dt|v | dt|jv  d S )Nc                   @   s    e Zd Ze Ze Zdd ZdS )z5_EnumTests.test_dir_with_added_behavior.<locals>.Testc                 S   r   )NzWowser! I'm %s!r   r   r(   r(   r,   wowser  r   z<_EnumTests.test_dir_with_added_behavior.<locals>.Test.wowserN)r/   r0   r1   r   r5  theserL  r(   r(   r(   r,   Test  s    rN  rL  )r   r   rF  r5  )r*   rN  r(   r(   r,   test_dir_with_added_behavior  s   z'_EnumTests.test_dir_with_added_behaviorc                 C   sL   G dd d| j }G dd d|}| dt|v | dt|jv  d S )Nc                   @   r$   )zD_EnumTests.test_dir_on_sub_with_behavior_on_super.<locals>.SuperEnumc                 S   r&   )Nzdid you see me?r(   r   r(   r(   r,   	invisible  r.   zN_EnumTests.test_dir_on_sub_with_behavior_on_super.<locals>.SuperEnum.invisibleN)r/   r0   r1   rP  r(   r(   r(   r,   	SuperEnum  r2   rQ  c                   @   r   )zB_EnumTests.test_dir_on_sub_with_behavior_on_super.<locals>.SubEnumN)r/   r0   r1   r   sampler(   r(   r(   r,   SubEnum  r   rS  rP  r   r   rF  rR  r*   rQ  rS  r(   r(   r,   &test_dir_on_sub_with_behavior_on_super  s   z1_EnumTests.test_dir_on_sub_with_behavior_on_superc                    s\   G  fddd j }G  fddd|} dt|v  dt|jv t|j d S )Nc                          e Zd Z fddZdS )z\_EnumTests.test_dir_on_sub_with_behavior_including_instance_dict_on_super.<locals>.SuperEnumc                    sr    j jj} j jtu r|| }nt|d tr|d \}n|}|| g|R  }t|dkr1|d n||_d|_|S )Nr   r5   ztest description)	r   r  __new__r>  
isinstancetuplelen_value_description)r  r  kwdsrB  r`   create_valuer   r(   r,   rX    s   

zd_EnumTests.test_dir_on_sub_with_behavior_including_instance_dict_on_super.<locals>.SuperEnum.__new__Nr/   r0   r1   rX  r(   r   r(   r,   rQ        rQ  c                       s   e Zd Z jd ZdS )zZ_EnumTests.test_dir_on_sub_with_behavior_including_instance_dict_on_super.<locals>.SubEnumr5   N)r/   r0   r1   r  rR  r(   r   r(   r,   rS        rS  r]  rT  rU  r(   r   r,   >test_dir_on_sub_with_behavior_including_instance_dict_on_super  s    zI_EnumTests.test_dir_on_sub_with_behavior_including_instance_dict_on_superc                 C   s   | j }| ||j|j d S r   )r   r*  r   )r*   Mainr(   r(   r,   test_enum_in_enum_out  s   z _EnumTests.test_enum_in_enum_outc                 C   s>   | j }i }d||j< d||j< d||j< | ||j d d S )N122503150704)r   r   r   r   r   )r*   r   mappingr(   r(   r,   	test_hash  s   


z_EnumTests.test_hashc                 C   s2  |  t G dd d| j}W d    n1 sw   Y  |  t G dd d| j}W d    n1 s7w   Y  |  t G dd d| j}W d    n1 sUw   Y  |  t G dd d| j}W d    n1 ssw   Y  |  t G dd d| j}W d    d S 1 sw   Y  d S )Nc                   @      e Zd ZdZdS ,_EnumTests.test_invalid_names.<locals>.Wrong	   N)r/   r0   r1   mror(   r(   r(   r,   Wrong      rp  c                   @   rk  )rm     N)r/   r0   r1   _create_r(   r(   r(   r,   rp    rq  c                   @   rk  rl  )r/   r0   r1   _get_mixins_r(   r(   r(   r,   rp    rq  c                   @   rk  )rm  r5   N)r/   r0   r1   
_find_new_r(   r(   r(   r,   rp    rq  c                   @   rk  rl  )r/   r0   r1   
_any_name_r(   r(   r(   r,   rp    rq  )r  r   r   r*   rp  r(   r(   r,   test_invalid_names  s   "z_EnumTests.test_invalid_namesc                    s,   G  fddd j } t|jd dS )z=check that setting __str__ to object's is not reset to Enum'sc                       s$   e Zd Z jd Zdd ZejZdS )z4_EnumTests.test_object_str_override.<locals>.Genericr!   c                 S   s   d| j f S )Nz%s.test_name_r   r(   r(   r,   __repr__     z=_EnumTests.test_object_str_override.<locals>.Generic.__repr__N)r/   r0   r1   r  itemr{  r>  r   r(   r   r(   r,   Generic  s    

r~  z	item.testN)r   r   r  r}  r*   r~  r(   r   r,   test_object_str_override  s   z#_EnumTests.test_object_str_overridec                 C   s>   | j }| t|j|jj  | t|j|jj  d S r   )r   r   r  r   r   r   r  )r*   NSr(   r(   r,   test_overridden_str  s   z_EnumTests.test_overridden_strc                 C   D   | j }| t|j|jj  | t|jdt|jj d S r   )	r   r   r  r   r   r   r  r   r   )r*   NSFr(   r(   r,   test_overridden_str_format     $z%_EnumTests.test_overridden_str_formatc                 C   r  r   )	r   r   r  r   r   r   r  r   r   )r*   NSEr(   r(   r,   $test_overridden_str_format_inherited  r  z/_EnumTests.test_overridden_str_format_inheritedc                 C   s  |  dd}t|}| t|t| | t|d| | |j|j|jg| | j}| j tu r5g d}t	d
 |D ]G\}}|| }| |j|t| | |j| |jturgt||jrg| || n| || | || | t|| | ||| q<d S )N	MinorEnumjune july augustr6   junejulyaugustr   r   r   r[  r  r  r  r  r   r)  splitr  r   r  r>  r   assertNotEqualr:  r*  r;  r*   r  lstr  monthaver(   r(   r,   !test_programmatic_function_string  s,   
z,_EnumTests.test_programmatic_function_stringc                 C   s
  |  dg d}t|}| t|t| | t|d| | |j|j|jg| | j}| j tu r7g d}t	d
 |D ]D\}}|| }| |j| | |j| |jturft||jrf| || n| || | || | t|| | ||| q>d S )Nr  r  r6   r  r  r  r(   r(   r,   &test_programmatic_function_string_list  s,   
z1_EnumTests.test_programmatic_function_string_listc                 C   s  |  dd| jd fd| jd fd| jd ff}t|}| t|t| | t|d| | |j|j|jg| td		 | j
D ]D\}}|| }| |j| | |j| |jturkt||jrk| || n| || | || | t|| | ||| qCd S 
Nr  r  r   r  r5   r  r!   r6   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,   #test_programmatic_function_iterable2  s,   &z._EnumTests.test_programmatic_function_iterablec              	   C   s   |  dtd| jd fd| jd fd| jd ff}t|}| t|t| | t|d| | |j|j|jg| t	d	
 | jD ]6\}}|| }|jtur_t||jr_| || n| || | || | t|| | ||| qEd S r  )r   r   r  r   r   r[  r  r  r  r)  r  r  r  r>  r   r  r:  r*  r;  r  r(   r(   r,   $test_programmatic_function_from_dictJ  s(   *z/_EnumTests.test_programmatic_function_from_dictc                 C   s   | j }| jr#| t|dd | t|jd | t| jd n t|tr2| t|jd n| t|jd| jd f |j	 t
| j| j|dd	D ]\}}}| t|d
|j|jf  qMd S )Nr   z<MainEnum: 0>z<MainEnum.dupe: 3>z<MainEnum.first|third: 5>z<MainEnum.third: 'third'>z<MainEnum.third: %r>r!   Tr&  z<MainEnum.%s: %r>)r   r  r   r(  r   r	  r   r   r  _value_repr_r)  r  r   r  r*   r+  r   r  r   r(   r(   r,   	test_repr`  s   
"z_EnumTests.test_reprc                 C   s(   G dd d| j }| t|jd d S )Nc                   @   r  )z._EnumTests.test_repr_override.<locals>.Genericc                 S   r   )Nz!don't you just love shades of %s?r   r   r(   r(   r,   r{  r  r   z7_EnumTests.test_repr_override.<locals>.Generic.__repr__N)r/   r0   r1   r   r   r   r   r{  r(   r(   r(   r,   r~  n  
    r~  z$don't you just love shades of third?)r   r   r(  r   r  r(   r(   r,   test_repr_overridem  s
   z_EnumTests.test_repr_overridec                 C   s8   G dd d| j }G dd d|}| t|jd d S )Nc                   @   r$   )z._EnumTests.test_inherited_repr.<locals>.MyEnumc                 S   r   )NzMy name is %s.r   r   r(   r(   r,   r{  {  r   z7_EnumTests.test_inherited_repr.<locals>.MyEnum.__repr__Nr/   r0   r1   r{  r(   r(   r(   r,   r   z  r2   r   c                   @      e Zd Ze Ze Ze ZdS )z1_EnumTests.test_inherited_repr.<locals>.MySubEnumN)r/   r0   r1   r   r5  r6  theotherr(   r(   r(   r,   	MySubEnum}      
r  zMy name is that.)r   r   r(  r6  )r*   r   r  r(   r(   r,   test_inherited_repry  s   z_EnumTests.test_inherited_reprc                 C   s,   |  tt| j| jj| jj| jjg d S r   )r   r   r   r   r   r   r   r   r(   r(   r,   test_reversed_iteration_order  s   z(_EnumTests.test_reversed_iteration_order)"r/   r0   r1   r   r  r  r  r  r  r,  r.  r/  r@  rD  rI  rK  rO  rV  rc  re  rj  rx  r  r  r  r  r  r  r  r  r  r  r  r  r(   r(   r(   r,   r      s@    <%		
	
r   c                   @   ,   e Zd Zdd Zdd Zdd Zdd Zd	S )
_PlainOutputTestsc                 C   s   | j }| jr#| t|dd | t|jd | t| jd n	| t|jd t| j| j|ddD ]\}}}| t|d|j	f  q6d S )	Nr   zMainEnum(0)MainEnum.dupeMainEnum.first|thirdMainEnum.thirdTr&  MainEnum.%s
r   r  r   r  r   r	  r)  r  r  r   r  r(   r(   r,   test_str  s   z_PlainOutputTests.test_strc                 C      | j }| jr| t|jd | t| jd n	| t|jd t| j| j|ddD ]\}}}| t|d|j	f  q,d S Nr  r  r  Tr&  r  
r   r  r   r  r   r	  r)  r  r  r   r  r(   r(   r,   test_format     z_PlainOutputTests.test_formatc                 C   s<   | j }| t|jdd|j|jf  | t|jd d S )NNewFormatEnum.firstz%s %rFIRST)r   r   r  r   r   r  r*   NFr(   r(   r,   test_overridden_format  s    z(_PlainOutputTests.test_overridden_formatc                 C   l   | j }| d|j | d|j | d|j | d|j | d|j | d|j | d|j d S N{}{:}{:20}{:^20}{:>20}{:<20}{:5.2})r   r  r   rH  r(   r(   r,   test_format_specs     z#_PlainOutputTests.test_format_specsNr/   r0   r1   r  r  r  r  r(   r(   r(   r,   r    s
    
r  c                   @   r  )
_MixedOutputTestsc                 C   r  r  r  r  r(   r(   r,   r    r  z_MixedOutputTests.test_strc                 C   r  r  r  r  r(   r(   r,   r    r  z_MixedOutputTests.test_formatc                 C   s.   | j }| t|jd | t|jd d S )Nr  r  )r   r   r  r   r  r  r(   r(   r,   r    s   z(_MixedOutputTests.test_overridden_formatc                 C   r  r  )r   r  r   rH  r(   r(   r,   r    r  z#_MixedOutputTests.test_format_specsNr  r(   r(   r(   r,   r    s
    

r  c                   @   s4   e Zd Zdd Zdd Zdd Zdd Zd	d
 ZdS )_MinimalOutputTestsc                 C      | j }| jr| t|jd | t| jd n| t|jt| jd  t| j| j|ddD ]\}}}| t|t| q1d S Nr   5r!   Tr&  )	r   r  r   r  r   r	  r  r)  r  r  r(   r(   r,   r       z_MinimalOutputTests.test_strc                 C   r  r  )	r   r  r   r  r   r	  r  r)  r  r  r(   r(   r,   r    r  z_MinimalOutputTests.test_formatc                 C   s8   | j }| t|jt| jd  | t|jd d S )Nr   r  )r   r   r  r   r  r  r  r(   r(   r,   r    s   z*_MinimalOutputTests.test_overridden_formatc                 C   s   | j }| d|j | d|j | d|j | d|j | d|j | d|j |jtu rI| d|j | d|j | d	|j d S d S )
Nr  r  r  r  r  r  z{:n}r  z{:f})r   r  r   r  floatrH  r(   r(   r,   r    s   
z%_MinimalOutputTests.test_format_specsc                 C   s6   | j }t|}| || t|}| || d S r   )r   copyr   deepcopy)r*   r+  copieddeepr(   r(   r,   	test_copy  s
   

z_MinimalOutputTests.test_copyN)r/   r0   r1   r  r  r  r  r  r(   r(   r(   r,   r    s    

r  c                   @   r$   )
_FlagTestsc                 C   sJ   |  td}| d W d    n1 sw   Y  | |jjd  d S )Nz'RED' is not a valid RED)r   r   r   r*  r_   __context__)r*   ctxr(   r(   r,   *test_default_missing_with_wrong_type_value  s   z5_FlagTests.test_default_missing_with_wrong_type_valueN)r/   r0   r1   r  r(   r(   r(   r,   r    s    r  c                   @      e Zd ZeZdS )TestPlainEnumN)r/   r0   r1   r   r   r(   r(   r(   r,   r    rq  r  c                   @   r  )TestPlainFlagN)r/   r0   r1   r   r   r(   r(   r(   r,   r    rq  r  c                   @   r  )TestIntEnumN)r/   r0   r1   r   r   r(   r(   r(   r,   r    rq  r  c                   @   r  )r<  N)r/   r0   r1   r   r   r(   r(   r(   r,   r<    rq  r<  c                   @   r  )TestIntFlagN)r/   r0   r1   r   r   r(   r(   r(   r,   r     rq  r  c                   @      e Zd ZG dd deeZdS )TestMixedIntc                   @   rv   )zTestMixedInt.enum_typeNrw   r(   r(   r(   r,   r   %      r   N)r/   r0   r1   intr   r   r(   r(   r(   r,   r  $      r  c                   @   r  )TestMixedStrc                   @   rv   )zTestMixedStr.enum_typeNrw   r(   r(   r(   r,   r   )  r  r   N)r/   r0   r1   r  r   r   r(   r(   r(   r,   r  (  r  r  c                   @   r  )TestMixedIntFlagc                   @   rv   )zTestMixedIntFlag.enum_typeNrw   r(   r(   r(   r,   r   -  r  r   N)r/   r0   r1   r  r   r   r(   r(   r(   r,   r  ,  r  r  c                   @   sH   e Zd Zedddedddeddd	gZg d
ZG dd deeZdS )TestMixedDate          r6        rr     )r  r  r  )r  r6   r  )r  rr  r  c                   @   r$   )zTestMixedDate.enum_typec                 C      g d}|| S )Nr  r(   r   startcountlast_valuesr  r(   r(   r,   _generate_next_value_6     z-TestMixedDate.enum_type._generate_next_value_Nr/   r0   r1   r  r(   r(   r(   r,   r   5  r2   r   N)r/   r0   r1   r
   r  r  r   r   r(   r(   r(   r,   r  0      "r  c                   @   sH   e Zd ZedddedddedddgZg dZG d	d
 d
eeZdS )TestMinimalDate  r  r5     r!        )r  r  r5   )r  r!   r  )r  r5   r5   c                   @   r$   )zTestMinimalDate.enum_typec                 C   r  )Nr  r(   r  r(   r(   r,   r  A  r  z/TestMinimalDate.enum_type._generate_next_value_Nr  r(   r(   r(   r,   r   @  r2   r   N)r/   r0   r1   r
   r  r  r   r   r(   r(   r(   r,   r  ;  r  r  c                   @   &   e Zd Zg dZG dd deeZdS )TestMixedFloatg?g@gffffff
@c                   @   r$   )zTestMixedFloat.enum_typec                 C   r  )Nr  r(   r  r(   r(   r,   r  K  r  z.TestMixedFloat.enum_type._generate_next_value_Nr  r(   r(   r(   r,   r   J  r2   r   N)r/   r0   r1   r  r  r   r   r(   r(   r(   r,   r  F      r  c                   @   r  )TestMinimalFloatg@g      @gffffff@c                   @   r$   )zTestMinimalFloat.enum_typec                 C   r  )Nr  r(   r  r(   r(   r,   r  U  r  z0TestMinimalFloat.enum_type._generate_next_value_Nr  r(   r(   r(   r,   r   T  r2   r   N)r/   r0   r1   r  r  r   r   r(   r(   r(   r,   r   P  r  r   c                   @   sZ  e Zd ZdZdd Zdd Zdd Zedd	d
 Z	dd Z
dd Zdd Zdd Zeedkddd Zeedk ddd Zdd Zdd Zdd Zd d! Zd"d# Zd$d% Zd&d' Zd(d) Zd*d+ Zd,d- Zd.d/ Zd0d1 Zd2d3 Zd4d5 Zd6d7 Z d8d9 Z!d:d; Z"d<d= Z#d>d? Z$d@dA Z%dBdC Z&dDdE Z'dFdG Z(dHdI Z)dJdK Z*dLdM Z+dNdO Z,dPdQ Z-dRdS Z.dTdU Z/dVdW Z0dXdY Z1dZd[ Z2d\d] Z3d^d_ Z4d`da Z5dbdc Z6ddde Z7dfdg Z8dhdi Z9djdk Z:dldm Z;dndo Z<dpdq Z=drds Z>dtdu Z?dvdw Z@dxdy ZAdzd{ ZBd|d} ZCd~d ZDdd ZEdd ZFdd ZGdd ZHdd ZIdd ZJdd ZKdd ZLdd ZMdd ZNdd ZOdd ZPdd ZQdd ZRdd ZSdd ZTdd ZUdd ZVdd ZWdd ZXdd ZYdd ZZdd Z[dd Z\dd Z]eedkddd Z^eedkddd Z_dd Z`dd Zadd Zbdd Zcdd ZdddÄ Zeddń ZfddǄ ZgdS )TestSpecialzM
    various operations that are not attributable to every possible enum
    c                 C   sl   G dd dt }|| _G dd dt}|| _G dd dtt }|| _ddlm} G d	d
 d
|t }|| _d S )Nc                   @   r@   )z!TestSpecial.setUp.<locals>.Seasonr5   r!   r6   r?   N)r/   r0   r1   r  r  r  WINTERr(   r(   r(   r,   r  `  rD   r  c                   @       e Zd ZdZdZdZdZdZdS )z!TestSpecial.setUp.<locals>.Gradesr  r?   r6   r!   r   Nr/   r0   r1   ABCDFr(   r(   r(   r,   Gradesg      r  c                   @   r@   )z&TestSpecial.setUp.<locals>.DirectionaleastwestnorthsouthN)r/   r0   r1   EASTWESTNORTHSOUTHr(   r(   r(   r,   Directionalo  rD   r  r   r	   c                   @   rG   )z"TestSpecial.setUp.<locals>.Holiday)  r5   r5   )r  r6   r  N)r/   r0   r1   NEW_YEARIDES_OF_MARCHr(   r(   r(   r,   Holidayw  rL   r  )	r   r  r   r  r  r  datetimer
   r  )r*   r  r  r  r
   r  r(   r(   r,   r  _  s   
zTestSpecial.setUpc                 C   s~   G dd dt }| |j | |j G dd dt }| |j | |j G dd dtt }| |j | |j d S )Nc                   @   rG   )z$TestSpecial.test_bool.<locals>.LogicTFNr/   r0   r1   truefalser(   r(   r(   r,   Logic~  rL   r  c                   @      e Zd ZdZdZdd ZdS )z(TestSpecial.test_bool.<locals>.RealLogicTFc                 S   
   t | jS r   )boolr\  r   r(   r(   r,   __bool__  r   z1TestSpecial.test_bool.<locals>.RealLogic.__bool__N)r/   r0   r1   r  r  r"  r(   r(   r(   r,   	RealLogic      r#  c                   @   rG   )z'TestSpecial.test_bool.<locals>.IntLogicr5   r   Nr  r(   r(   r(   r,   IntLogic  rL   r%  )r   r   r  r  r}   r  )r*   r  r#  r%  r(   r(   r,   	test_bool|  s   zTestSpecial.test_boolc                 C   s   | j }| t |j|jk  W d    n1 sw   Y  | t |jdk W d    n1 s3w   Y  | |jd G dd dt}| |j|j | t |j|jk  W d    d S 1 sfw   Y  d S )Nr?   r5   c                   @   r3   )z*TestSpecial.test_comparisons.<locals>.Partr5   r!   r6   N)r/   r0   r1   r  CLIPBARRELr(   r(   r(   r,   Part  r;   r)  )r  r  	TypeErrorr  r  r  r   r'  )r*   r  r)  r(   r(   r,   test_comparisons  s   "zTestSpecial.test_comparisonsz
to-do listc                 C   s   G dd dt }t|}| d| | d| | d| | d| G dd dt }t|}| d| | d| | d| | d| d S )	Nc                   @   rv   )z;TestSpecial.test_dir_with_custom_dunders.<locals>.PlainEnumNrw   r(   r(   r(   r,   	PlainEnum  ry   r,  r{  r   r   r   c                   @   r  )
z8TestSpecial.test_dir_with_custom_dunders.<locals>.MyEnumc                 S   
   t | S r   r>  r{  r   r(   r(   r,   r{    r   zATestSpecial.test_dir_with_custom_dunders.<locals>.MyEnum.__repr__c                 S   r-  r   r.  r   r(   r(   r,   r     r   z@TestSpecial.test_dir_with_custom_dunders.<locals>.MyEnum.__str__c                 S   r-  r   r.  r   r(   r(   r,   r     r   zCTestSpecial.test_dir_with_custom_dunders.<locals>.MyEnum.__format__c                 S   r  r   r(   r   r(   r(   r,   r     r.   zATestSpecial.test_dir_with_custom_dunders.<locals>.MyEnum.__init__N)r/   r0   r1   r{  r   r   r   r(   r(   r(   r,   r     s
    r   )r   rF  r=  r:  )r*   r,  cls_dirr   r(   r(   r,   test_dir_with_custom_dunders  s   	z(TestSpecial.test_dir_with_custom_dundersc                 C   s   |  t G dd dt}W d    n1 sw   Y  |  t G dd dt}W d    n1 s5w   Y  |  t G dd dt}W d    d S 1 sSw   Y  d S )Nc                   @   s   e Zd ZdZdZdZdZdS )4TestSpecial.test_duplicate_name_error.<locals>.Colorr5   r!   r6   r?   Nr/   r0   r1   redgreenbluer(   r(   r(   r,   Color  rD   r6  c                   @   s    e Zd ZdZdZdZdd ZdS )r1  r5   r!   r6   c                 S   r&   )Nr3  r(   r   r(   r(   r,   r3    r.   8TestSpecial.test_duplicate_name_error.<locals>.Color.redNr2  r(   r(   r(   r,   r6    
    c                   @   s&   e Zd Zejdd ZdZdZdZdS )r1  c                 S   r&   )Nredderr(   r   r(   r(   r,   r3       r7  r5   r!   r6   N)r/   r0   r1   r~   r   r3  r4  r5  r(   r(   r(   r,   r6    s    
r  r*  r   r*   r6  r(   r(   r,   test_duplicate_name_error  s   "z%TestSpecial.test_duplicate_name_errorc                 C   s    t ttrt| tjd d S )NrR   )rY  rQ   	Exceptionr   r1   r   r(   r(   r,    test_enum_function_with_qualname  s   
z,TestSpecial.test_enum_function_with_qualnamec                    s   G dd dt }| |jjt | |jjt | |jjt G dd dG dd d G  fdddt }| |j	j | |j
j  G d	d
 d
G fdddt }| |jj dS )2Support using Enum to refer to types deliberately.c                   @   s   e Zd ZeZeZeZdS )z/TestSpecial.test_enum_of_types.<locals>.MyTypesN)	r/   r0   r1   r  ir  fr  r   r(   r(   r(   r,   MyTypes  r;   rC  c                   @   rv   )z+TestSpecial.test_enum_of_types.<locals>.FooNrw   r(   r(   r(   r,   Foo  ry   rD  c                   @   rv   )z+TestSpecial.test_enum_of_types.<locals>.BarNrw   r(   r(   r(   r,   Bar  ry   rE  c                       s   e Zd ZZ ZdS )z0TestSpecial.test_enum_of_types.<locals>.MyTypes2N)r/   r0   r1   r   br(   rE  rD  r(   r,   MyTypes2  rL   rH  c                   @   rv   )z8TestSpecial.test_enum_of_types.<locals>.SpamEnumNotInnerNrw   r(   r(   r(   r,   SpamEnumNotInner  ry   rI  c                       s   e Zd Z ZdS )z0TestSpecial.test_enum_of_types.<locals>.SpamEnumN)r/   r0   r1   r  r(   )rI  r(   r,   SpamEnum  rq  rJ  N)r   r   rA  r  r  rB  r  r   r  r   rF  r  r*   rC  rH  rJ  r(   )rE  rD  rI  r,   test_enum_of_types     zTestSpecial.test_enum_of_typesc                 C   sb   G dd dt }| |jjtjt  | |jjtt  | t	|jd | t	|jd d S )Nc                   @   s   e Zd Zeje Zee ZdS )z3TestSpecial.test_enum_of_generic_aliases.<locals>.EN)	r/   r0   r1   typingListr  r   r   rF  r(   r(   r(   r,   E  s    
rP  z<E.a: typing.List[int]>z<E.b: list[int]>)
r   r   r   r  rN  rO  r  rF  r   r(  )r*   rP  r(   r(   r,   test_enum_of_generic_aliases  s
   z(TestSpecial.test_enum_of_generic_aliasesr6      zinner classes are not membersc                 C   s   |  td G dd dt}W d   n1 sw   Y  | t|j| | |jjd | |jjj	jd | t
|jj|jjj	|jjjg | t
||j|j|jg dS )z-
        Check for warnings pre-3.13
        zwill not become a memberc                   @   $   e Zd ZdZdZG dd deZdS )zBTestSpecial.test_nested_classes_in_enum_are_members.<locals>.Outerr5   r!   c                   @   rG   )zHTestSpecial.test_nested_classes_in_enum_are_members.<locals>.Outer.Inner
   rr  Nr/   r0   r1   rx   barr(   r(   r(   r,   Inner  rL   rX  Nr/   r0   r1   r   rF  r   rX  r(   r(   r(   r,   Outer      rZ  Nr5   rU  )assertWarnsRegexDeprecationWarningr   r   rY  rX  r   r   r  rx   r   rW  rF  r*   rZ  r(   r(   r,   'test_nested_classes_in_enum_are_members  s   
z3TestSpecial.test_nested_classes_in_enum_are_memberszinner classes are still membersc                 C   s~   G dd dt }| t|jt | |jjd | |jjjd | t	|j|jj|jj
g | t	||j|jg dS )'Support locally-defined nested classes.c                   @   rT  )zFTestSpecial.test_nested_classes_in_enum_are_not_members.<locals>.Outerr5   r!   c                   @   rG   )zLTestSpecial.test_nested_classes_in_enum_are_not_members.<locals>.Outer.InnerrU  rr  NrV  r(   r(   r(   r,   rX     rL   rX  NrY  r(   r(   r(   r,   rZ    r[  rZ  r5   rU  Nr   r   rY  rX  r;  r   r   r  rx   r   rW  rF  r^  r(   r(   r,   +test_nested_classes_in_enum_are_not_members  s   
z7TestSpecial.test_nested_classes_in_enum_are_not_membersc                 C   s~   G dd dt }| t|jt | |jjd | |jjjd | t	|j|jj|jj
g | t	||j|jg d S )Nc                   @   (   e Zd ZdZdZeG dd deZdS )zETestSpecial.test_nested_classes_in_enum_with_nonmember.<locals>.Outerr5   r!   c                   @   rG   )zKTestSpecial.test_nested_classes_in_enum_with_nonmember.<locals>.Outer.InnerrU  rr  NrV  r(   r(   r(   r,   rX  3  r   rX  N)r/   r0   r1   r   rF  r   r   rX  r(   r(   r(   r,   rZ  0  
    rZ  r5   rU  ra  r^  r(   r(   r,   *test_nested_classes_in_enum_with_nonmember/  s   
z6TestSpecial.test_nested_classes_in_enum_with_nonmemberc                    s   G dd dt }| |jjt | |jtu  | |jjt	 G dd dG dd d G  fdddt }| |j
j | |j u  G d	d
 d
G fdddt }| |ju  dS )r@  c                   @   s   e Zd ZeZeeZeZ	dS )z>TestSpecial.test_enum_of_types_with_nonmember.<locals>.MyTypesN)
r/   r0   r1   r  rA  r   r  rB  r  r   r(   r(   r(   r,   rC  E  s    rC  c                   @   rv   )z:TestSpecial.test_enum_of_types_with_nonmember.<locals>.FooNrw   r(   r(   r(   r,   rD  L  ry   rD  c                   @   rv   )z:TestSpecial.test_enum_of_types_with_nonmember.<locals>.BarNrw   r(   r(   r(   r,   rE  N  ry   rE  c                       s   e Zd ZZe ZdS )z?TestSpecial.test_enum_of_types_with_nonmember.<locals>.MyTypes2N)r/   r0   r1   r   r   rF  r(   rG  r(   r,   rH  P      rH  c                   @   rv   )zFTestSpecial.test_enum_of_types_with_nonmember.<locals>.SpamEnumIsInnerNrw   r(   r(   r(   r,   SpamEnumIsInnerU  ry   rg  c                       s   e Zd Ze ZdS )z?TestSpecial.test_enum_of_types_with_nonmember.<locals>.SpamEnumN)r/   r0   r1   r   r  r(   )rg  r(   r,   rJ  W  r2   rJ  N)r   r   rA  r  r  r   rB  r  r   r  r   rF  r  rK  r(   )rE  rD  rg  r,   !test_enum_of_types_with_nonmemberC  rM  z-TestSpecial.test_enum_of_types_with_nonmemberc                 C   s   G dd dt }| t|j| | |jjd | |jjjjd | t|jj|jjj|jjj	g | t||j|j
|jg dS )r`  c                   @   rc  )zBTestSpecial.test_nested_classes_in_enum_with_member.<locals>.Outerr5   r!   c                   @   rG   )zHTestSpecial.test_nested_classes_in_enum_with_member.<locals>.Outer.InnerrU  rr  NrV  r(   r(   r(   r,   rX  `  r   rX  N)r/   r0   r1   r   rF  r   r   rX  r(   r(   r(   r,   rZ  ]  rd  rZ  r5   rU  N)r   r   rY  rX  r   r   r  rx   r   rW  rF  r^  r(   r(   r,   'test_nested_classes_in_enum_with_member[  s   
z3TestSpecial.test_nested_classes_in_enum_with_memberc                 C   s^   G dd dt }| t||j|jg | t|j| | |jjd | |jjd d S )Nc                   @   rG   )z2TestSpecial.test_enum_with_value_name.<locals>.Huhr5   r!   N)r/   r0   r1   r   r  r(   r(   r(   r,   Huhq  rL   rj  r   r5   )r   r   r   r   r  r*  r;  )r*   rj  r(   r(   r,   test_enum_with_value_namep  s
   z%TestSpecial.test_enum_with_value_namec                 C   s|   G dd dt }G dd dt }G dd dt }G dd dt }| |j| | |j| | |j| | |j| d S )	Nc                   @   rk  )zBTestSpecial.test_contains_name_and_value_overlap.<locals>.IntEnum1r5   Nr/   r0   r1   Xr(   r(   r(   r,   IntEnum1z  rq  rn  c                   @   rk  )zBTestSpecial.test_contains_name_and_value_overlap.<locals>.IntEnum2r5   Nrl  r(   r(   r(   r,   IntEnum2|  rq  ro  c                   @   rk  )zBTestSpecial.test_contains_name_and_value_overlap.<locals>.IntEnum3r!   Nrl  r(   r(   r(   r,   IntEnum3~  rq  rp  c                   @   rk  )zBTestSpecial.test_contains_name_and_value_overlap.<locals>.IntEnum4r5   N)r/   r0   r1   Yr(   r(   r(   r,   IntEnum4  rq  rr  )r   r:  rm  r=  )r*   rn  ro  rp  rr  r(   r(   r,   $test_contains_name_and_value_overlapy  s   z0TestSpecial.test_contains_name_and_value_overlapc                 C   s@   G dd dt }G dd dt}| |j| | |j| d S )Nc                   @   rk  )zHTestSpecial.test_contains_different_types_same_members.<locals>.IntEnum1r5   Nrl  r(   r(   r(   r,   rn    rq  rn  c                   @   rk  )zHTestSpecial.test_contains_different_types_same_members.<locals>.IntFlag1r5   Nrl  r(   r(   r(   r,   IntFlag1  rq  rt  )r   r   r:  rm  )r*   rn  rt  r(   r(   r,   *test_contains_different_types_same_members  s   z6TestSpecial.test_contains_different_types_same_membersc                 C   s8  G dd dt }G dd d|tj}| t|jd |t d< |t d< t| j|j t| j| G dd d|}G dd	 d	|tj}| |j	| |t d< |t d	< t| j|j
 t| j| G d
d dt }G dd d|t}| |j	| | |d|j |t d< |t d< t| j|j t| j| d S )Nc                   @      e Zd ZdZdd ZdS )z4TestSpecial.test_inherited_data_type.<locals>.HexIntHexIntc                 S      t | S r   hexr   r(   r(   r,   r{       z=TestSpecial.test_inherited_data_type.<locals>.HexInt.__repr__Nr  r(   r(   r(   r,   rw    rf  rw  c                   @      e Zd ZdZdZdZdZdS )z4TestSpecial.test_inherited_data_type.<locals>.MyEnumr   r5   r!   r6   N)r/   r0   r1   r  r  r  r(   r(   r(   r,   r     rD   r   z<MyEnum.A: 0x1>c                   @   s   e Zd ZdZdS )z6TestSpecial.test_inherited_data_type.<locals>.SillyIntSillyIntNrw   r(   r(   r(   r,   r}    s    r}  c                   @   r|  )z9TestSpecial.test_inherited_data_type.<locals>.MyOtherEnumMyOtherEnumr?   r     N)r/   r0   r1   r	  rP  r
  r(   r(   r(   r,   r~    rD   r~  c                   @   rv  )z9TestSpecial.test_inherited_data_type.<locals>.UnBrokenIntUnBrokenIntc                 S   s   t | |S r   )r  rX  r  r  r(   r(   r,   rX    r|  zATestSpecial.test_inherited_data_type.<locals>.UnBrokenInt.__new__Nr`  r(   r(   r(   r,   r    rf  r  c                   @   r|  )z<TestSpecial.test_inherited_data_type.<locals>.MyUnBrokenEnumMyUnBrokenEnumr      rn  N)r/   r0   r1   GHIr(   r(   r(   r,   r    rD   r  r   )r  r~   r   r   r(  r  globalsr^   r*  r  rP  r  r  )r*   rw  r   r}  r~  r  r  r(   r(   r,   test_inherited_data_type  s,   





z$TestSpecial.test_inherited_data_typec                 C   sn   t tjj}| t|tj t tjjd }| t t| W d    d S 1 s0w   Y  d S )Ng{Gz?)	r  rz  r=   r:   r  r*  fromhexr  r   )r*   hr(   r(   r,   test_floatenum_fromhex  s   "z"TestSpecial.test_floatenum_fromhexc                 C   s   t ddtd}t|}| t|t| | t|d| | |j|j|jg| td	 dD ]#\}}||}| || | |j
| | || | t|| q1d S )Nr  r  )r;  r6   r5   r   r  r   r   r[  r  r  r  	enumerater  r   r:  r*  r;  r*   r  r  rA  r  r  r(   r(   r,   test_programmatic_function_type     z+TestSpecial.test_programmatic_function_typec                 C   s   t dddd}t|}| t|t| | t|d| | |j|j|jg| td dD ],\}}||}| t	|j
| | || | |j| | || | t|| q1d S )Nr  r  rU  r  r6   r   r   r   r[  r  r  r  r  r  r  r  r  r   r:  r*  r;  r  r(   r(   r,   ,test_programmatic_function_string_with_start  s    z8TestSpecial.test_programmatic_function_string_with_startc                 C   s   t ddtdd}t|}| t|t| | t|d| | |j|j|jg| td	 dD ]#\}}||}| || | |j
| | || | t|| q2d S )Nr  r     )r;  r  r6   r  r  r(   r(   r,   *test_programmatic_function_type_with_start  s   z6TestSpecial.test_programmatic_function_type_with_startc                 C   s   t dg ddd}t|}| t|t| | t|d| | |j|j|jg| td dD ],\}}||}| t	|j
| | || | |j| | || | t|| q3d S )Nr  r     r  r6   r  r  r  r(   r(   r,   1test_programmatic_function_string_list_with_start  s    z=TestSpecial.test_programmatic_function_string_list_with_startc                 C   s   t dd}t|}| t|t| | t|d| | |j|j|jg| td dD ]#\}}||}| || | |j	| | 
|| | t|| q/d S )Nr  r  r6   r5   r   r   r   r[  r  r  r  r  r  r   r:  r*  r;  r  r(   r(   r,   -test_programmatic_function_type_from_subclass  s   
z9TestSpecial.test_programmatic_function_type_from_subclassc                 C   s   t dddd}t|}| t|t| | t|d| | |j|j|jg| td dD ]#\}}||}| || | |j	| | 
|| | t|| q1d S )Nr  r  (   r  r6   r  r  r(   r(   r,   8test_programmatic_function_type_from_subclass_with_start  r  zDTestSpecial.test_programmatic_function_type_from_subclass_with_startc                 C   s   G dd dt }| td|d | |d|j | |dd|j G dd dt }| |d	|j | |d
dd|j d S )Nc                   @   r3   )zETestSpecial.test_programmatic_function_is_value_call.<locals>.TwoPartr5         ?)r!          @)r6         @Nr/   r0   r1   r   r   THREEr(   r(   r(   r,   TwoPart(  r;   r  z1 is not a valid .*TwoPartr5   r  r  c                   @   r3   )zGTestSpecial.test_programmatic_function_is_value_call.<locals>.ThreePart)r5   r  r0  )r!   r  r1  r6   r  threeNr  r(   r(   r(   r,   	ThreePart/  r;   r  r  r6   r  r  )r   r   r   r*  r   r  )r*   r  r  r(   r(   r,   (test_programmatic_function_is_value_call'  s   z4TestSpecial.test_programmatic_function_is_value_callc                 C   sR   |  tddtj | t tdd W d    d S 1 s"w   Y  d S )Ns    bigs    )r*  r<   
from_bytesr:   r  r   r   r(   r(   r,   test_intenum_from_bytes6  s   "z#TestSpecial.test_intenum_from_bytesc                 C   B   |  td G dd dt}W d    d S 1 sw   Y  d S )Nz-_sunder_ names, such as ._bad_., are reservedc                   @   rk  )z3TestSpecial.test_reserved_sunder_error.<locals>.Badr5   N)r/   r0   r1   rd   r(   r(   r(   r,   Bad@  rq  r  )r   r   r   )r*   r  r(   r(   r,   test_reserved_sunder_error;  s   "z&TestSpecial.test_reserved_sunder_errorc                 C   s   |  td G dd dttt}W d    n1 sw   Y  G dd dt}G dd dt}|  td G dd d||t}W d    d S 1 sLw   Y  d S )	Nztoo many data typesc                   @   rk  z1TestSpecial.test_too_many_data_types.<locals>.Huhr5   Nr/   r0   r1   Oner(   r(   r(   r,   rj  E  rq  rj  c                   @   r$   )z3TestSpecial.test_too_many_data_types.<locals>.MyStrc                 S   s   d|  S )Nz	hello, %sr(   r   r(   r(   r,   helloI  r{  z9TestSpecial.test_too_many_data_types.<locals>.MyStr.helloNr/   r0   r1   r  r(   r(   r(   r,   MyStrH  r2   r  c                   @   r$   )z3TestSpecial.test_too_many_data_types.<locals>.MyIntc                 S   rx  r   ry  r   r(   r(   r,   r(  L  r{  z8TestSpecial.test_too_many_data_types.<locals>.MyInt.reprN)r/   r0   r1   r(  r(   r(   r(   r,   MyIntK  r2   r  c                   @   rk  r  r  r(   r(   r(   r,   rj  O  rq  )r   r*  r  r  r   )r*   rj  r  r  r(   r(   r,   test_too_many_data_typesC  s   "z$TestSpecial.test_too_many_data_typesc                 C   ,   t ttrtt| jtj t| jt d S r   )rY  r4   r>  r^   r*  r9   r   r(   r(   r,   test_pickle_enumS     
zTestSpecial.test_pickle_enumc                 C   r  r   )rY  r<   r>  r^   r*  r9   r   r(   r(   r,   test_pickle_intY  r  zTestSpecial.test_pickle_intc                 C   r  r   )rY  r=   r>  r^   r*  r9   r   r(   r(   r,   test_pickle_float_  r  zTestSpecial.test_pickle_floatc                 C   r  r   )rY  rP   r>  r^   r*  himr   r(   r(   r,   test_pickle_enum_functione  r  z%TestSpecial.test_pickle_enum_functionc                 C   r  r   )rY  rM   r>  r^   r*  whor   r(   r(   r,   %test_pickle_enum_function_with_modulek  r  z1TestSpecial.test_pickle_enum_function_with_modulec                 C   s<   G dd dt }|| j_d| jj | j_t| j| jj d S )Nc                   @   rG   )z8TestSpecial.test_pickle_nested_class.<locals>.NestedEnumcommonrareN)r/   r0   r1   twigsshinyr(   r(   r(   r,   
NestedEnums  rL   r  z%s.NestedEnum)r   	__class__r  r/   r1   r^   r*  r  )r*   r  r(   r(   r,   test_pickle_nested_classq  s   z$TestSpecial.test_pickle_nested_classc                 C   s>   G dd dt }tj|_ttD ]}| |j|d qd S )Nc                   @   rG   )z9TestSpecial.test_pickle_by_name.<locals>.ReplaceGlobalIntr5   r!   Nr   r(   r(   r(   r,   ReplaceGlobalInt|  rL   r  r   )r   r~   _reduce_ex_by_name__reduce_ex__rZ   r   r   r   )r*   r  protor(   r(   r,   test_pickle_by_name{  s
   zTestSpecial.test_pickle_by_namec                 C   sD   t ddtd}|t d< t| t| jt|j t| jt	| d S )N	BadPicklezdill sweet bread-n-butterrN   )
r   r/   r  r~   make_class_unpicklablera   r  r*  dillr   )r*   r  r(   r(   r,   test_pickle_explodes  s   

z TestSpecial.test_pickle_explodesc                 C   s$   G dd dt t}| |jd d S )Nc                   @   r3   )z0TestSpecial.test_string_enum.<locals>.SkillLevelz'what is the sound of one hand clapping?z#why did the chicken cross the road?knock, knock!N)r/   r0   r1   master
journeyman
apprenticer(   r(   r(   r,   
SkillLevel  r;   r  r  )r  r   r   r  )r*   r  r(   r(   r,   test_string_enum  s   zTestSpecial.test_string_enumc                 C   sL   G dd dt }| |d|j | t|d|j | |d |j d S )Nc                   @   r@   )z0TestSpecial.test_getattr_getitem.<locals>.Periodr5   r!   r6   r?   N)r/   r0   r1   morningnooneveningnightr(   r(   r(   r,   Period  rD   r  r!   r  r  )r   r*  r  r
  r  r  r*   r  r(   r(   r,   test_getattr_getitem  s   z TestSpecial.test_getattr_getitemc                 C   s   | j }| t|d d S )Nr-   )r  r   r
  r  r(   r(   r,   test_getattr_dunder  s   zTestSpecial.test_getattr_dunderc                 C   s4   G dd dt }| t||j|j|j|jg d S )Nc                   @   r@   )z0TestSpecial.test_iteration_order.<locals>.Seasonr!   r?   r6   r5   N)r/   r0   r1   r  r  r  r  r(   r(   r(   r,   r    rD   r  )r   r   r   r  r  r  r  r  r(   r(   r,   test_iteration_order  s
   z TestSpecial.test_iteration_orderc                 C   sT   t ttrt| tjd | tjtd | tjttd t| jtj d S )NrI   rJ   )	rY  rH   r>  r   rJ   r   r*  r
  r^   r   r(   r(   r,   test_subclassing  s   
zTestSpecial.test_subclassingc                 C   s   G dd dt }| t G dd d|}W d    n1 s w   Y  | td G dd d|t}W d    n1 s?w   Y  | td |d	d
 W d    d S 1 s[w   Y  d S )Nc                   @   r3   )z)TestSpecial.test_extending.<locals>.Colorr5   r!   r6   Nr2  r(   r(   r(   r,   r6    r;   r6  c                   @   r3   )z-TestSpecial.test_extending.<locals>.MoreColorr?   r  r  Nr/   r0   r1   cyanmagentayellowr(   r(   r(   r,   	MoreColor  r;   r  z3<enum .EvenMoreColor.> cannot extend <enum .Color.>c                   @   rk  )z1TestSpecial.test_extending.<locals>.EvenMoreColorr   N)r/   r0   r1   
chartrueser(   r(   r(   r,   EvenMoreColor  rq  r  z5\(.Foo., \(.pink., .black.\)\) is not a valid .*ColorrD  )pinkblack)r   r  r*  r   r   r   )r*   r6  r  r  r(   r(   r,   test_extending  s   "zTestSpecial.test_extendingc                 C   s8   G dd dt }| t|j| | |j d d S )Nc                   @   r  )z2TestSpecial.test_exclude_methods.<locals>.whateverr6  thosec                 S   r   )Nz
no, not %sr%  r   r(   r(   r,   really  r   z9TestSpecial.test_exclude_methods.<locals>.whatever.reallyN)r/   r0   r1   r5  rM  r  r(   r(   r(   r,   whatever  r$  r  zno, not that)r   assertIsNotr;  r  r   r5  )r*   r  r(   r(   r,   test_exclude_methods  s   z TestSpecial.test_exclude_methodsc                 C   sB   |  t G dd dtt}W d    d S 1 sw   Y  d S )Nc                   @   rk  )z7TestSpecial.test_wrong_inheritance_order.<locals>.Wrongzerror before this pointN)r/   r0   r1   NotHerer(   r(   r(   r,   rp    rq  rp  )r  r*  r   r  rw  r(   r(   r,   test_wrong_inheritance_order  s   "z(TestSpecial.test_wrong_inheritance_orderc                 C   sT   G dd dt }G dd dt }| |j|j | |j|j | |j|j d S )Nc                   @   r3   )z5TestSpecial.test_intenum_transitivity.<locals>.numberr5   r!   r6   Nr/   r0   r1   r0  r1  r  r(   r(   r(   r,   number  r;   r  c                   @   r3   )z5TestSpecial.test_intenum_transitivity.<locals>.numeror5   r!   r6   N)r/   r0   r1   unodostresr(   r(   r(   r,   numero  r;   r  )r   r   r0  r  r1  r  r  r  )r*   r  r  r(   r(   r,   test_intenum_transitivity  s
   z%TestSpecial.test_intenum_transitivityc                 C   s4   G dd dt }G dd dt }| t||j d S )Nc                   @   rG   )z7TestSpecial.test_wrong_enum_in_call.<locals>.Monochromer   r5   Nr/   r0   r1   r  whiter(   r(   r(   r,   
Monochrome  rL   r  c                   @   rG   )z3TestSpecial.test_wrong_enum_in_call.<locals>.Genderr   r5   Nr/   r0   r1   malefemaler(   r(   r(   r,   Gender  rL   r  )r   r  r   r  r*   r  r  r(   r(   r,   test_wrong_enum_in_call     z#TestSpecial.test_wrong_enum_in_callc                 C   s4   G dd dt }G dd dt}| t||j d S )Nc                   @   rG   )z=TestSpecial.test_wrong_enum_in_mixed_call.<locals>.Monochromer   r5   Nr  r(   r(   r(   r,   r    rL   r  c                   @   rG   )z9TestSpecial.test_wrong_enum_in_mixed_call.<locals>.Genderr   r5   Nr  r(   r(   r(   r,   r    rL   r  )r   r   r  r   r  r  r(   r(   r,   test_wrong_enum_in_mixed_call  r  z)TestSpecial.test_wrong_enum_in_mixed_callc                 C   s8   G dd dt }G dd dt }| ||j|j d S )Nc                   @   rG   )z9TestSpecial.test_mixed_enum_in_call_1.<locals>.Monochromer   r5   Nr  r(   r(   r(   r,   r    rL   r  c                   @   rG   )z5TestSpecial.test_mixed_enum_in_call_1.<locals>.Genderr   r5   Nr  r(   r(   r(   r,   r    rL   r  )r   r*  r  r  r  r(   r(   r,   test_mixed_enum_in_call_1     z%TestSpecial.test_mixed_enum_in_call_1c                 C   s8   G dd dt }G dd dt}| ||j|j d S )Nc                   @   rG   )z9TestSpecial.test_mixed_enum_in_call_2.<locals>.Monochromer   r5   Nr  r(   r(   r(   r,   r    rL   r  c                   @   rG   )z5TestSpecial.test_mixed_enum_in_call_2.<locals>.Genderr   r5   Nr  r(   r(   r(   r,   r    rL   r  )r   r   r*  r  r  r  r(   r(   r,   test_mixed_enum_in_call_2  r  z%TestSpecial.test_mixed_enum_in_call_2c                 C   s6   G dd dt }G dd d|}| t|jd d S )Nc                   @   r$   )z-TestSpecial.test_flufl_enum.<locals>.Fluflnumc                 S   r   r   )r  r  r   r(   r(   r,   __int__  r   z5TestSpecial.test_flufl_enum.<locals>.Fluflnum.__int__N)r/   r0   r1   r  r(   r(   r(   r,   Fluflnum  r2   r  c                   @   r3   )z3TestSpecial.test_flufl_enum.<locals>.MailManOptionsr5   r!   r6   N)r/   r0   r1   option1option2option3r(   r(   r(   r,   MailManOptions
  r;   r	  r5   )r   r   r  r  )r*   r  r	  r(   r(   r,   test_flufl_enum  s   zTestSpecial.test_flufl_enumc                 C   s   G dd dt }| |jjt | |jt G dd dtt}| |jjt | |jt G dd dt}| |jjt	 | |jt	 d S )Nc                   @   rG   )z.TestSpecial.test_introspection.<locals>.Numberd      Nr/   r0   r1   r0  r1  r(   r(   r(   r,   Number  rL   r  c                   @   r3   )z.TestSpecial.test_introspection.<locals>.StringsoftroughhardN)r/   r0   r1   yarnropewirer(   r(   r(   r,   String  r;   r  c                   @   rG   )z-TestSpecial.test_introspection.<locals>.Plainr  r5   N)r/   r0   r1   vanillar0  r(   r(   r(   r,   Plain  rL   r  )
r   r*  r0  r  r  r  r   r  r  r>  )r*   r  r  r  r(   r(   r,   test_introspection  s   zTestSpecial.test_introspectionc                 C   sz   G dd dt }| t |d W d    n1 sw   Y  | t |d  W d    d S 1 s6w   Y  d S )Nc                   @   r3   )z3TestSpecial.test_no_such_enum_member.<locals>.Colorr5   r!   r6   Nr2  r(   r(   r(   r,   r6  #  r;   r6  r?   
chartreuse)r   r  r   KeyErrorr<  r(   r(   r,   test_no_such_enum_member"  s   

"z$TestSpecial.test_no_such_enum_memberc                    sd   G  fdddt t G dd dt d}G dd dt d}G dd	 d	|}G d
d d|}d S )Nc                          e Zd Z fddZ  ZS )z6TestSpecial.test_multiple_mixin_mro.<locals>.auto_enumc           	         s   t | }||_t|j}d}|jD ]}|| }|tu r|}n|}|d7 }|||< q| D ]\}}||vr:|||< q.t| | |||S Nr   r5   )r;  	_cls_namerE  _member_namesEllipsisitemssuperrX  )	metaclsr  bases	classdicttempr  rA  kv)r  	auto_enumr(   r,   rX  0  s$   




z>TestSpecial.test_multiple_mixin_mro.<locals>.auto_enum.__new__r/   r0   r1   rX  __classcell__r(   r)  r  r,   r)  /  r  r)  c                   @   rv   )z=TestSpecial.test_multiple_mixin_mro.<locals>.AutoNumberedEnumNrw   r(   r(   r(   r,   AutoNumberedEnumC  ry   r.  )	metaclassc                   @   rv   )z8TestSpecial.test_multiple_mixin_mro.<locals>.AutoIntEnumNrw   r(   r(   r(   r,   AutoIntEnumF  ry   r0  c                   @      e Zd ZdZdZdZdS )z;TestSpecial.test_multiple_mixin_mro.<locals>.TestAutoNumber.r6   Nr/   r0   r1   r   rF  cr(   r(   r(   r,   TestAutoNumberI  r;   r4  c                   @   r1  )z8TestSpecial.test_multiple_mixin_mro.<locals>.TestAutoInt.r6   Nr2  r(   r(   r(   r,   TestAutoIntN  r;   r5  )r;  r   r   )r*   r.  r0  r4  r5  r(   r,  r,   test_multiple_mixin_mro.  s
   z#TestSpecial.test_multiple_mixin_mroc                       G  fdddt  G dd d t}| |jtj | t|j|j d  t d< |t d<  dd}| |d t	| j|d | |jj
d t	| j|j t	| j| d S )	Nc                       J   e Zd ZdZdd Zdd Zejdd Z dd	 Zd
d Z fddZ	dS )z=TestSpecial.test_subclasses_with_getnewargs.<locals>.NamedIntNamedIntc                 W   B   |}|^}}t |dkrtdtj| g|R  }||_||_|S Nr   z name and value must be specifiedr[  r*  r  rX  _intname_argsr  argsr>  r   r*   r(   r(   r,   rX  V     zETestSpecial.test_subclasses_with_getnewargs.<locals>.NamedInt.__new__c                 S      | j S r   r>  r   r(   r(   r,   __getnewargs___     zLTestSpecial.test_subclasses_with_getnewargs.<locals>.NamedInt.__getnewargs__c                 S   rB  r   r=  r   r(   r(   r,   r/   a     zFTestSpecial.test_subclasses_with_getnewargs.<locals>.NamedInt.__name__c                 S      d t| j| jt| S Nz{}({!r}, {})r  r;  r/   r  r{  r   r(   r(   r,   r{  d  
   zFTestSpecial.test_subclasses_with_getnewargs.<locals>.NamedInt.__repr__c                 S   &   t }|j}|jtu r|| S || S r   r  r   __objclass__r>  r{  r*   basebase_strr(   r(   r,   r   k  
   

zETestSpecial.test_subclasses_with_getnewargs.<locals>.NamedInt.__str__c                    >   t | t | }t|  rt| r d| j|j|S |S Nz({0} + {1})r  rY  r  r/   r*   r+   r&  r9  r(   r,   __add__t     zETestSpecial.test_subclasses_with_getnewargs.<locals>.NamedInt.__add__N)
r/   r0   r1   rX  rD  bltnsr   r{  r   rX  r(   rW  r(   r,   r9  T      	
	r9  c                   @      e Zd ZdZdZdZdS )z8TestSpecial.test_subclasses_with_getnewargs.<locals>.NEINEIzthe-xr5   zthe-yr!   Nr/   r0   r1   xyr(   r(   r(   r,   r]  ~  r;   r]  NamedInt('(the-x + the-y)', 3)testr  r!   r  r   r*  rX  r   r(  ra  rb  r  r^   r  r*   r]  NI5r(   rW  r,   test_subclasses_with_getnewargsS     *


z+TestSpecial.test_subclasses_with_getnewargsc                    r7  )	Nc                       r8  )z@TestSpecial.test_subclasses_with_getnewargs_ex.<locals>.NamedIntr9  c                 W   r:  r;  r<  r?  r(   r(   r,   rX    rA  zHTestSpecial.test_subclasses_with_getnewargs_ex.<locals>.NamedInt.__new__c                 S   s
   | j i fS r   rC  r   r(   r(   r,   __getnewargs_ex__  r   zRTestSpecial.test_subclasses_with_getnewargs_ex.<locals>.NamedInt.__getnewargs_ex__c                 S   rB  r   rF  r   r(   r(   r,   r/     rG  zITestSpecial.test_subclasses_with_getnewargs_ex.<locals>.NamedInt.__name__c                 S   rH  rI  rJ  r   r(   r(   r,   r{    rK  zITestSpecial.test_subclasses_with_getnewargs_ex.<locals>.NamedInt.__repr__c                 S   rL  r   rM  rO  r(   r(   r,   r     rR  zHTestSpecial.test_subclasses_with_getnewargs_ex.<locals>.NamedInt.__str__c                    rS  rT  rU  rV  rW  r(   r,   rX    rY  zHTestSpecial.test_subclasses_with_getnewargs_ex.<locals>.NamedInt.__add__N)
r/   r0   r1   rX  rj  rZ  r   r{  r   rX  r(   rW  r(   r,   r9    r[  r9  c                   @   r\  )z;TestSpecial.test_subclasses_with_getnewargs_ex.<locals>.NEIr]  r^  r_  Nr`  r(   r(   r(   r,   r]    r;   r]  rc  rd  r  r!   re  rf  r(   rW  r,   "test_subclasses_with_getnewargs_ex  ri  z.TestSpecial.test_subclasses_with_getnewargs_exc                    r7  )	Nc                       r8  )z9TestSpecial.test_subclasses_with_reduce.<locals>.NamedIntr9  c                 W   r:  r;  r<  r?  r(   r(   r,   rX    rA  zATestSpecial.test_subclasses_with_reduce.<locals>.NamedInt.__new__c                 S      | j | jfS r   r  r>  r   r(   r(   r,   
__reduce__  r|  zDTestSpecial.test_subclasses_with_reduce.<locals>.NamedInt.__reduce__c                 S   rB  r   rF  r   r(   r(   r,   r/     rG  zBTestSpecial.test_subclasses_with_reduce.<locals>.NamedInt.__name__c                 S   rH  rI  rJ  r   r(   r(   r,   r{    rK  zBTestSpecial.test_subclasses_with_reduce.<locals>.NamedInt.__repr__c                 S   rL  r   rM  rO  r(   r(   r,   r     rR  zATestSpecial.test_subclasses_with_reduce.<locals>.NamedInt.__str__c                    rS  rT  rU  rV  rW  r(   r,   rX    rY  zATestSpecial.test_subclasses_with_reduce.<locals>.NamedInt.__add__N)
r/   r0   r1   rX  rn  rZ  r   r{  r   rX  r(   rW  r(   r,   r9    r[  r9  c                   @   r\  )z4TestSpecial.test_subclasses_with_reduce.<locals>.NEIr]  r^  r_  Nr`  r(   r(   r(   r,   r]    r;   r]  rc  rd  r  r!   re  rf  r(   rW  r,   test_subclasses_with_reduce  ri  z'TestSpecial.test_subclasses_with_reducec                    r7  )	Nc                       r8  )z<TestSpecial.test_subclasses_with_reduce_ex.<locals>.NamedIntr9  c                 W   r:  r;  r<  r?  r(   r(   r,   rX  
  rA  zDTestSpecial.test_subclasses_with_reduce_ex.<locals>.NamedInt.__new__c                 S   rl  r   rm  r*   r  r(   r(   r,   r    r|  zJTestSpecial.test_subclasses_with_reduce_ex.<locals>.NamedInt.__reduce_ex__c                 S   rB  r   rF  r   r(   r(   r,   r/     rG  zETestSpecial.test_subclasses_with_reduce_ex.<locals>.NamedInt.__name__c                 S   rH  rI  rJ  r   r(   r(   r,   r{    rK  zETestSpecial.test_subclasses_with_reduce_ex.<locals>.NamedInt.__repr__c                 S   rL  r   rM  rO  r(   r(   r,   r     rR  zDTestSpecial.test_subclasses_with_reduce_ex.<locals>.NamedInt.__str__c                    rS  rT  rU  rV  rW  r(   r,   rX  (  rY  zDTestSpecial.test_subclasses_with_reduce_ex.<locals>.NamedInt.__add__N)
r/   r0   r1   rX  r  rZ  r   r{  r   rX  r(   rW  r(   r,   r9    r[  r9  c                   @   r\  )z7TestSpecial.test_subclasses_with_reduce_ex.<locals>.NEIr]  r^  r_  Nr`  r(   r(   r(   r,   r]  2  r;   r]  rc  rd  r  r!   re  rf  r(   rW  r,   test_subclasses_with_reduce_ex  s   *


z*TestSpecial.test_subclasses_with_reduce_exc                       G  fdddt  G dd d t}| |jtj | t|j|j d  t d< |t d<  dd}| |d | |jj	d t
| j|j t
| j| d S )	Nc                       B   e Zd ZdZdd Zejdd Z dd Zdd	 Z fd
dZdS )zKTestSpecial.test_subclasses_without_direct_pickle_support.<locals>.NamedIntr9  c                 W   r:  r;  r<  r?  r(   r(   r,   rX  E  rA  zSTestSpecial.test_subclasses_without_direct_pickle_support.<locals>.NamedInt.__new__c                 S   rB  r   rF  r   r(   r(   r,   r/   N  rG  zTTestSpecial.test_subclasses_without_direct_pickle_support.<locals>.NamedInt.__name__c                 S   rH  rI  rJ  r   r(   r(   r,   r{  Q  rK  zTTestSpecial.test_subclasses_without_direct_pickle_support.<locals>.NamedInt.__repr__c                 S   rL  r   rM  rO  r(   r(   r,   r   X  rR  zSTestSpecial.test_subclasses_without_direct_pickle_support.<locals>.NamedInt.__str__c                    rS  rT  rU  rV  rW  r(   r,   rX  a  s   zSTestSpecial.test_subclasses_without_direct_pickle_support.<locals>.NamedInt.__add__N	r/   r0   r1   rX  rZ  r   r{  r   rX  r(   rW  r(   r,   r9  C      	
	r9  c                   @   r\  )zFTestSpecial.test_subclasses_without_direct_pickle_support.<locals>.NEIr]  r^  r_  Nr`  r(   r(   r(   r,   r]  j  r;   r]  rc  rd  r  r!   r  r   r*  rX  r   r(  ra  rb  r  r  r^   rf  r(   rW  r,   -test_subclasses_without_direct_pickle_supportB  s   '


z9TestSpecial.test_subclasses_without_direct_pickle_supportc                    rr  )	Nc                       rs  )zHTestSpecial.test_subclasses_with_direct_pickle_support.<locals>.NamedIntr9  c                 W   r:  r;  r<  r?  r(   r(   r,   rX  |  rA  zPTestSpecial.test_subclasses_with_direct_pickle_support.<locals>.NamedInt.__new__c                 S   rB  r   rF  r   r(   r(   r,   r/     rG  zQTestSpecial.test_subclasses_with_direct_pickle_support.<locals>.NamedInt.__name__c                 S   rH  rI  rJ  r   r(   r(   r,   r{    rK  zQTestSpecial.test_subclasses_with_direct_pickle_support.<locals>.NamedInt.__repr__c                 S   rL  r   rM  rO  r(   r(   r,   r     rR  zPTestSpecial.test_subclasses_with_direct_pickle_support.<locals>.NamedInt.__str__c                    rS  rT  rU  rV  rW  r(   r,   rX    rY  zPTestSpecial.test_subclasses_with_direct_pickle_support.<locals>.NamedInt.__add__Nrt  r(   rW  r(   r,   r9  z  ru  r9  c                   @   s    e Zd ZdZdZdZdd ZdS )zCTestSpecial.test_subclasses_with_direct_pickle_support.<locals>.NEIr]  r^  r_  c                 S   s   t | j| jffS r   )r
  r  rz  rp  r(   r(   r,   r    r   zQTestSpecial.test_subclasses_with_direct_pickle_support.<locals>.NEI.__reduce_ex__N)r/   r0   r1   ra  rb  r  r(   r(   r(   r,   r]    r8  r]  rc  rd  r  r!   rv  rf  r(   rW  r,   *test_subclasses_with_direct_pickle_supporty  s   (


z6TestSpecial.test_subclasses_with_direct_pickle_supportc                 C   s\   G dd dt t}| t|j| | |jt  | |jd |t	 d< t
| j|j d S )Nc                   @   r|  )z2TestSpecial.test_tuple_subclass.<locals>.SomeTuple	SomeTuple)r5   zfor the money)r!   zfor the showr6   zfor the musicNrC  r(   r(   r(   r,   ry    rD   ry  rz  )rZ  r   r*  r;  r   assertIsInstancer   r   r   r  r^   )r*   ry  r(   r(   r,   test_tuple_subclass  s   
zTestSpecial.test_tuple_subclassc                 C   sd   G dd dt }| t||j|j|jg | t|jd | |jjd | |d|j d S )Nc                   @   s(   e Zd ZdZdZdZdd Zdd ZdS )zLTestSpecial.test_duplicate_values_give_unique_enum_items.<locals>.AutoNumberr(   c                 S   "   t | jd }t| }||_|S Nr5   r[  __members__r>  rX  r\  r  r  r`   r(   r(   r,   rX       
zTTestSpecial.test_duplicate_values_give_unique_enum_items.<locals>.AutoNumber.__new__c                 S   r   r   r  r\  r   r(   r(   r,   r    r   zTTestSpecial.test_duplicate_values_give_unique_enum_items.<locals>.AutoNumber.__int__N)r/   r0   r1   r   r   r   rX  r  r(   r(   r(   r,   
AutoNumber  s    r  r!   r6   r5   )	r   r   r   r   r   r   r  r  r*  )r*   r  r(   r(   r,   ,test_duplicate_values_give_unique_enum_items  s   z8TestSpecial.test_duplicate_values_give_unique_enum_itemsc                 C   Z   G dd dt }G dd d|}| t||j|j|jg | ttt|g d d S )Nc                   @   r   )zETestSpecial.test_inherited_new_from_enhanced_enum.<locals>.AutoNumberc                 S   r}  r~  r  r  r(   r(   r,   rX    r  zMTestSpecial.test_inherited_new_from_enhanced_enum.<locals>.AutoNumber.__new__c                 S   r   r   r  r   r(   r(   r,   r    r   zMTestSpecial.test_inherited_new_from_enhanced_enum.<locals>.AutoNumber.__int__N)r/   r0   r1   rX  r  r(   r(   r(   r,   r    s    r  c                   @      e Zd ZdZdZdZdS )z@TestSpecial.test_inherited_new_from_enhanced_enum.<locals>.Colorr(   Nr2  r(   r(   r(   r,   r6    r;   r6  r  )r   r   r   r3  r4  r5  mapr  r*   r  r6  r(   r(   r,   %test_inherited_new_from_enhanced_enum  s   z1TestSpecial.test_inherited_new_from_enhanced_enumc                 C   r  )Nc                   @   r$   )zBTestSpecial.test_inherited_new_from_mixed_enum.<locals>.AutoNumberc                 S   s$   t | jd }t| |}||_|S r~  )r[  r  r  rX  r\  r  r(   r(   r,   rX    s   zJTestSpecial.test_inherited_new_from_mixed_enum.<locals>.AutoNumber.__new__Nr`  r(   r(   r(   r,   r    r2   r  c                   @   r  )z=TestSpecial.test_inherited_new_from_mixed_enum.<locals>.Colorr(   Nr2  r(   r(   r(   r,   r6    r;   r6  r  )r   r   r   r3  r4  r5  r  r  r  r(   r(   r,   "test_inherited_new_from_mixed_enum  s   z.TestSpecial.test_inherited_new_from_mixed_enumc                 C   s0   G dd dt }| t|j | |jt d S )Nc                   @   rk  )z/TestSpecial.test_equality.<locals>.OrdinaryEnumr5   N)r/   r0   r1   r   r(   r(   r(   r,   OrdinaryEnum  rq  r  )r   r   	ALWAYS_EQr   )r*   r  r(   r(   r,   test_equality  s   zTestSpecial.test_equalityc                 C   s   G dd dt }G dd d|}| |j|j | |j|j | |j|j | 	|j|j | 
|j|j | |j|j d S )Nc                   @   r  )
z3TestSpecial.test_ordered_mixin.<locals>.OrderedEnumc                 S   s   | j |j u r| j|jkS tS r   r  r\  NotImplementedr)   r(   r(   r,   __ge__     z:TestSpecial.test_ordered_mixin.<locals>.OrderedEnum.__ge__c                 S   s   | j |j u r| j|jkS tS r   r  r)   r(   r(   r,   __gt__  r  z:TestSpecial.test_ordered_mixin.<locals>.OrderedEnum.__gt__c                 S   s   | j |j u r| j|jkS tS r   r  r)   r(   r(   r,   __le__  r  z:TestSpecial.test_ordered_mixin.<locals>.OrderedEnum.__le__c                 S   s   | j |j u r| j|jk S tS r   r  r)   r(   r(   r,   __lt__  r  z:TestSpecial.test_ordered_mixin.<locals>.OrderedEnum.__lt__N)r/   r0   r1   r  r  r  r  r(   r(   r(   r,   OrderedEnum  s
    r  c                   @   r  )z-TestSpecial.test_ordered_mixin.<locals>.Grader  r?   r6   r!   r5   Nr  r(   r(   r(   r,   Grade	  r  r  )r   assertGreaterr  r  assertLessEqualr
  r  
assertLessr	  assertGreaterEqualr   r  )r*   r  r  r(   r(   r,   test_ordered_mixin  s   zTestSpecial.test_ordered_mixinc                 C   s`   G dd dt }G dd d|}| t G dd d|}W d    d S 1 s)w   Y  d S )Nc                   @   r$   )z*TestSpecial.test_extending2.<locals>.Shadec                 S   s   t | j d S r   )printr   r   r(   r(   r,   shade     z0TestSpecial.test_extending2.<locals>.Shade.shadeNr/   r0   r1   r  r(   r(   r(   r,   Shade  r2   r  c                   @   r3   )z*TestSpecial.test_extending2.<locals>.Colorr5   r!   r6   Nr2  r(   r(   r(   r,   r6    r;   r6  c                   @   r3   )z.TestSpecial.test_extending2.<locals>.MoreColorr?   r  r  Nr  r(   r(   r(   r,   r    r;   r  )r   r  r*  r*   r  r6  r  r(   r(   r,   test_extending2  s
   "zTestSpecial.test_extending2c                 C   sF   G dd dt }G dd d|}G dd d|}| |j d d S )Nc                   @   r$   )z*TestSpecial.test_extending3.<locals>.Shadec                 S   rB  r   r   r   r(   r(   r,   r  &  rE  z0TestSpecial.test_extending3.<locals>.Shade.shadeNr  r(   r(   r(   r,   r  %  r2   r  c                   @   r$   )z*TestSpecial.test_extending3.<locals>.Colorc                 S   r   )Nz%s hexlified!r%  r   r(   r(   r,   rz  )  r   z.TestSpecial.test_extending3.<locals>.Color.hexN)r/   r0   r1   rz  r(   r(   r(   r,   r6  (  r2   r6  c                   @   r3   )z.TestSpecial.test_extending3.<locals>.MoreColorr?   r  r  Nr  r(   r(   r(   r,   r  +  r;   r  z5 hexlified!)r   r   r  rz  r  r(   r(   r,   test_extending3$  s   zTestSpecial.test_extending3c                 C   s6   G dd dt }G dd d|}| t|j| d S )Nc                   @   r$   )z6TestSpecial.test_subclass_duplicate_name.<locals>.Basec                 S   r  r   r(   r   r(   r(   r,   rd  3  r.   z;TestSpecial.test_subclass_duplicate_name.<locals>.Base.testNr/   r0   r1   rd  r(   r(   r(   r,   Base2  r2   r  c                   @   rk  )z6TestSpecial.test_subclass_duplicate_name.<locals>.Testr5   Nr  r(   r(   r(   r,   rN  5  rq  rN  )r   r*  r;  rd  )r*   r  rN  r(   r(   r,   test_subclass_duplicate_name1  s   z(TestSpecial.test_subclass_duplicate_namec                    s   ddl m  G  fdddt}G dd d|}| |jjd | |jjd G d	d
 d
t}G dd d|}| |jjd | |jjd d S )Nr   DynamicClassAttributec                       s   e Zd Z dd ZdS )z>TestSpecial.test_subclass_duplicate_name_dynamic.<locals>.Basec                 S   r&   )Ndynamicr(   r   r(   r(   r,   rd  <  r:  zCTestSpecial.test_subclass_duplicate_name_dynamic.<locals>.Base.testNr  r(   r  r(   r,   r  ;      r  c                   @   rk  z>TestSpecial.test_subclass_duplicate_name_dynamic.<locals>.Testr5   Nr  r(   r(   r(   r,   rN  ?  rq  rN  r  r5   c                   @   r   )z?TestSpecial.test_subclass_duplicate_name_dynamic.<locals>.Base2c                 S   r&   )Nflashy dynamicr(   r   r(   r(   r,   flashD  r:  zETestSpecial.test_subclass_duplicate_name_dynamic.<locals>.Base2.flashN)r/   r0   r1   r~   r   r  r(   r(   r(   r,   Base2C  r   r  c                   @   rk  r  )r/   r0   r1   r  r(   r(   r(   r,   rN  G  rq  r  )typesr  r   r   rd  r  r  )r*   r  rN  r  r(   r  r,   $test_subclass_duplicate_name_dynamic9  s   z0TestSpecial.test_subclass_duplicate_name_dynamicc                 C   s`   G dd dt }G dd d|}| t G dd d|}W d    d S 1 s)w   Y  d S )Nc                   @   r$   )z2TestSpecial.test_no_duplicates.<locals>.UniqueEnumc                    sB    j }t fdd|D r j}| jj}td||f d S )Nc                 3   s    | ]	} j |j kV  qd S r   r%  )r!  r  r   r(   r,   	<genexpr>P  s    zNTestSpecial.test_no_duplicates.<locals>.UniqueEnum.__init__.<locals>.<genexpr>z-aliases not allowed in UniqueEnum:  %r --> %r)r  anyr   r  r   )r*   r@  r  r   r  r(   r   r,   r   N  s   z;TestSpecial.test_no_duplicates.<locals>.UniqueEnum.__init__Nr/   r0   r1   r   r(   r(   r(   r,   
UniqueEnumM  r2   r  c                   @   r3   z-TestSpecial.test_no_duplicates.<locals>.Colorr5   r!   r6   Nr2  r(   r(   r(   r,   r6  W  r;   r6  c                   @   s   e Zd ZdZdZdZdZdS r  )r/   r0   r1   r3  r4  r5  grener(   r(   r(   r,   r6  \  rD   )r   r  r   )r*   r  r6  r(   r(   r,   test_no_duplicatesL  s
   
"zTestSpecial.test_no_duplicatesc                 C   s:   G dd dt }| t|jjdd | |jjd d S )Nc                   @   sB   e Zd ZdZdZdZdZdZdZdZ	dZ
d	d
 Zejdd ZdS )z%TestSpecial.test_init.<locals>.Planet)gITf|Dg    
BA)gQX4Eg    WAgoEg    TXA)g	Dg    (IA)gcEg   A)g[\h}Eg    ，A)g#'?TQEg   _xA)gJ-UEg    wAc                 S   s   || _ || _d S r   massradius)r*   r  r  r(   r(   r,   r   l  s   
z.TestSpecial.test_init.<locals>.Planet.__init__c                 S   s   d}|| j  | j| j  S )NgyдW=r  )r*   r  r(   r(   r,   surface_gravityo  s   z5TestSpecial.test_init.<locals>.Planet.surface_gravityN)r/   r0   r1   MERCURYVENUSEARTHMARSJUPITERSATURNURANUSNEPTUNEr   r~   r   r  r(   r(   r(   r,   Planetc  s    r  r!   g#@r  )r   r   roundr  r  r  )r*   r  r(   r(   r,   	test_initb  s   zTestSpecial.test_initc                 C   s|   G dd dt t}| t|d | t|d | t|d | t|jt  | |j|ju  | |j	|j
u  d S )Nc                   @   s   e Zd ZdZdd ZdZe ZedD ]Z	e	d dfede	 < qed	D ]Z	e	d
 dfede	 < q$edD ]
Z	e	dfede	 < q5e
ZeZeZdS )z'TestSpecial.test_ignore.<locals>.Periodz3
            different lengths of time
            c                 S   s   t | |}||_||_|S r   )r    rX  r\  period)r  r  r  r`   r(   r(   r,   rX  |  s   z/TestSpecial.test_ignore.<locals>.Period.__new__zPeriod irS  r  r  zmonth_%d5   r   weekzweek_%d    dayzday_%dN)r/   r0   r1   r   rX  _ignore_varsr  rZ   rA  day_1OneDayweek_1OneWeekmonth_1OneMonthr(   r(   r(   r,   r  x  s    r  r  rA  )r    r   r}   r  r   rY  r  r  day_30week_4day_28r  r(   r(   r,   test_ignorew  s   zTestSpecial.test_ignorec                 C   s   G dd dt }G dd d|}| t||j|j|jg t|tdD ]\}}|d7 }| |j|g | 	||g| q%d S )Nc                   @   r$   )z9TestSpecial.test_nonhash_value.<locals>.AutoNumberInAListc                 S   s$   t | jd g}t| }||_|S r~  r  r  r(   r(   r,   rX    s   
zATestSpecial.test_nonhash_value.<locals>.AutoNumberInAList.__new__Nr`  r(   r(   r(   r,   AutoNumberInAList  r2   r  c                   @   r  )z4TestSpecial.test_nonhash_value.<locals>.ColorInAListr(   Nr2  r(   r(   r(   r,   ColorInAList  r;   r  r6   r5   )
r   r   r   r3  r4  r5  r)  rZ   r  r*  )r*   r  r  r~   r  r(   r(   r,   test_nonhash_value  s   zTestSpecial.test_nonhash_valuec                 C   s^   G dd dt t}G dd d|}| t||j|jg | |jd | |d|j d S )Nc                   @   r$   )zKTestSpecial.test_conflicting_types_resolved_in_new.<locals>.LabelledIntEnumc                 W   s$   |\}}t | |}||_||_|S r   )r  rX  labelr\  )r  r@  r  r  r`   r(   r(   r,   rX    s
   zSTestSpecial.test_conflicting_types_resolved_in_new.<locals>.LabelledIntEnum.__new__Nr`  r(   r(   r(   r,   LabelledIntEnum  r2   r  c                   @   rG   )zHTestSpecial.test_conflicting_types_resolved_in_new.<locals>.LabelledList)r5   Unprocessed)r!   zPayment CompleteN)r/   r0   r1   unprocessedpayment_completer(   r(   r(   r,   LabelledList  rL   r  r5   )r  r   r   r   r  r  )r*   r  r  r(   r(   r,   &test_conflicting_types_resolved_in_new  s
   z2TestSpecial.test_conflicting_types_resolved_in_newc              
   C   sZ   G dd dt }z	|d W td ty, } z| |jd u  W Y d }~d S d }~ww )Nc                   @   r3   )zDTestSpecial.test_default_missing_no_chained_exception.<locals>.Colorr5   r!   r6   N)r/   r0   r1   r  GREENBLUEr(   r(   r(   r,   r6    r;   r6  r   Exception not raised.)r   r   r   r  r>  r*   r6  excr(   r(   r,   )test_default_missing_no_chained_exception  s   
z5TestSpecial.test_default_missing_no_chained_exceptionc              
   C   s   G dd dt }| |d|j z	|d W td ty4 } z| |jd u  W Y d }~nd }~ww z	|d W td tyY } z| t|jt W Y d }~nd }~ww z	|d W td t	y } z| t|jt W Y d }~d S d }~ww )Nc                   @   s$   e Zd ZdZdZdZedd ZdS )z0TestSpecial.test_missing_override.<locals>.Colorr5   r!   r6   c                 S   s*   |dkr| j S |dkrdS |dkrtd S )Nr  
bad returnr  	error out)r5  ZeroDivisionError)r  r}  r(   r(   r,   	_missing_  s   z:TestSpecial.test_missing_override.<locals>.Color._missing_N)r/   r0   r1   r3  r4  r5  classmethodr  r(   r(   r(   r,   r6    s    r6  r  r   r  r  r  )
r   r*  r5  r   r   r  r>  r*  rY  r  r  r(   r(   r,   test_missing_override  s.   


 z!TestSpecial.test_missing_overridec                    s   dd l }dd l}G dd dtj G dd d}G  fddd}|| }|| }|  | | d  | | d  d S )Nr   c                   @   rG   )z;TestSpecial.test_missing_exceptions_reset.<locals>.TestEnumval1val2N)r/   r0   r1   VAL1VAL2r(   r(   r(   r,   TestEnum  rL   r  c                   @   r$   )z9TestSpecial.test_missing_exceptions_reset.<locals>.Class1c                 S   s   zt   t y   Y d S w r   r   r   r(   r(   r,   r     s
   zBTestSpecial.test_missing_exceptions_reset.<locals>.Class1.__init__Nr  r(   r(   r(   r,   Class1  r2   r  c                       rW  )z9TestSpecial.test_missing_exceptions_reset.<locals>.Class2c                    s$   z d W d S  t y   Y d S w )Ninvalid_valuer  r   r  r(   r,   r     s
   zBTestSpecial.test_missing_exceptions_reset.<locals>.Class2.__init__Nr  r(   r  r(   r,   Class2  ra  r  )gcweakrefr~   r   refcollectr*  )r*   r  r  r  r  class_1_refclass_2_refr(   r  r,   test_missing_exceptions_reset  s   z)TestSpecial.test_missing_exceptions_resetc           
         s  G dd d}G dd d G dd dt }G dd dt }G d	d
 d
|t }| |jjd | |jjd | |jjd | |jd | t|jd G  fdd
d
| t }| |jjd | |jjd | |jjd | |jd | t|jd G  fdd
d
 |t }| |jjd | |jjd | |jjd | |jd | t|jd G  fddd |t }| |jjd | |jjd | |jjd | t|jd | |j d G  fddd |t }| |jjd | |jjd | |jjd | t|jd | |j d | |j	 d G  fddd ||}| |jjd | |jjd | |jjd | t|jd | |j d | |j	 d G  fddd ||}| |jjd | |jjd | |jjd | t|jd | |j d | |j	 d G  fddd t
||}	| |	jjd | |	jjd | |	jjd | t|	jd | |	j d | |j	 d | t|	t d S )Nc                   @      e Zd Zedd ZdS )z1TestSpecial.test_multiple_mixin.<locals>.MaxMixinc                 S   s   t | }|| _|S r   )r[  MAX)r  maxr(   r(   r,   r  
	  s   z5TestSpecial.test_multiple_mixin.<locals>.MaxMixin.MAXN)r/   r0   r1   r   r  r(   r(   r(   r,   MaxMixin		  r  r  c                   @   r$   )z1TestSpecial.test_multiple_mixin.<locals>.StrMixinc                 S   r   r   rz  lowerr   r(   r(   r,   r   	  r   z9TestSpecial.test_multiple_mixin.<locals>.StrMixin.__str__Nr/   r0   r1   r   r(   r(   r(   r,   StrMixin	  r2   r  c                   @   r$   )z1TestSpecial.test_multiple_mixin.<locals>.SomeEnumc                 S   r&   )Nbooyahr(   r   r(   r(   r,   behavior	  r.   z:TestSpecial.test_multiple_mixin.<locals>.SomeEnum.behaviorN)r/   r0   r1   r
  r(   r(   r(   r,   SomeEnum	  r2   r  c                   @   r   )z4TestSpecial.test_multiple_mixin.<locals>.AnotherEnumc                 S   r&   )Nnuhuh!r(   r   r(   r(   r,   r
  	  r.   z=TestSpecial.test_multiple_mixin.<locals>.AnotherEnum.behaviorc                 S   r&   )N
what's up?r(   r   r(   r(   r,   social	  r.   z;TestSpecial.test_multiple_mixin.<locals>.AnotherEnum.socialN)r/   r0   r1   r
  r  r(   r(   r(   r,   AnotherEnum	  r   r  c                   @   r  z.TestSpecial.test_multiple_mixin.<locals>.ColorNr/   r0   r1   r   r  r  r  r(   r(   r(   r,   r6  	  r  r6  r5   r!   r6   
Color.BLUEc                       $   e Zd Ze Ze Ze Z jZdS r  r/   r0   r1   r   r  r  r  r   r(   r  r(   r,   r6  #	  
    
r5  c                       r  r  r  r(   r  r(   r,   r6  -	  r  c                       r  )z2TestSpecial.test_multiple_mixin.<locals>.CoolColorNr  r(   r  r(   r,   	CoolColor7	  r  r  r	  c                       r  )z4TestSpecial.test_multiple_mixin.<locals>.CoolerColorNr  r(   r  r(   r,   CoolerColorA	  r  r  r  r  c                       r  )z5TestSpecial.test_multiple_mixin.<locals>.CoolestColorNr  r(   r  r(   r,   CoolestColorL	  r  r  c                       r  )z6TestSpecial.test_multiple_mixin.<locals>.ConfusedColorNr  r(   r  r(   r,   ConfusedColorW	  r  r  c                       r  )z6TestSpecial.test_multiple_mixin.<locals>.ReformedColorNr  r(   r  r(   r,   ReformedColorb	  r  r  )r   r   r  r  r  r  r  r  r
  r  r   r   r   r  )
r*   r  r  r  r6  r  r  r  r  r  r(   r  r,   test_multiple_mixin	  sr   zTestSpecial.test_multiple_mixinc                 C   s<   t G dd dt}G dd dt}t G dd d|}d S )Nc                   @   r3   )z<TestSpecial.test_multiple_inherited_mixin.<locals>.Decision1REVERT
REVERT_ALLRETRYNr/   r0   r1   r  r  r  r(   r(   r(   r,   	Decision1p	      r!  c                   @   rv   )z9TestSpecial.test_multiple_inherited_mixin.<locals>.MyEnumNrw   r(   r(   r(   r,   r   u	  ry   r   c                   @   r3   )z<TestSpecial.test_multiple_inherited_mixin.<locals>.Decision2r  r  r  Nr   r(   r(   r(   r,   	Decision2w	  r"  r#  )r   r   )r*   r!  r   r#  r(   r(   r,   test_multiple_inherited_mixino	  s
   z)TestSpecial.test_multiple_inherited_mixinc                    s   G dd dt }G dd d G  fddd |tj}G dd d|}| t|j| | |j| | t|jd	 G d
d d|}| |jd d S )Nc                       s   e Zd Z fddZ  ZS )z8TestSpecial.test_multiple_mixin_inherited.<locals>.MyIntc                    s   t  | |S r   )r"  rX  r  r-  r(   r,   rX  	  r  z@TestSpecial.test_multiple_mixin_inherited.<locals>.MyInt.__new__r*  r(   r(   r-  r,   r  ~	  s    r  c                   @   r$   )z;TestSpecial.test_multiple_mixin_inherited.<locals>.HexMixinc                 S   rx  r   ry  r   r(   r(   r,   r{  	  r{  zDTestSpecial.test_multiple_mixin_inherited.<locals>.HexMixin.__repr__Nr  r(   r(   r(   r,   HexMixin	  r2   r%  c                       s   e Zd Z jZdS )z<TestSpecial.test_multiple_mixin_inherited.<locals>.MyIntEnumNr  r(   r%  r(   r,   	MyIntEnum	  r   r'  c                   @   rk  )z6TestSpecial.test_multiple_mixin_inherited.<locals>.Foor5   N)r/   r0   r1   TESTr(   r(   r(   r,   rD  	  rq  rD  0x1c                   @   s   e Zd ZdZdd ZdS )z6TestSpecial.test_multiple_mixin_inherited.<locals>.Feer5   c                 S   s   |d7 }t | |}||_|S r~  )r  rX  r\  r  r  r   r(   r(   r,   rX  	  s   z>TestSpecial.test_multiple_mixin_inherited.<locals>.Fee.__new__N)r/   r0   r1   r(  rX  r(   r(   r(   r,   Fee	  rf  r+  r!   )	r  r~   r   r   rY  r(  r   r  r(  )r*   r  r'  rD  r+  r(   r&  r,   test_multiple_mixin_inherited}	  s   z)TestSpecial.test_multiple_mixin_inheritedc                 C   s  G dd dt t}G dd dt t}G dd d||}|}| t||j|j|jg | |jd | |jjd | |d|j | 	|jj
 |d	}| t||j|j|jg | |jd | |jjd | |d|j | 	|jj
 | 	t|| | |j
 d S )
Nc                       s    e Zd Ze fddZ  ZS )zUTestSpecial.test_multiple_mixin_with_common_data_type.<locals>.CaseInsensitiveStrEnumc                    s6   | j  D ]}|j | kr|  S qt |S r   )_member_map_r  r\  r  r"  r  r*  r-  r(   r,   r  	  s
   z_TestSpecial.test_multiple_mixin_with_common_data_type.<locals>.CaseInsensitiveStrEnum._missing_)r/   r0   r1   r  r  r+  r(   r(   r-  r,   CaseInsensitiveStrEnum	  s    r.  c                   @   s.   e Zd Zdd Zedd Zejdd ZdS )zMTestSpecial.test_multiple_mixin_with_common_data_type.<locals>.LenientStrEnumc                 W   
   d| _ d S r'   _valid)r*   r@  r(   r(   r,   r   	  r   zVTestSpecial.test_multiple_mixin_with_common_data_type.<locals>.LenientStrEnum.__init__c                 S   s2   | j | |}d|_| |_||_|| j|< |S )NF)r  rX  r1  r   rz  r\  r-  )r  r  unknownr(   r(   r,   r  	  s   

zWTestSpecial.test_multiple_mixin_with_common_data_type.<locals>.LenientStrEnum._missing_c                 S   rB  r   r0  r   r(   r(   r,   valid	  rG  zSTestSpecial.test_multiple_mixin_with_common_data_type.<locals>.LenientStrEnum.validN)	r/   r0   r1   r   r  r  r~   r   r3  r(   r(   r(   r,   LenientStrEnum	  s    
r4  c                   @   r3   )zHTestSpecial.test_multiple_mixin_with_common_data_type.<locals>.JobStatusactivepending
terminatedN)r/   r0   r1   ACTIVEPENDING
TERMINATEDr(   r(   r(   r,   	JobStatus	  r;   r;  r5  Activemissing)r  r   r   r   r8  r9  r:  r  r*  r   r3  rY  r}   )r*   r.  r4  r;  JSr=  r(   r(   r,   )test_multiple_mixin_with_common_data_type	  s"   z5TestSpecial.test_multiple_mixin_with_common_data_typec                 C   s(   d}t |dd}i }i }t||| d S )Nz8from enum import Enum; Enum('Animal', 'ANT BEE CAT DOG')z<string>exec)compiler@  )r*   code	global_nslocal_lsr(   r(   r,   test_empty_globals	  s
   zTestSpecial.test_empty_globalsc           
         s  G dd dt }| |jd | t|jd | d|jd | |jt|j | |jd|j | t|jd G dd d G  fdd	d	 t }| |jd
 | t|jd G dd dt}G dd d|t }| |jd | |jt|j G dd d}G dd d||t }| |j	d | |j	t|j	 | 
td G dd dt }W d    n1 sw   Y  | 
td G dd dt }W d    n1 sw   Y  | 
td G dd dt }	W d    n1 sw   Y  | 
tdtjf  G dd dt }	W d    n	1 sw   Y  | 
td  G d!d dt }	W d    d S 1 s>w   Y  d S )"Nc                   @   r@   )z-TestSpecial.test_strenum.<locals>.GoodStrEnumr   r      3ascii   4latin1r'  Nr/   r0   r1   r0  r1  r  fourr(   r(   r(   r,   GoodStrEnum	  rD   rN  r   r  z<GoodStrEnum.one: '1'>c                   @   r$   )z+TestSpecial.test_strenum.<locals>.DumbMixinc                 S   r&   Ndon't do thisr(   r   r(   r(   r,   r   	  r.   z3TestSpecial.test_strenum.<locals>.DumbMixin.__str__Nr  r(   r(   r(   r,   	DumbMixin	  r2   rQ  c                          e Zd ZdZdZdZ jZdS )z-TestSpecial.test_strenum.<locals>.DumbStrEnumr  67Nr/   r0   r1   fivesixsevenr   r(   rQ  r(   r,   DumbStrEnum	  
    
rZ  rT  rP  c                   @   r$   )z+TestSpecial.test_strenum.<locals>.EnumMixinc                 S      t d| f  d S Nzhello from %sr  r   r(   r(   r,   r  	     z1TestSpecial.test_strenum.<locals>.EnumMixin.helloNr  r(   r(   r(   r,   	EnumMixin	  r2   r`  c                   @   rk  )z+TestSpecial.test_strenum.<locals>.HelloEnum8Nr/   r0   r1   eightr(   r(   r(   r,   	HelloEnum	  rq  rd  ra  c                   @   r$   )z.TestSpecial.test_strenum.<locals>.GoodbyeMixinc                 S      t d d S Nz%s wishes you a fond farewellr^  r   r(   r(   r,   goodbye	  r|  z6TestSpecial.test_strenum.<locals>.GoodbyeMixin.goodbyeNr/   r0   r1   rg  r(   r(   r(   r,   GoodbyeMixin	  r2   ri  c                   @   rk  )z-TestSpecial.test_strenum.<locals>.GoodbyeEnum9Nr/   r0   r1   niner(   r(   r(   r,   GoodbyeEnum	  rq  rm  rj  z1 is not a stringc                   @   rG   )z4TestSpecial.test_strenum.<locals>.FirstFailedStrEnumr5   r   Nr  r(   r(   r(   r,   FirstFailedStrEnum	  rL   rn  z2 is not a stringc                   @   r3   )z5TestSpecial.test_strenum.<locals>.SecondFailedStrEnumr   r!   r   Nr  r(   r(   r(   r,   SecondFailedStrEnum	  r;   rp  c                   @   rG   )4TestSpecial.test_strenum.<locals>.ThirdFailedStrEnumr   r!   Nr  r(   r(   r(   r,   ThirdFailedStrEnum	  rL   rr  z!encoding must be a string, not %rc                   @      e Zd ZdZdejfZdS )rq  r      2Nr/   r0   r1   r0  sysgetdefaultencodingr1  r(   r(   r(   r,   rr  
  r   zerrors must be a string, not 9c                   @   rG   )rq  r   rt  rH  rn  Nr  r(   r(   r(   r,   rr  
  rL   )r   r   r0  r  r  r(  rX  r   rc  rl  r   r*  rv  rw  )
r*   rN  rZ  r`  rd  ri  rm  rn  rp  rr  r(   rY  r,   test_strenum	  sD   $zTestSpecial.test_strenumc                    s  G dd dt t}G dd d|}| |jd | t |jd | d|jd | t|jd G d	d
 d
 G  fddd |}| |jd | t |jd G dd dt}G dd d||}| |jd | t |jd G dd d}G dd d|||}| |jd | t |jd G dd d|}G dd d|}	G dd  d |}
| 	t
d! G d"d  d |}
W d    n1 sw   Y  | 	t
d# G d$d  d |}
W d    d S 1 sw   Y  d S )%Nc                   @   rv   )z6TestSpecial.test_custom_strenum.<locals>.CustomStrEnumNrw   r(   r(   r(   r,   CustomStrEnum
  ry   rz  c                   @   r@   )z1TestSpecial.test_custom_strenum.<locals>.OkayEnumr   r   rF  rI  NrL  r(   r(   r(   r,   OkayEnum
  rD   r{  r   zOkayEnum.oner  z<OkayEnum.one: '1'>c                   @   r$   )z2TestSpecial.test_custom_strenum.<locals>.DumbMixinc                 S   r&   rO  r(   r   r(   r(   r,   r   
  r.   z:TestSpecial.test_custom_strenum.<locals>.DumbMixin.__str__Nr  r(   r(   r(   r,   rQ  
  r2   rQ  c                       rR  )z4TestSpecial.test_custom_strenum.<locals>.DumbStrEnumr  rS  rT  NrU  r(   rY  r(   r,   rZ  
  r[  rZ  rT  rP  c                   @   r$   )z2TestSpecial.test_custom_strenum.<locals>.EnumMixinc                 S   r\  r]  r^  r   r(   r(   r,   r  $
  r_  z8TestSpecial.test_custom_strenum.<locals>.EnumMixin.helloNr  r(   r(   r(   r,   r`  #
  r2   r`  c                   @   rk  )z2TestSpecial.test_custom_strenum.<locals>.HelloEnumra  Nrb  r(   r(   r(   r,   rd  &
  rq  rd  ra  zHelloEnum.eightc                   @   r$   )z5TestSpecial.test_custom_strenum.<locals>.GoodbyeMixinc                 S   re  rf  r^  r   r(   r(   r,   rg  ,
  r|  z=TestSpecial.test_custom_strenum.<locals>.GoodbyeMixin.goodbyeNrh  r(   r(   r(   r,   ri  +
  r2   ri  c                   @   rk  )z4TestSpecial.test_custom_strenum.<locals>.GoodbyeEnumrj  Nrk  r(   r(   r(   r,   rm  .
  rq  rm  rj  zGoodbyeEnum.ninec                   @   rG   )z;TestSpecial.test_custom_strenum.<locals>.FirstFailedStrEnumr5   r   Nr  r(   r(   r(   r,   rn  3
  rL   rn  c                   @   r3   )z<TestSpecial.test_custom_strenum.<locals>.SecondFailedStrEnumr   ro  r   Nr  r(   r(   r(   r,   rp  6
  r;   rp  c                   @   rG   );TestSpecial.test_custom_strenum.<locals>.ThirdFailedStrEnumr   r!   Nr  r(   r(   r(   r,   rr  :
  rL   rr  z.encoding. must be str, not c                   @   rs  )r|  r   rt  Nru  r(   r(   r(   r,   rr  >
  r   z.errors. must be str, not c                   @   rG   )r|  r   rx  Nr  r(   r(   r(   r,   rr  B
  rL   )r  r   r   r0  r  r(  rX  rc  rl  r   r*  )r*   rz  r{  rZ  r`  rd  ri  rm  rn  rp  rr  r(   rY  r,   test_custom_strenum
  s6   "zTestSpecial.test_custom_strenumc                 C   sD   |  td G dd dtt}W d    d S 1 sw   Y  d S )Nz_value_ not set in __new__c                   @   s,   e Zd Zdd Zdd ZdZdZdZdZd	S )
z6TestSpecial.test_missing_value_error.<locals>.Combinedc                 S   sN   t | |}d|v r|dd\}}|d}n|}d }||_||_||_|S )N(r5   z ))r  rX  r  stripfis_namesegmentsequence)r  r  r  r~   r  r  r(   r(   r,   rX  J
  s   z>TestSpecial.test_missing_value_error.<locals>.Combined.__new__c                 S   s   d| j j| jf S )Nz<%s.%s>)r  r/   rz  r   r(   r(   r,   r{  W
  r_  z?TestSpecial.test_missing_value_error.<locals>.Combined.__repr__)zAn$(1,2)r   )zAn$(3,2)r5   )zAn$(5,1)r!   )zBn$r6   N)	r/   r0   r1   rX  r{  key_type
company_idrB  r]  r(   r(   r(   r,   CombinedH
  s    r  )r   r*  r  r   )r*   r  r(   r(   r,   test_missing_value_errorF
  s   "z$TestSpecial.test_missing_value_errorc                 C   s0   G dd dt }| |jd | |jd d S )Nc                   @   rG   )zFTestSpecial.test_private_variable_is_normal_attribute.<locals>.PrivateRadarHoolihanN)r/   r0   r1   _Private__corporal_Private__major_r(   r(   r(   r,   Privatea
  rL   r  r  r  )r   r   r  r  )r*   r  r(   r(   r,   )test_private_variable_is_normal_attribute`
  s   z5TestSpecial.test_private_variable_is_normal_attributez)member.member access currently deprecatedc                 C   sJ   |  td G dd dt}|jj}W d    d S 1 sw   Y  d S )Nz(<enum .Di.> member has no attribute .NO.c                   @   rG   )zDTestSpecial.test_exception_for_member_from_member_access.<locals>.Dir5   r   Nr/   r0   r1   YESNOr(   r(   r(   r,   Dim
  rL   r  )r   r  r   r  r  )r*   r  noper(   r(   r,   ,test_exception_for_member_from_member_accessg
  s   
"z8TestSpecial.test_exception_for_member_from_member_accesszmember.member access now raisesc                 C   sV   |  td G dd dt}|jj}W d    n1 sw   Y  | ||j d S )NzC`member.member` access .* is deprecated and will be removed in 3.14c                   @   rG   )zBTestSpecial.test_warning_for_member_from_member_access.<locals>.Dir5   r   Nr  r(   r(   r(   r,   r  x
  rL   r  )r\  r]  r   r  r  r*  )r*   r  warnr(   r(   r,   *test_warning_for_member_from_member_accessr
  s
   
z6TestSpecial.test_warning_for_member_from_member_accessc                    s   dddd G  fdddt }| t||j|jg | |jjd | |j d | td G  fd	d
d
t }W d    d S 1 sIw   Y  d S )Nalooffriendlyr  )FOO_CATBAR_DOG	FOO_HORSEc                       s.   e Zd Ze dd   D  dd ZdS )zATestSpecial.test_dynamic_members_with_static_methods.<locals>.Fooc                 S       i | ]\}}| d r||qS FOO_
startswithr!  r'  r(  r(   r(   r,   
<dictcomp>
      zLTestSpecial.test_dynamic_members_with_static_methods.<locals>.Foo.<dictcomp>c                 S   r   r   r  r   r   r(   r(   r,   r   
  r   zGTestSpecial.test_dynamic_members_with_static_methods.<locals>.Foo.upperNr/   r0   r1   r  updater!  r   r(   foo_definesr(   r,   rD  
  s
    rD  BIGz$'FOO_CAT' already defined as 'aloof'c                       s:   e Zd Ze jdd   D fi ddi dd ZdS )zDTestSpecial.test_dynamic_members_with_static_methods.<locals>.FooBarc                 S   r  r  r  r  r(   r(   r,   r  
  r  zOTestSpecial.test_dynamic_members_with_static_methods.<locals>.FooBar.<dictcomp>r  smallc                 S   r   r   r  r   r(   r(   r,   r   
  r   zJTestSpecial.test_dynamic_members_with_static_methods.<locals>.FooBar.upperNr  r(   r  r(   r,   FooBar
  s    r  )	r   r   r   r  r  r  r   r   r*  )r*   rD  r  r(   r  r,   (test_dynamic_members_with_static_methods~
  s   "z4TestSpecial.test_dynamic_members_with_static_methodsc                    s\  ddl m}m  |ddG dd d}G dd d|t}| t|j| | |j|u |j | |jj|d	k|jj | 	t
|jd
 |G  fddd}G dd d|t}| 	t
|jd G dd d}|ddG  fddd|}G dd d|t}| 	t
|jd |ddG  fddd}G dd d|t}| t
|jd dS )z)ensure dataclass-mixin has correct repr()r   )	dataclassfieldF)r(  c                   @   s"   e Zd ZU dZeed< dd ZdS )z1TestSpecial.test_repr_with_dataclass.<locals>.FoorD  r   c                 S   r&   )Nzha hah!r(   r   r(   r(   r,   r{  
  r.   z:TestSpecial.test_repr_with_dataclass.<locals>.Foo.__repr__N)r/   r0   r1   r  __annotations__r{  r(   r(   r(   r,   rD  
  s   
 rD  c                   @   rk  )z5TestSpecial.test_repr_with_dataclass.<locals>.Entriesr5   Nr/   r0   r1   ENTRY1r(   r(   r(   r,   Entries
  rq  r  r5   z<Entries.ENTRY1: ha hah!>c                       6   e Zd ZU dZeed< eed<  dddZeed< dS 	z?TestSpecial.test_repr_with_dataclass.<locals>.CreatureDataMixinCreatureDataMixinsizelegsFT)r(  defaulttailNr/   r0   r1   r  r  r  r  r!  r(   r  r(   r,   r  
  
   
 r  c                   @   r\  z6TestSpecial.test_repr_with_dataclass.<locals>.CreatureCreature)r  r  )mediumr?   Nr/   r0   r1   BEETLEDOGr(   r(   r(   r,   r  
  r;   r  z%<Creature.DOG: size='medium', legs=4>c                   @   r$   )z1TestSpecial.test_repr_with_dataclass.<locals>.Huhc                 S   r&   )N	inheritedr(   r   r(   r(   r,   r{  
  r.   z:TestSpecial.test_repr_with_dataclass.<locals>.Huh.__repr__Nr  r(   r(   r(   r,   rj  
  r2   rj  c                       r  r  r  r(   r  r(   r,   r  
  r  c                   @   r\  r  r  r(   r(   r(   r,   r  
  r;   z<Creature.DOG: inherited>c                       r  r  r  r(   r  r(   r,   r  
  r  c                   @   r\  r  r  r(   r(   r(   r,   r  
  r;   z0<Creature.DOG: .*CreatureDataMixin object at .*>N)dataclassesr  r  r   r   rY  r  r  r  r   r(  r  assertRegex)r*   r  rD  r  r  r  rj  r(   r  r,   test_repr_with_dataclass
  s*   z$TestSpecial.test_repr_with_dataclassc                 C   s6   G dd d}G dd d|t }| t|jd d S )Nc                   @   r   )z<TestSpecial.test_repr_with_init_data_type_mixin.<locals>.Fooc                 S   s
   || _ d S r   r   )r*   r   r(   r(   r,   r   
  r   zETestSpecial.test_repr_with_init_data_type_mixin.<locals>.Foo.__init__c                 S   s   d| j dS )NzFoo(a=)r  r   r(   r(   r,   r{  
  r  zETestSpecial.test_repr_with_init_data_type_mixin.<locals>.Foo.__repr__N)r/   r0   r1   r   r{  r(   r(   r(   r,   rD  
  r   rD  c                   @   rk  )z@TestSpecial.test_repr_with_init_data_type_mixin.<locals>.Entriesr5   Nr  r(   r(   r(   r,   r  
  rq  r  z<Entries.ENTRY1: Foo(a=1)>)r   r   r(  r  r*   rD  r  r(   r(   r,   #test_repr_with_init_data_type_mixin
  s   z/TestSpecial.test_repr_with_init_data_type_mixinc                 C   sH   G dd d}G dd d|t }| t|jd | t|jd d S )Nc                   @   r   )zCTestSpecial.test_repr_and_str_with_non_data_type_mixin.<locals>.Fooc                 S   r&   )NrD  r(   r   r(   r(   r,   r{  
  r.   zLTestSpecial.test_repr_and_str_with_non_data_type_mixin.<locals>.Foo.__repr__c                 S   r&   )NooFr(   r   r(   r(   r,   r   
  r.   zKTestSpecial.test_repr_and_str_with_non_data_type_mixin.<locals>.Foo.__str__N)r/   r0   r1   r{  r   r(   r(   r(   r,   rD  
  r   rD  c                   @   rk  )zGTestSpecial.test_repr_and_str_with_non_data_type_mixin.<locals>.Entriesr5   Nr  r(   r(   r(   r,   r  
  rq  r  r  )r   r   r(  r  r  r  r(   r(   r,   *test_repr_and_str_with_non_data_type_mixin
  s   z6TestSpecial.test_repr_and_str_with_non_data_type_mixinc                 C   s4   G dd dt }| |jjd | |jjd d S )Nc                   @   s   e Zd Zdd ZdZdZdS )z2TestSpecial.test_value_backup_assign.<locals>.Somec                 S   r-  r   )r>  rX  )r  r?  r(   r(   r,   rX  
  r   z:TestSpecial.test_value_backup_assign.<locals>.Some.__new__r5   r!   N)r/   r0   r1   rX  ra  rb  r(   r(   r(   r,   Some
  s    r  r5   r!   )r   r   ra  r  rb  )r*   r  r(   r(   r,   test_value_backup_assign
  s   z$TestSpecial.test_value_backup_assignc                 C   sN   G dd dt t}| t|j|jB ||j|jB  | t|jdB | d S )Nc                   @   r3   )z7TestSpecial.test_custom_flag_bitwise.<locals>.MyIntFlagr5   r!   r?   Nr/   r0   r1   r   r   FOURr(   r(   r(   r,   	MyIntFlag
  r;   r  r!   )r  r   r   rY  r   r   )r*   r  r(   r(   r,   test_custom_flag_bitwise
  s   "z$TestSpecial.test_custom_flag_bitwisec                 C   s   G dd dt }|j|jB }t|}t|}| || | || |j|jB dB }t|}t|}| || | || | |jd d S )Nc                   @   r3   )z2TestSpecial.test_int_flags_copy.<locals>.MyIntFlagr5   r!   r?   Nr  r(   r(   r(   r,   r    r;   r  r  rr  )r   r   r   r  r  r   r  )r*   r  flagsr  r  r(   r(   r,   test_int_flags_copy  s   



zTestSpecial.test_int_flags_copyc              
      s   ddl m} |dd G  fdddt}| t|jd | |jj ddg d | d	d
 |D  ddg d dddgd ddg ddg d S )Nr   )
namedtupleTTuplez
id a blistc                       s6   e Zd Z ddg Z dddgZ ddg dZdS )z4TestSpecial.test_namedtuple_as_value.<locals>.NTEnumr   r5   r!   r?   r   r5   r!   N)r/   r0   r1   NONEr  r  r(   r  r(   r,   NTEnum  s    r  z*<NTEnum.NONE: TTuple(id=0, a=0, blist=[])>)idr   blistc                 S   r  r(   r%  )r!  ra  r(   r(   r,   r#  !  r$  z8TestSpecial.test_namedtuple_as_value.<locals>.<listcomp>r5   r!   r?   r  )collectionsr  r   r   r(  r  r  )r*   r  r  r(   r  r,   test_namedtuple_as_value  s   
,z$TestSpecial.test_namedtuple_as_valueN)hr/   r0   r1   r   r  r&  r+  unittestskipr0  r=  r?  rL  rQ  skipIfpython_versionr_  rb  re  rh  ri  rk  rs  ru  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   r  r  r
  r  r  r6  rh  rk  ro  rq  rw  rx  r|  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r$  r,  r?  rE  ry  r}  r  r  r  r  r  r  r  r  r  r  r  r  r(   r(   r(   r,   r  Z  s    
	

	/
	
					
%<<<;7:%"g,	>;

@
r  c                   @   sH   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d Zdd Z	dd Z
dS )	TestOrderz%test usage of the `_order_` attributec                 C      G dd dt }d S )Nc                   @   r@   )z*TestOrder.test_same_members.<locals>.Colorred green bluer5   r!   r6   Nr/   r0   r1   _order_r3  r4  r5  r(   r(   r(   r,   r6  )  rD   r6  r   r<  r(   r(   r,   test_same_members(     zTestOrder.test_same_membersc                 C   r  )Nc                   @       e Zd ZdZdZdZdZeZdS )z7TestOrder.test_same_members_with_aliases.<locals>.Colorr  r5   r!   r6   Nr/   r0   r1   r  r3  r4  r5  verder(   r(   r(   r,   r6  0  r  r6  r  r<  r(   r(   r,   test_same_members_with_aliases/  r  z(TestOrder.test_same_members_with_aliasesc                 C   r  )N#member order does not match _order_c                   @   r@   )z6TestOrder.test_same_members_wrong_order.<locals>.Colorr  r5   r6   r!   N)r/   r0   r1   r  r3  r5  r4  r(   r(   r(   r,   r6  9  rD   r6  r   r*  r   r<  r(   r(   r,   test_same_members_wrong_order7     "z'TestOrder.test_same_members_wrong_orderc                 C   r  )Nr  c                   @   r@   )z5TestOrder.test_order_has_extra_members.<locals>.Colorred green blue purpler5   r!   r6   Nr  r(   r(   r(   r,   r6  A  rD   r6  r  r<  r(   r(   r,   test_order_has_extra_members?  r  z&TestOrder.test_order_has_extra_membersc                 C   r  )Nr  c                   @   r  )zBTestOrder.test_order_has_extra_members_with_aliases.<locals>.Colorr  r5   r!   r6   Nr  r(   r(   r(   r,   r6  I  r  r6  r  r<  r(   r(   r,   )test_order_has_extra_members_with_aliasesG  r  z3TestOrder.test_order_has_extra_members_with_aliasesc                 C   r  )Nr  c                   @   r  )z4TestOrder.test_enum_has_extra_members.<locals>.Colorr  r5   r!   r6   r?   N)r/   r0   r1   r  r3  r4  r5  purpler(   r(   r(   r,   r6  R  r  r6  r  r<  r(   r(   r,   test_enum_has_extra_membersP  r  z%TestOrder.test_enum_has_extra_membersc                 C   r  )Nr  c                   @   s$   e Zd ZdZdZdZdZdZeZdS )zATestOrder.test_enum_has_extra_members_with_aliases.<locals>.Colorr  r5   r!   r6   r?   N)	r/   r0   r1   r  r3  r4  r5  r  r  r(   r(   r(   r,   r6  [  s    r6  r  r<  r(   r(   r,   (test_enum_has_extra_members_with_aliasesY  r  z2TestOrder.test_enum_has_extra_members_with_aliasesN)r/   r0   r1   r   r  r  r  r  r  r  r  r(   r(   r(   r,   r  %  s    		r  c                   @   s   e Zd ZdZG dd deZG dd deZG dd deZdd	 Zd
d Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zd d! Zd"d# Zd$d% Zd&d' Zd(d) Zd*d+ Zd,d- Zd.d/ Zd0d1 Zd2d3 Zd4d5 Zd6d7 Zd8S )9OldTestFlagzTests of the Flags.c                   @   s   e Zd Zd\ZZZdS )zOldTestFlag.Perm)r?   r!   r5   Nr/   r0   r1   RWrm  r(   r(   r(   r,   Permg  rb  r  c                   @   r  )zOldTestFlag.Openr   r5   r!   r6      Nr/   r0   r1   ROWORWACCEr(   r(   r(   r,   Openj  r  r  c                   @   @   e Zd ZdZdZdZdZdZeeB ZeeB eB Z	eeB eB Z
dS )zOldTestFlag.Colorr   r5   r!   r?   Nr/   r0   r1   BLACKr  ROJOr  r  PURPLEWHITEBLANCOr(   r(   r(   r,   r6  q      r6  c                 C   s   | j }|D ],}|D ]'}| ||B ||j|jB  | ||B j|j|jB  | t||B | q	q|D ]
}| ||B | q4| j}| |j|jB |j d S r   r  r   r  r*  r;  r  r  r  r*   r  rA  jr  r(   r(   r,   test_or{  s   zOldTestFlag.test_orc           
      C   s   | j }|j|jB }|j|jB }|j|jB }|j|jB |jB }t||||||dg }|D ]}|D ]}| ||@ j|j|j@  | t||@ | q1q-|D ]}| ||@ | | ||@ | | ||@ | qN| j	}	| |	j
|	j@ |	j
 d S Nr   )r  r  r  rm  r   r   r  r*  r;  r  r  r  
r*   r  r   RXWXRWXr  rA  r  r  r(   r(   r,   test_and  s"   zOldTestFlag.test_andc                 C   s   | j }|D ]}|D ]}| ||A j|j|jA  | t||A | q	q|D ]}| ||dA | | |d|A | q&| j}| |j|jA |j | |j|jA |j d S r  r  r  r(   r(   r,   test_xor  s   zOldTestFlag.test_xorc           	      C   s   | j }|j|jB }|j|jB }|j|jB }|j|jB |jB }t||||||dg }|D ]}| t| | | |  | q-|D ]
}| |  | qC| j}| |j	|j	 @ |j
 | |j	|jB |j	 @ |j d S r  )r  r  r  rm  r   r*  r;  r   r  r  r  r  	r*   r  r   r  r  r  r  rA  r  r(   r(   r,   test_invert  s   "zOldTestFlag.test_invertc                 C   D   | j }|D ]}| | q| j}|D ]}| t|jt| qd S r   r  r   r  r   r!  r  r*   r  rB  r  r(   r(   r,   r&       zOldTestFlag.test_boolc                 C   s&  |  tjjt G dd dttd}|  |jt G dd dttd}|  |jt G dd dttd}|  |jt G dd	 d	ttd}| t	d
|d |  |d|j
|jB  |  |d|j | |dd | t|dtu  | t||jg |  |d|j |  |d|j d S )Nc                   @   r3   )z'OldTestFlag.test_boundary.<locals>.Ironr5   r!   r  Nr/   r0   r1   r   r   EIGHTr(   r(   r(   r,   Iron  r;   r  r   c                   @   r3   )z(OldTestFlag.test_boundary.<locals>.Waterr5   r!   r  Nr  r(   r(   r(   r,   Water  r;   r   c                   @   r3   )z(OldTestFlag.test_boundary.<locals>.Spacer5   r!   r  Nr  r(   r(   r(   r,   Space  r;   r!  c                   @   r3   )z*OldTestFlag.test_boundary.<locals>.Bizarrer6   r?   r  Nr/   r0   r1   rF  r3  dr(   r(   r(   r,   Bizarre  r;   r$  zinvalid value 7r   r6   r  )r*  r~   r   
_boundary_r   r   r   r   r   r   r   r   r   r   r;  r  r   r3  rF  r#  )r*   r  r   r!  r$  r(   r(   r,   test_boundary  s    zOldTestFlag.test_boundaryc                 C   H   | j }| j}| t||j|j|jg | t||j|j|j	g d S r   
r6  r  r   r   r  r  r  r  r   r  r*   r6  r  r(   r(   r,   	test_iter      zOldTestFlag.test_iterc                 C   s   t dd}t|}| t|t| | t|d| | ||j|j|jg td D ]1\}}d|> }||}| |j	| | t
|j	t | |j| | || | t
|| q.d S Nr  R W Xr6   r5   r   r   r   r[  r  r  rm  r  r  r  r;  r  r   r:  r*  r*   r  r  rA  nr(  r  r(   r(   r,    test_programatic_function_string  s   
z,OldTestFlag.test_programatic_function_stringc                 C   s   t dddd}t|}| t|t| | t|d| | ||j|j|jg td D ]1\}}d|> }||}| |j	| | t
|j	t | |j| | || | t
|| q0d S Nr  r.  r  r  r6   r/  r0  r(   r(   r,   +test_programatic_function_string_with_start     z7OldTestFlag.test_programatic_function_string_with_startc                 C   s   t dg d}t|}| t|t| | t|d| | ||j|j|jg td D ]1\}}d|> }||}| |j	| | t
|j	t | |j| | || | t
|| q0d S Nr  )r  r  rm  r6   r.  r5   r/  r0  r(   r(   r,   %test_programatic_function_string_list  r5  z1OldTestFlag.test_programatic_function_string_listc                 C   s   t dd}t|}| t|t| | t|d| | ||j|j|jg td D ]5\}}dd| d > }||}| |j	| | t
|j	t | |j| | || | t
|| q.d S Nr  ))r  r!   )r  r  )rm  r  r6   r.  r5   r!   r/  r0  r(   r(   r,   "test_programatic_function_iterable  s   
z.OldTestFlag.test_programatic_function_iterablec                 C   s   t dtd}t|}| t|t| | t|d| | ||j|j|jg td	 D ]5\}}dd| d > }||}| |j
| | t|j
t | |j| | || | t|| q0d S r8  )r   r   r   r   r[  r  r  rm  r  r  r  r;  r  r   r:  r*  r0  r(   r(   r,   #test_programatic_function_from_dict%  s   z/OldTestFlag.test_programatic_function_from_dictc                 C   s  t ttrtt| jtj t| jtjtjB  t| jtjtj @  t| jt t| jtj t| jtjtjB  t| jtj	 t| jt
j t| jt
jt
jB  t| jt
jt
jB dB  t| jt
d t| jt
d t| jt
 t| jtj t| jtjtjB  t| jtj	 d S )N0   r   )rY  r>   r>  r^   r*  r9   r   r:   rA   rC   rE   rF   r   r(   r(   r,   test_pickle4  s<   




zOldTestFlag.test_picklec                 C   s   | j }| j}| |j|v  | |j|v  | d|v  | d|v  | |j|v  | |j|v  | d|v  | d|v  d S )Nr  r  r5   )r  r6  r}   r  r  r   r*   r  r6  r(   r(   r,   r@  Q  s   zOldTestFlag.test_contains_tfc           	      C   s   | j }|\}}}||B }||B }||B }||B |B }| ||v  | ||v  | ||v  | ||v  | ||v  | ||v  | ||v  | ||v  | ||v  | ||v  | ||v  | ||v  d S r   )r  r   r}   	r*   r  r  r  rm  r   r  r  r  r(   r(   r,   test_member_contains]  s$   
z OldTestFlag.test_member_containsc                 C   s   | j }| t|jg  | t|j|j|jg | t|j|jg | t|j|jg | t|j|j|j|jg | t|j|j|j|jg d S r   	r6  r   r   r  r  r  r  r  r	  r<  r(   r(   r,   test_member_iterq  s   "zOldTestFlag.test_member_iterc                 C   d   |  | j| jjd |  | j| jjd |  | j| jjd |  | j| jjd d S Nr   r5   r!   r6   r   r6  __len__r  r  r  r
  r   r(   r(   r,   test_member_lengthz     zOldTestFlag.test_member_lengthc                 C   sx   G dd dt }| t||j|j|j|j|jg | |j|j	 | |j	j
d | |jj
d | |jj
d d S )Nc                   @   s2   e Zd ZdZe Ze Ze ZdZe Z	e Z
dS )zAOldTestFlag.test_number_reset_and_order_cleanup.<locals>.ConfusedzONE TWO FOUR DOS EIGHT SIXTEENr!   N)r/   r0   r1   r  r   r   r   r  DOSr  SIXTEENr(   r(   r(   r,   Confused  s    
rJ  r!   r     )r   r   r   r   r   r  r  rI  r*  rH  r\  )r*   rJ  r(   r(   r,   #test_number_reset_and_order_cleanup  s   z/OldTestFlag.test_number_reset_and_order_cleanupc                 C   z   | j }| |djd | |d jd | |djd | |d jd | |j|j | j}| |d |j d S Nr5   r  r  r   r	  r
  r  r6  r   r   r*  r
  r	  r  r  r*  r(   r(   r,   test_aliases     zOldTestFlag.test_aliasesc                 C   `   G dd dt }| t||j|j|jg | |jjd | |jjd | |jjd d S )Nc                   @   r  )z+OldTestFlag.test_auto_number.<locals>.ColorNr/   r0   r1   r   r3  r5  r4  r(   r(   r(   r,   r6    r  r6  r5   r!   r?   )r   r   r   r3  r5  r4  r  r<  r(   r(   r,   test_auto_number  
   zOldTestFlag.test_auto_numberc                 C   r  )Nzinvalid flag value .not an int.c                   @      e Zd ZdZe ZdS )z3OldTestFlag.test_auto_number_garbage.<locals>.Colorz
not an intNr/   r0   r1   r3  r   r5  r(   r(   r(   r,   r6        
r6  )r   r*  r   r<  r(   r(   r,   test_auto_number_garbage  r  z$OldTestFlag.test_auto_number_garbagec                 C   0   G dd dt }| |j|j|jgt| d S )Nc                   @   "   e Zd Ze  ZZe Ze ZdS )z.OldTestFlag.test_duplicate_auto.<locals>.DupesNr/   r0   r1   r   r   primeror   r   r(   r(   r(   r,   Dupes      

r^  r   r   r   r   r   r   r*   r^  r(   r(   r,   test_duplicate_auto      zOldTestFlag.test_duplicate_autoc                    X  G dd d}G dd d G dd d|t }| |jjd | |jjd | |jjd	 | |jjd
 | t|jd G  fddd| t }| |jjd | |jjd | |jjd	 | |jjd
 | t|jd G  fddd |t }| |jjd | |jjd | |jjd	 | |jjd
 | t|jd d S )Nc                   @   r  )z1OldTestFlag.test_multiple_mixin.<locals>.AllMixinc                 S   <   t | }d }|r|d }|dd  D ]}||O }q|| _|S r  r   ALLr  members	all_valuer   r(   r(   r,   rg       
z5OldTestFlag.test_multiple_mixin.<locals>.AllMixin.ALLNr/   r0   r1   r   rg  r(   r(   r(   r,   AllMixin  r  rm  c                   @   r$   )z1OldTestFlag.test_multiple_mixin.<locals>.StrMixinc                 S   r   r   r  r   r(   r(   r,   r     r   z9OldTestFlag.test_multiple_mixin.<locals>.StrMixin.__str__Nr  r(   r(   r(   r,   r    r2   r  c                   @   r  z.OldTestFlag.test_multiple_mixin.<locals>.ColorNr  r(   r(   r(   r,   r6    r  r6  r5   r!   r?   r   r  c                       r  rn  r  r(   r  r(   r,   r6    r  r5  c                       r  rn  r  r(   r  r(   r,   r6    r  )r   r   r  r  r  r  rg  r  r*   rm  r6  r(   r  r,   r    (   zOldTestFlag.test_multiple_mixinc                    s:  G fdddt }G  fddd| G dd d }G dd d|} jd	 d |jd	 d |jd
 d |jd	d |jd
d G dd d|}G dd d|}G dd d|}|jd	 d |jd	d |jd
 d |jd	d |jd
d d S )Nc                       r  )z.OldTestFlag.test_init_subclass.<locals>.MyEnumc                    s0   t  jdi | | jdd d| _d S )N_testFr   r(   )r"  __init_subclass__r}   __dict__get_test1r  r^  )r  r*   r(   r,   rr    s   
z@OldTestFlag.test_init_subclass.<locals>.MyEnum.__init_subclass__r/   r0   r1   rr  r+  r(   r   r-  r,   r     r  r   c                       s   e Zd Z fddZ  ZS )z1OldTestFlag.test_init_subclass.<locals>.TheirEnumc                    s    t  | jdi | d| _d S )N	TheirEnumr(   )r"  rr  _test2rv  )rx  r  r(   r,   rr    s   
zCOldTestFlag.test_init_subclass.<locals>.TheirEnum.__init_subclass__rw  r(   )rx  r-  r,   rx    r  rx  c                   @   r$   )z1OldTestFlag.test_init_subclass.<locals>.WhoseEnumc                 [   r  r   r(   rv  r(   r(   r,   rr    r.   zCOldTestFlag.test_init_subclass.<locals>.WhoseEnum.__init_subclass__Nr/   r0   r1   rr  r(   r(   r(   r,   	WhoseEnum  r2   r{  c                   @   rk  )z.OldTestFlag.test_init_subclass.<locals>.NoEnumr5   Nr/   r0   r1   r   r(   r(   r(   r,   NoEnum  rq  r}  ru  ry  Fc                   @   r$   )z/OldTestFlag.test_init_subclass.<locals>.OurEnumc                 [   r/  )NOurEnum)ry  rv  r(   r(   r,   rr    r   zAOldTestFlag.test_init_subclass.<locals>.OurEnum.__init_subclass__Nrz  r(   r(   r(   r,   r~    r2   r~  c                   @   r$   )z1OldTestFlag.test_init_subclass.<locals>.WhereEnumc                 [   r  r   r(   rv  r(   r(   r,   rr    r.   zCOldTestFlag.test_init_subclass.<locals>.WhereEnum.__init_subclass__Nrz  r(   r(   r(   r,   	WhereEnum  r2   r  c                   @   rk  )z1OldTestFlag.test_init_subclass.<locals>.NeverEnumr5   Nr|  r(   r(   r(   r,   	NeverEnum  rq  r  )r   r   rs  r}   rt  )r*   r   r{  r}  r~  r  r  r(   )rx  r*   r,   test_init_subclass  s"   zOldTestFlag.test_init_subclassN) r/   r0   r1   r   r   r  r  r6  r  r  r  r  r&  r'  r+  r2  r4  r7  r9  r:  r<  r@  r?  rA  rF  rL  rP  rT  rY  rb  r  r  r(   r(   r(   r,   r  d  s:    
%	
-r  c                   @   s  e Zd ZdZG dd deZG dd deZG dd deZG dd	 d	eZd
d Z	dd Z
dd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zd d! Zd"d# Zd$d% Zd&d' Zd(d) Zd*d+ Zd,d- Zd.d/ Zd0d1 Zd2d3 Zd4d5 Zd6d7 Zd8d9 Z d:d; Z!d<S )=OldTestIntFlagzTests of the IntFlags.c                   @   r3   )zOldTestIntFlag.Permr?   r!   r5   Nr  r(   r(   r(   r,   r    r;   r  c                   @   r  )zOldTestIntFlag.Openr   r5   r!   r6   r  Nr  r(   r(   r(   r,   r    r  r  c                   @   r  )zOldTestIntFlag.Colorr   r5   r!   r?   Nr  r(   r(   r(   r,   r6    r  r6  c                   @   r3   )zOldTestIntFlag.Skipr5   r!   r  N)r/   r0   r1   r  SECONDEIGHTHr(   r(   r(   r,   Skip  r;   r  c                 C   s   | j }| |jtu  | j}|D ]}| t|| | ||j q| t|j|j	B | | |j|j	B d |D ]}| t|| | ||j q:| t|j
|jB | | |j
|jB d d S Nr6   )r  r   r  r  r  rY  r   r  r  rm  r  r   )r*   r  r  rB  r(   r(   r,   	test_type#  s   zOldTestIntFlag.test_typec                 C   T   |  ttddt  |  ttdddti  |  ttdddti  d S )Nr   z%s.OFF_KrS  z%(m)s.LOW_BEAM_K|%(m)s.FOG_K|8r"  r  z%(m)s.HeadlightsK(8))r   r(  r   SHORT_MODULEr   r(   r(   r,   test_global_repr_keep2     




z$OldTestIntFlag.test_global_repr_keepc                 C   r  )Nr   z%s.OFF_CrS  z%(m)s.LOW_BEAM_C|%(m)s.FOG_Cr"  r  z%(m)s.OFF_C)r   r(  r   r  r   r(   r(   r,   test_global_repr_conform1@  r  z(OldTestIntFlag.test_global_repr_conform1c                 C   s0   |  ttjtj@ d |  ttdd d S )Nz	NoName(0)r   )r   r  r   r   r   r   r(   r(   r,   test_global_enum_strN  r   z#OldTestIntFlag.test_global_enum_strc                 C   sv   | j }| t|jdd | t|j|jB dd G dd dt}| t|jdd | t|j|jB dd d S )Nr   4r  c                   @   s    e Zd ZdZdZdZdd ZdS )z+OldTestIntFlag.test_format.<locals>.NewPermr?   r!   r5   c                 S   rB  r   ry  r   r(   r(   r,   r   [  rE  z3OldTestIntFlag.test_format.<locals>.NewPerm.__str__N)r/   r0   r1   r  r  rm  r   r(   r(   r(   r,   NewPermW  r8  r  r  zR|X)r  r   r  r  rm  r   )r*   r  r  r(   r(   r,   r  R  s   zOldTestIntFlag.test_formatc                 C   sL  | j }|D ]s}|D ]%}| ||B |j|jB  | ||B j|j|jB  | t||B | q	tdD ]D}| ||B |j|B  | ||B j|j|B  | t||B | | ||B ||jB  | ||B j||jB  | t||B | q3q|D ]}| ||B | | |dB | | d|B | q{| j}| |j|jB |j d S Nr  r   	r  r   r  r*  r;  rZ   r  r  r  r  r(   r(   r,   r  `  s(   zOldTestIntFlag.test_orc           
   	   C   s  | j }|j|jB }|j|jB }|j|jB }|j|jB |jB }t||||||dg }|D ]}|D ]4}| ||@ |j|j@ d||f  | ||@ j|j|j@ d||f  | t||@ |d||f  q1t	dD ]D}| ||@ |j|@  | ||@ j|j|@  | t||@ | | ||@ ||j@  | ||@ j||j@  | t||@ | qjq-|D ]}| ||@ | | |d@ | | d|@ | q| j
}	| |	j|	j@ |	j d S )Nr   zi is %r, j is %rr  r   )r  r  r  rm  r   r   r  r*  r;  rZ   r  r  r  r  r(   r(   r,   r  u  s2   "$ zOldTestIntFlag.test_andc                 C   sR  | j }|D ]s}|D ]%}| ||A |j|jA  | ||A j|j|jA  | t||A | q	tdD ]D}| ||A |j|A  | ||A j|j|A  | t||A | | ||A ||jA  | ||A j||jA  | t||A | q3q|D ]}| |dA | | d|A | q{| j}| |j|jA |j | |j|jA |j d S r  r  r  r(   r(   r,   r    s(   zOldTestIntFlag.test_xorc           	      C   s   | j }|j|jB }|j|jB }|j|jB }|j|jB |jB }t||||||dg }|D ]}| | | j | t| | | |  | q-|D ]
}| |  | qL| j	}| |j
|j
 @ |j | |j
|jB |j
 @ |j d S r  )r  r  r  rm  r   r   r  r*  r;  r  r  r  r  r  r(   r(   r,   r    s   "zOldTestIntFlag.test_invertc                 C   s~  |  tjjt G dd dttd}G dd dttd}|  |jt G dd dttd}|  |jt G dd	 d	ttd}|  |jt G d
d dttd}| t	d|d |  |d|j
|jB  |  |d|j | |dd | t|dtu  | t||jg |  |d|j |  |d|j |j|jB }| |d | || | t|d | t|d d S )Nc                   @   rk  )z,OldTestIntFlag.test_boundary.<locals>.Simpler5   N)r/   r0   r1   SINGLEr(   r(   r(   r,   Simple  rq  r  r   c                   @   r3   )z*OldTestIntFlag.test_boundary.<locals>.Ironr5   r!   r  Nr  r(   r(   r(   r,   r    r;   r  c                   @   r3   )z+OldTestIntFlag.test_boundary.<locals>.Waterr5   r!   r  Nr  r(   r(   r(   r,   r     r;   r   c                   @   r3   )z+OldTestIntFlag.test_boundary.<locals>.Spacer5   r!   r  Nr  r(   r(   r(   r,   r!    r;   r!  c                   @   r3   )z-OldTestIntFlag.test_boundary.<locals>.Bizarrer6   r?   r  Nr"  r(   r(   r(   r,   r$    r;   r$  zinvalid value 5r  r   r%  r6   r  z <Simple.SINGLE|<Iron.TWO: 2>: 3>r   )r*  r~   r   r&  r   r   r   r   r   r   r   r   r   r   r;  r  r   r3  rF  r#  r  r{  r(  r  )r*   r  r  r   r!  r$  simpler(   r(   r,   r'    s,   zOldTestIntFlag.test_boundaryc                 C   r(  r   r)  r*  r(   r(   r,   r+    r,  zOldTestIntFlag.test_iterc                 C   s   t dd}t|}| t|t| | t|d| | ||j|j|jg td D ]7\}}d|> }||}| |j	| | t
|j	t | || | |j| | || | t
|| q.d S r-  r   r   r   r[  r  r  rm  r  r  r  r;  r  r   r:  r*  r0  r(   r(   r,   r2    s   
z/OldTestIntFlag.test_programatic_function_stringc                 C   s   t dddd}t|}| t|t| | t|d| | ||j|j|jg td D ]7\}}d|> }||}| |j	| | t
|j	t | || | |j| | || | t
|| q0d S r3  r  r0  r(   r(   r,   r4       z:OldTestIntFlag.test_programatic_function_string_with_startc                 C   s   t dg d}t|}| t|t| | t|d| | ||j|j|jg td D ]7\}}d|> }||}| |j	| | t
|j	t | || | |j| | || | t
|| q0d S r6  r  r0  r(   r(   r,   r7  	  r  z4OldTestIntFlag.test_programatic_function_string_listc                 C   s   t dd}t|}| t|t| | t|d| | ||j|j|jg td D ];\}}dd| d > }||}| |j	| | t
|j	t | || | |j| | || | t
|| q.d S r8  r  r0  r(   r(   r,   r9    s   
z1OldTestIntFlag.test_programatic_function_iterablec                 C   s   t dtd}t|}| t|t| | t|d| | ||j|j|jg td	 D ];\}}dd| d > }||}| |j
| | t|j
t | || | |j| | || | t|| q0d S r8  )r   r   r   r   r[  r  r  rm  r  r  r  r;  r  r   r:  r*  r0  r(   r(   r,   r:  )  s   z2OldTestIntFlag.test_programatic_function_from_dictc                 C   sx   t dg }t|}| t|t| | t|d| t dg }t|}| t|t| | t|d| d S )Nr  r   Thingr~   r   r   r   r[  r   r*   r  r  r  r(   r(   r,   )test_programatic_function_from_empty_list:  s   z8OldTestIntFlag.test_programatic_function_from_empty_listc                 C   sp   t dd}t|}| t|t| | t|d| t dd}| t|t| | t|d| d S )Nr  r(   r   r  r  r  r(   r(   r,   *test_programatic_function_from_empty_tupleE  s   z9OldTestIntFlag.test_programatic_function_from_empty_tuplec                 C   sh   | j }| j}| |j|v  | |j|v  | d|v  | d|v  | d|v  | d|v  d S )Nr  r   r!   )r  r6  r   r  r   r}   r=  r(   r(   r,   r@  N  s   zOldTestIntFlag.test_contains_tfc           	      C   s  | j }|\}}}||B }||B }||B }||B |B }| ||v  | ||v  | ||v  | ||v  | ||v  | ||v  | ||v  | ||v  | ||v  | ||v  | ||v  | ||v  | t | d|v  W d    d S 1 sw   Y  d S )Nrd  )r  r   r}   r  r*  r>  r(   r(   r,   r?  X  s*   
"z#OldTestIntFlag.test_member_containsc                 C   s   | j }| t|jg  | t|j|j|jg | t|j|jg | t|j|jg | t|j|j|j|jg d S r   r@  r<  r(   r(   r,   rA  n  s   "zOldTestIntFlag.test_member_iterc                 C   rB  rC  rD  r   r(   r(   r,   rF  v  rG  z!OldTestIntFlag.test_member_lengthc                 C   rM  rN  rO  r*  r(   r(   r,   rP  |  rQ  zOldTestIntFlag.test_aliasesc                 C   r  r   r  r  r(   r(   r,   r&    r  zOldTestIntFlag.test_boolc                    rd  )Nc                   @   r  )z4OldTestIntFlag.test_multiple_mixin.<locals>.AllMixinc                 S   re  r  rf  rh  r(   r(   r,   rg    rk  z8OldTestIntFlag.test_multiple_mixin.<locals>.AllMixin.ALLNrl  r(   r(   r(   r,   rm    r  rm  c                   @   r$   )z4OldTestIntFlag.test_multiple_mixin.<locals>.StrMixinc                 S   r   r   r  r   r(   r(   r,   r     r   z<OldTestIntFlag.test_multiple_mixin.<locals>.StrMixin.__str__Nr  r(   r(   r(   r,   r    r2   r  c                   @   r  z1OldTestIntFlag.test_multiple_mixin.<locals>.ColorNr  r(   r(   r(   r,   r6    r  r6  r5   r!   r?   r   r  c                       r  r  r  r(   r  r(   r,   r6    r  r5  c                       r  r  r  r(   r  r(   r,   r6    r  )r   r   r  r  r  r  rg  r  ro  r(   r  r,   r    rp  z"OldTestIntFlag.test_multiple_mixinN)"r/   r0   r1   r   r   r  r  r6  r  r  r  r  r  r  r  r  r  r  r'  r+  r2  r4  r7  r9  r:  r  r  r@  r?  rA  rF  rP  r&  r  r(   r(   r(   r,   r    s>    
.	

	r  c                   @   $   e Zd Zdd Zdd Zdd ZdS )TestEmptyAndNonLatinStringsc                 C   s:   |  t tdd}W d    d S 1 sw   Y  d S )N	empty_abc)r   r  r  )r  r   r   )r*   r  r(   r(   r,   test_empty_string  s   "z-TestEmptyAndNonLatinStrings.test_empty_stringc                 C   &   t dd}t|d}| |jd d S )N	greek_abc)   αr  r  r  r5   r   r
  r   r  )r*   r  r}  r(   r(   r,   test_non_latin_character_string     

z;TestEmptyAndNonLatinStrings.test_non_latin_character_stringc                 C   r  )N
hebrew_123)   אr   r   r  r5   r  )r*   r  r}  r(   r(   r,   test_non_latin_number_string  r  z8TestEmptyAndNonLatinStrings.test_non_latin_number_stringN)r/   r0   r1   r  r  r  r(   r(   r(   r,   r    s    r  c                   @   r  )
TestUniquec                 C   s,   t G dd dt}t G dd dt}d S )Nc                   @   r3   )z+TestUnique.test_unique_clean.<locals>.Cleanr5   r        @Nr/   r0   r1   r0  r1  r  r(   r(   r(   r,   Clean  r"  r  c                   @   r3   )z-TestUnique.test_unique_clean.<locals>.Cleanerr5   r!   r6   Nr/   r0   r1   singledoubletripler(   r(   r(   r,   Cleaner  r"  r  )r   r   r   r*   r  r  r(   r(   r,   test_unique_clean  s   zTestUnique.test_unique_cleanc                 C   s   |  td tG dd dt}W d    n1 sw   Y  |  td tG dd dt}W d    d S 1 s<w   Y  d S )N	tres.*onec                   @   r1  )z+TestUnique.test_unique_dirty.<locals>.Dirtyr5   r  Nr  r(   r(   r(   r,   Dirty  r"  r  double.*single.*turkey.*triplec                   @      e Zd ZdZdZdZdZdS )z-TestUnique.test_unique_dirty.<locals>.Dirtierr5   r6   Nr/   r0   r1   r  r  r  turkeyr(   r(   r(   r,   Dirtier  
    r  )r   r   r   r   r   r*   r  r  r(   r(   r,   test_unique_dirty  s   "zTestUnique.test_unique_dirtyc                 C   4   t tG dd dt}t tG dd dt}d S )Nc                   @   r3   )z/TestUnique.test_unique_with_name.<locals>.Sillyr5   r  r6   Nr/   r0   r1   r0  r1  r   r(   r(   r(   r,   Silly  r"  r  c                   @   r@   )z1TestUnique.test_unique_with_name.<locals>.Sillierr5   r!   r6   r?   Nr/   r0   r1   r  r   r  r  r(   r(   r(   r,   Sillier  r  r  r   r   r   r   r*   r  r  r(   r(   r,   test_unique_with_name     z TestUnique.test_unique_with_nameN)r/   r0   r1   r  r  r  r(   r(   r(   r,   r    s    r  c                   @   s<   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd ZdS )
TestVerifyc                 C   s  t tG dd dt}t tG dd dt}| td t tG dd dt}W d    n1 s5w   Y  | td t tG d	d
 d
t}W d    n1 sWw   Y  | td t tG dd dt}W d    d S 1 szw   Y  d S )Nc                   @   s$   e Zd Ze Ze Ze Ze ZdS )z(TestVerify.test_continuous.<locals>.AutoN)r/   r0   r1   r   r  r  THIRDFORTHr(   r(   r(   r,   Auto   s
    
r  c                   @   r@   )z*TestVerify.test_continuous.<locals>.Manualr6   r?   r  r  Nr/   r0   r1   r  r  r  r  r(   r(   r(   r,   Manual  r  r  z<invalid enum .Missing.: missing values 5, 6, 7, 8, 9, 10, 12c                   @   r@   )z+TestVerify.test_continuous.<locals>.Missingr6   r?   rr  rS  Nr  r(   r(   r(   r,   Missing  r  r  z,invalid flag .Incomplete.: missing values 32c                   @   r@   )z.TestVerify.test_continuous.<locals>.Incompleter?   r  rK  @   Nr  r(   r(   r(   r,   
Incomplete  r  r  z1invalid flag .StillIncomplete.: missing values 16c                   @   r@   )z3TestVerify.test_continuous.<locals>.StillIncompleter?   r  rr  r  Nr  r(   r(   r(   r,   StillIncomplete  r  r  )r   r   r   r   r   r   )r*   r  r  r  r  r  r(   r(   r,   test_continuous  s    "zTestVerify.test_continuousc                 C   s^  G dd dt }| t||jg | |jjd | |jjd | |jjd | td t	t
G dd dt }W d    n1 sGw   Y  | tddd	g G d
d dt}| t||jg | |jjd | |jjd | |jjd | td t	t
G dd dt}W d    n1 sw   Y  | td	d	g d S )Nc                   @   r3   *TestVerify.test_composite.<locals>.Bizarrer6   r?   r  Nr"  r(   r(   r(   r,   r$  (  r;   r$  r6   r?   r  zyinvalid Flag 'Bizarre': aliases b and d are missing combined values of 0x3 .use enum.show_flag_values.value. for details.c                   @   r3   r  r"  r(   r(   r(   r,   r$  4  r"  r5   r!   c                   @   r3   r  r"  r(   r(   r(   r,   r$  ;  r;   zcinvalid Flag 'Bizarre': alias d is missing value 0x2 .use enum.show_flag_values.value. for details.c                   @   rG   )r  r?   r  N)r/   r0   r1   r3  r#  r(   r(   r(   r,   r$  G  r   )r   r   r   r3  rF  r  r#  r   r   r   r   r~   show_flag_valuesr   )r*   r$  r(   r(   r,   test_composite'  s4   
zTestVerify.test_compositec                 C   r  )Nc                   @   r3   )z+TestVerify.test_unique_clean.<locals>.Cleanr5   r  r  Nr  r(   r(   r(   r,   r  N  r"  r  c                   @   r3   )z-TestVerify.test_unique_clean.<locals>.Cleanerr5   r!   r6   Nr  r(   r(   r(   r,   r  T  r"  r  r  r  r(   r(   r,   r  M  r  zTestVerify.test_unique_cleanc                 C   s   |  td ttG dd dt}W d    n1 sw   Y  |  td ttG dd dt}W d    d S 1 s@w   Y  d S )Nr  c                   @   r1  )z+TestVerify.test_unique_dirty.<locals>.Dirtyr5   r  Nr  r(   r(   r(   r,   r  \  r"  r  r  c                   @   r  )z-TestVerify.test_unique_dirty.<locals>.Dirtierr5   r6   Nr  r(   r(   r(   r,   r  e  r  r  )r   r   r   r   r   r   r  r(   r(   r,   r  Z  s   "zTestVerify.test_unique_dirtyc                 C   r  )Nc                   @   r3   )z/TestVerify.test_unique_with_name.<locals>.Sillyr5   r  r6   Nr  r(   r(   r(   r,   r  m  r"  r  c                   @   r@   )z1TestVerify.test_unique_with_name.<locals>.Sillierr5   r!   r6   r?   Nr  r(   r(   r(   r,   r  s  r  r  r  r  r(   r(   r,   r  l  r  z TestVerify.test_unique_with_namec                 C   s   t tG dd dt}d S )Nc                   @   r@   )z-TestVerify.test_negative_alias.<locals>.Colorr5   r!   r?   r#   N)r/   r0   r1   r  r  r  r	  r(   r(   r(   r,   r6  {  r  r6  )r   r   r   r<  r(   r(   r,   test_negative_aliasz  s   zTestVerify.test_negative_aliasN)	r/   r0   r1   r  r  r  r  r  r  r(   r(   r(   r,   r    s    (&r  c                   @   s   e Zd ZdZdZdZdZdZdd Zdd	 Z	d
d Z
dd Zdd Zdd Zeedkddd Zeedkddd Zeedk ddd Zeedk ddd Zdd Zdd  Zeedk d!d"d# Zd$d% Zd&d' Zd(S ))TestInternalsrc   rg   rk   rn   rq   c                 C   sZ   | j | j D ]}| t|d|  q| j| j | j D ]}| t|d|  qd S )Nr   r   r   r   r(   r(   r,   r     s
   zTestInternals.test_sunderc                 C   sZ   | j D ]}| t|d|  q| j| j | j | j D ]}| t|d|  qd S )Nr   r   r   r   r(   r(   r,   r     s
   
zTestInternals.test_dunderc                 C   r   r   r   r   r(   r(   r,   r     r   zTestInternals.test_is_privatec                 C   rR  )Nc                   @   r  )z-TestInternals.test_auto_number.<locals>.ColorNrS  r(   r(   r(   r,   r6    r  r6  r5   r!   r6   r   r   r   r3  r5  r4  r  r<  r(   r(   r,   rT    rU  zTestInternals.test_auto_numberc                 C   rR  )Nc                   @   s&   e Zd Zdd Ze Ze Ze ZdS )z+TestInternals.test_auto_name.<locals>.Colorc                 S      | S r   r(   r   r  r  lastr(   r(   r,   r    r.   zATestInternals.test_auto_name.<locals>.Color._generate_next_value_N)r/   r0   r1   r  r   r3  r5  r4  r(   r(   r(   r,   r6    s
    
r6  r3  r5  r4  r  r<  r(   r(   r,   test_auto_name  s
   zTestInternals.test_auto_namec                 C   sp   G dd dt }G dd d|}| t||j|j|jg | |jjd | |jjd | |jjd d S )Nc                   @   r$   )z:TestInternals.test_auto_name_inherit.<locals>.AutoNameEnumc                 S   r  r   r(   r  r(   r(   r,   r    r.   zPTestInternals.test_auto_name_inherit.<locals>.AutoNameEnum._generate_next_value_Nr  r(   r(   r(   r,   AutoNameEnum  r2   r  c                   @   r  )z3TestInternals.test_auto_name_inherit.<locals>.ColorNrS  r(   r(   r(   r,   r6    r  r6  r3  r5  r4  r  )r*   r  r6  r(   r(   r,   test_auto_name_inherit  s   z$TestInternals.test_auto_name_inheritrR  z+mixed types with auto() no longer supportedc                 C   sP   |  td G dd dt}W d    n1 sw   Y  | |jjd d S )N&will require all values to be sortablec                   @   rV  )z1TestInternals.test_auto_garbage_ok.<locals>.Colorr3  NrW  r(   r(   r(   r,   r6    rX  r6  r5   )r\  r]  r   r   r5  r  r<  r(   r(   r,   test_auto_garbage_ok  s   z"TestInternals.test_auto_garbage_okc                 C   s   |  td G dd dt}W d    n1 sw   Y  | t||j|j|jg | |jjd | |jjd | |jjd d S )Nr  c                   @      e Zd ZdZdZe ZdS )z;TestInternals.test_auto_garbage_corrected_ok.<locals>.Colorr3  r!   Nr/   r0   r1   r3  r5  r   r4  r(   r(   r(   r,   r6        
r6  r3  r!   r6   )	r\  r]  r   r   r   r3  r5  r4  r  r<  r(   r(   r,   test_auto_garbage_corrected_ok  s   z,TestInternals.test_auto_garbage_corrected_okz*mixed types with auto() will raise in 3.13c                 C   r  )Nr  c                   @   rV  )z3TestInternals.test_auto_garbage_fail.<locals>.Colorr3  NrW  r(   r(   r(   r,   r6    rX  r6  r  r<  r(   r(   r,   test_auto_garbage_fail     "z$TestInternals.test_auto_garbage_failc                 C   r  )Nr  c                   @   r  )z=TestInternals.test_auto_garbage_corrected_fail.<locals>.Colorr3  r!   Nr  r(   r(   r(   r,   r6    r  r6  r  r<  r(   r(   r,    test_auto_garbage_corrected_fail  r  z.TestInternals.test_auto_garbage_corrected_failc                 C   s@   |  t G dd dt}W d    d S 1 sw   Y  d S )Nc                   @   r  )z,TestInternals.test_auto_order.<locals>.Colorc                 S   r  r   r(   r  r(   r(   r,   r    r.   zBTestInternals.test_auto_order.<locals>.Color._generate_next_value_N)r/   r0   r1   r   r3  r4  r5  r  r(   r(   r(   r,   r6    r  r6  r;  r<  r(   r(   r,   test_auto_order  s   "zTestInternals.test_auto_orderc                    s\   t   d _G  fdddt}| t||j|jg | |jjd | |jjd d S )Nzpathological casec                       s   e Zd Z Zdd Ze ZdS )z2TestInternals.test_auto_order_wierd.<locals>.Colorc                 S   r  r   r(   r  r(   r(   r,   r    r.   zHTestInternals.test_auto_order_wierd.<locals>.Color._generate_next_value_N)r/   r0   r1   r3  r  r   r5  r(   
weird_autor(   r,   r6     s    
r6  r5  )r   r  r   r   r   r3  r5  r<  r(   r  r,   test_auto_order_wierd  s   z#TestInternals.test_auto_order_wierdz,auto() will return highest value + 1 in 3.13c                 C   sT   G dd dt }| |j|j | |j|j | |j|j | |j|j d S )Nc                   @   s&   e Zd Ze Ze ZeZeZe ZdS )z3TestInternals.test_auto_with_aliases.<locals>.ColorN)	r/   r0   r1   r   r3  r5  oxfordcrimsonr4  r(   r(   r(   r,   r6    s    
r6  )r   r*  r  r3  r  r5  r  r4  r<  r(   r(   r,   test_auto_with_aliases	  s
   z$TestInternals.test_auto_with_aliasesc                 C   rZ  )Nc                   @   r[  )z0TestInternals.test_duplicate_auto.<locals>.DupesNr\  r(   r(   r(   r,   r^    r_  r^  r`  ra  r(   r(   r,   rb    rc  z!TestInternals.test_duplicate_autoc                 C   s4  G dd dt }| |jjd | |jjd | |jjd G dd dt }| |jjd | |jjd	 | |jjd
 | |jjd | |j	jd | |j	jd | |j
jd | |j
jd | |jjd | |jjd G dd dt }| |jjd | |jjd | |jjd d S )Nc                   @   s.   e Zd Ze Ze e fZe e e fZdS )5TestInternals.test_multiple_auto_on_line.<locals>.HuhN)r/   r0   r1   r   r   r   r  r(   r(   r(   r,   rj  !  s    rj  r5   )r!   r6   )r?   r  r  c                   @   sD   e Zd ZdddZdd Ze Ze Ze dfZe dfZ	e Z
dS )	z5TestInternals.test_multiple_auto_on_line.<locals>.HahNc                 S   s*   t | }||_|p|d d  |_|S r  )r>  rX  r\  r  abbr)r  r  r  r   r(   r(   r,   rX  *  s   
z=TestInternals.test_multiple_auto_on_line.<locals>.Hah.__new__c                 S   r  r   r(   r  r(   r(   r,   r  /  r.   zKTestInternals.test_multiple_auto_on_line.<locals>.Hah._generate_next_value_WEDThur   )r/   r0   r1   rX  r  r   MONDAYTUESDAY	WEDNESDAYTHURSDAYFRIDAYr(   r(   r(   r,   Hah)  s    



r  r  monr  tuer  r  r  r  r  fric                   @   s6   e Zd Zdd Ze Ze e fZe e e fZdS )r  c                 S   s   |d S r~  r(   r  r(   r(   r,   r  C  r{  zKTestInternals.test_multiple_auto_on_line.<locals>.Huh._generate_next_value_N)r/   r0   r1   r  r   r   r   r  r(   r(   r(   r,   rj  B  s
    )r!   r!   )r6   r6   r6   )r   r   r   r  r   r  r  r  r  r  r  r  )r*   rj  r  r(   r(   r,   test_multiple_auto_on_line   s&   z(TestInternals.test_multiple_auto_on_lineN)r/   r0   r1   r   r   r   r   r   r   r   r   rT  r  r  r  r  r  r  r  r  r  r  r  r  rb  r  r(   r(   r(   r,   r    sR    



	
r  c                   @   rv   )TestEnumTypeSubclassingNrw   r(   r(   r(   r,   r  L  ry   r  a  Help on class Color in module %s:

class Color(aenum._enum.Enum)
 |  Color(*values)
 |
 |  Method resolution order:
 |      Color
 |      aenum._enum.Enum
 |      enum.Enum
 |      builtins.object
 |
 |  Data and other attributes defined here:
 |
 |  CYAN = <Color.CYAN: 1>
 |
 |  MAGENTA = <Color.MAGENTA: 2>
 |
 |  YELLOW = <Color.YELLOW: 3>
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from aenum._enum.Enum:
 |
 |  name
 |      The name of the Enum member.
 |
 |  value
 |      The value of the Enum member.
 |
 |  ----------------------------------------------------------------------
 |  Methods inherited from aenum._enum.EnumType:
 |
 |  __contains__(value) from aenum._enum.EnumType
 |      Return True if `value` is in `cls`.
 |
 |      `value` is in `cls` if:
 |      1) `value` is a member of `cls`, or
 |      2) `value` is the value of one of the `cls`'s members.
 |
 |  __getitem__(name) from aenum._enum.EnumType
 |      Return the member matching `name`.
 |
 |  __iter__() from aenum._enum.EnumType
 |      Return members in definition order.
 |
 |  __len__() from aenum._enum.EnumType
 |      Return the number of members (no aliases)
 |
 |  ----------------------------------------------------------------------
 |  Readonly properties inherited from aenum._enum.EnumType:
 |
 |  __members__
 |      Returns a mapping of member name->value.
 |
 |      This mapping lists all enum members, including aliases. Note that this
 |      is a read-only view of the internal mapping.a  Help on class Color in module %s:

class Color(aenum._enum.Enum)
 |  Color(*values)
 |
 |  Method resolution order:
 |      Color
 |      aenum._enum.Enum
 |      enum.Enum
 |      builtins.object
 |
 |  Data and other attributes defined here:
 |
 |  YELLOW = <Color.YELLOW: 3>
 |
 |  MAGENTA = <Color.MAGENTA: 2>
 |
 |  CYAN = <Color.CYAN: 1>
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from aenum._enum.Enum:
 |
 |  name
 |
 |  value
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors inherited from aenum._enum.EnumType:
 |
 |  __members__c                   @   s@   e Zd ZdZG dd deZdd Zdd Zdd	 Zd
d Z	dS )
TestStdLibNc                   @   r3   )TestStdLib.Colorr5   r!   r6   N)r/   r0   r1   CYANMAGENTAYELLOWr(   r(   r(   r,   r6    r;   r6  c                 C   sV   t jd u r
tt }ntt }t }tj|d}|| j |	 
 }| ||| d S )N)output)r   r   !expected_help_output_without_docsr/   expected_help_output_with_docsr   pydocHelperr6  getvaluer  r   )r*   expected_textr  helperresultr(   r(   r,   
test_pydoc  s   


zTestStdLib.test_pydocc                 C   s*  t dtfdd| jjfdtfd| jjfd| jjfd| jjfdtj	d fd	tj	d	 fd
| jj
fd| jjfdd| jjfddt| jdfd| jjff}t t| j}| t| t|  d}| D ]%}|dkrkqd|| || krt  tdd||| || df dd d}qd|r| d d S d S )Nr  )r   ...r  r0   r  r  r  r   r  rE  __contains__)r/   r6  __getitem__)r1   r   rr  __iter__Fr   z.
%s
     key: %s
  result: %s
expected: %s
%s
K===========================================================================r   sepT/result does not equal expected, see print above)dictr   r6  r  r/   r  r  r  r   rs  rE  r  r  r
  r  inspect
getmembersr   rE  keysr  fail)r*   r  r  failedr'  r(   r(   r,   test_inspect_getmembers  sH   







z"TestStdLib.test_inspect_getmembersc                 C   s`  ddl m} |ddttd|ddt| jjd|dd| jd	d|d
dt| jjd|ddt| jjd|ddtt| jdd|ddt| jj	d|ddttj
d|dd| jtd|dd| jdd|dd| jdd|dd| j| jjd|dd| j| jjd|dd| j| jjd|ddttjd d|ddttjd dg}|D ]}z|j W q ty   t| Y qw |jdd d tt | j}|jdd d | t|t|dd d! |D d d! |D f  d"}t||D ]<\}}|jd#v rd$D ]}t||t||krtd%d&||d&f d'd( d)}qq||kr#td%d&||d&f d'd( d)}q|r.| d* d S d S )+Nr   )	Attributer  data)r   kinddefining_classr>  r  methodr   r  r  r  rr  zclass methodrE  r  r   r0   r/   r6  r1   r   r  r  r  r   r  c                 S   rB  r   r   r}  r(   r(   r,   <lambda>	      z>TestStdLib.test_inspect_classify_class_attrs.<locals>.<lambda>)keyc                 S   rB  r   r   r"  r(   r(   r,   r#    r$  z%s != %sc                 S   r  r(   r   )r!  r   r(   r(   r,   r#    r$  z@TestStdLib.test_inspect_classify_class_attrs.<locals>.<listcomp>F)rr  r   )r   r  r   z
%s
%s
%s
%s
r  r   r  Tr  )r  r  r>  r   r6  r  r  r  r
  rE  r  r/   r  r  r  r   rs  r   r  r  sortr   classify_class_attrsr   r[  r)  r  )r*   r  r  r(  r  r  rr   r(   r(   r,   !test_inspect_classify_class_attrs  s   




"

z,TestStdLib.test_inspect_classify_class_attrsc                 C   s   ddl m}m}m} | |t||d|j|d|j|d|jd d|d|jd d|d|jd d|d	|jd
d|d|jd dg | |t	j
||d|jg d S )Nr   )	signature	Signature	Parameternew_class_namer  rO   )r  rS   r;  r  r5   r   r  )r  r*  r+  r,  r   r   POSITIONAL_ONLYPOSITIONAL_OR_KEYWORDKEYWORD_ONLYr~   FlagBoundaryVAR_POSITIONAL)r*   r*  r+  r,  r(   r(   r,   test_inspect_signatures   s&   


z"TestStdLib.test_inspect_signatures)
r/   r0   r1   maxDiffr   r6  r  r  r)  r3  r(   r(   r(   r,   r    s    "Ar  c                   @   s,   e Zd Zdd Zdd Zdd Zdd ZdS )MiscTestCasec                 C   "   G dd dt }| |jd  d S )Nc                   @   rk  )z'MiscTestCase.test_doc_1.<locals>.Singler5   Nr|  r(   r(   r(   r,   Single9  rq  r7  r   r   r   )r*   r7  r(   r(   r,   
test_doc_18  s   zMiscTestCase.test_doc_1c                 C   r6  )Nc                   @   rG   )z'MiscTestCase.test_doc_2.<locals>.Doubler5   r!   Nr   r(   r(   r(   r,   Double>  rL   r:  r8  )r*   r:  r(   r(   r,   
test_doc_2=  s   zMiscTestCase.test_doc_2c                 C   r6  )Nc                   @   r3   )z'MiscTestCase.test_doc_1.<locals>.Tripler5   r!   r6   Nr  r(   r(   r(   r,   TripleE  r;   r<  r8  )r*   r<  r(   r(   r,   r9  D  s   c                 C   r6  )Nc                   @   r@   )z*MiscTestCase.test_doc_1.<locals>.Quadrupler5   r!   r6   r?   N)r/   r0   r1   r   r   r  r  r(   r(   r(   r,   	QuadrupleL  rD   r=  r8  )r*   r=  r(   r(   r,   r9  K  s   N)r/   r0   r1   r9  r;  r(   r(   r(   r,   r5  6  s
    r5  r  rg  r  rn  r5   r                ?               @              @c                   @   sL   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd Zdd Z	dd Z
dS )TestConvertc                 C   sz   t  }dD ]}d|d| < d|d| < qdD ]
\}}||d| < qdD ]
\}}||d| < q#d	D ]
\}}||d
| < q0d S )N)r  r  r  r	  rP  r
  r  zCONVERT_TEST_NAME_%szCONVERT_STRING_TEST_NAME_%s))r  r  )r  r>  )r  r  zUNCOMPARABLE_%s))r  r@  )r  rA  )r  r?  z
COMPLEX_%s))r   r  )r   rg  zCONVERT_STR_TEST_%s)r  )r*   gsuffixr  r(   r(   r,   tearDownr  s   zTestConvert.tearDownc                 C   s,   t jjdtdd d}| |djd d S )NUnittestConvertc                 S   
   |  dS NCONVERT_TEST_r  ra  r(   r(   r,   r#       
 z@TestConvert.test_convert_value_lookup_priority.<locals>.<lambda>filterr  CONVERT_TEST_NAME_A)r~   r   	_convert_MODULEr   r   r*   r  r(   r(   r,   "test_convert_value_lookup_priority  s   z.TestConvert.test_convert_value_lookup_priorityc                    s   t jjdtdd d |  j j |  jd |  jd |  j	d |  j
d  fddt D } fddt D }| j|| g d	||f d
 d S )NrF  c                 S   rG  rH  r  rJ  r(   r(   r,   r#    rK  z.TestConvert.test_convert_int.<locals>.<lambda>rL  r  c                       g | ]
}|t  vr|qS r(   rG  r!  r   r  r(   r,   r#        z0TestConvert.test_convert_int.<locals>.<listcomp>c                    rS  r(   rF  rU  rV  r(   r,   r#    rW  #extra names: %r;  missing names: %rmsg)r~   r   rO  rP  r   CONVERT_TEST_NAME_FrN  CONVERT_TEST_NAME_BCONVERT_TEST_NAME_CCONVERT_TEST_NAME_DCONVERT_TEST_NAME_ErF  rG  r*   extrar=  r(   rV  r,   test_convert_int  s&   

zTestConvert.test_convert_intc                 C   6   t jjdtdd d}| t||j|j|jg d S )NUncomparablec                 S   rG  )NUNCOMPARABLE_r  rJ  r(   r(   r,   r#    rK  z7TestConvert.test_convert_uncomparable.<locals>.<lambda>rL  )	r~   r   rO  rP  r   r   UNCOMPARABLE_AUNCOMPARABLE_BUNCOMPARABLE_Cr*   uncompr(   r(   r,   test_convert_uncomparable     z%TestConvert.test_convert_uncomparablec                 C   rd  )Nre  c                 S   rG  )NCOMPLEX_r  rJ  r(   r(   r,   r#    rK  z2TestConvert.test_convert_complex.<locals>.<lambda>rL  )	r~   r   rO  rP  r   r   	COMPLEX_A	COMPLEX_B	COMPLEX_Crj  r(   r(   r,   test_convert_complex  rm  z TestConvert.test_convert_complexc                    s   t jjdtdd dd |  jd |  jd  fdd	t D } fd
d	t D }| j|| g d||f d | t	 jdt
  | t jd | t jd d S )NrF  c                 S   rG  )NCONVERT_STR_r  rJ  r(   r(   r,   r#    rK  z.TestConvert.test_convert_str.<locals>.<lambda>TrM  	as_globalr  rg  c                    rS  r(   rT  rU  rV  r(   r,   r#    rW  z0TestConvert.test_convert_str.<locals>.<listcomp>c                    rS  r(   rX  rU  rV  r(   r,   r#    rW  rY  rZ  z%s.CONVERT_STR_TEST_1)r~   r   rO  rP  r   CONVERT_STR_TEST_1CONVERT_STR_TEST_2rF  rG  r(  r  r  r  ra  r(   rV  r,   test_convert_str  s$   
zTestConvert.test_convert_strc                 C   sF   |  t tjjdtdd d W d    d S 1 sw   Y  d S )NrF  c                 S   rG  rH  r  rJ  r(   r(   r,   r#    rK  z0TestConvert.test_convert_raise.<locals>.<lambda>rL  )r  r  r~   r   _convertrP  r   r(   r(   r,   test_convert_raise  s   "zTestConvert.test_convert_raisec                 C   sV   t jjdtdd dd}| t|jdt  | t|jd | t	|jd d S )NrF  c                 S   rG  )NCONVERT_STRING_TEST_r  rJ  r(   r(   r,   r#    rK  z7TestConvert.test_convert_repr_and_str.<locals>.<lambda>Trt  z%s.CONVERT_STRING_TEST_NAME_Ar  )
r~   r   rO  rP  r   r(  CONVERT_STRING_TEST_NAME_Ar  r  r  rQ  r(   r(   r,   test_convert_repr_and_str  s   z%TestConvert.test_convert_repr_and_strN)r/   r0   r1   rE  rR  rc  rl  rr  rx  rz  r}  r(   r(   r(   r,   rB  q  s    
rB  c                 C   sf   t g d| j }| jtjur|d | jtjur|d | jtu r(t|S tt t	| j|B S )N)
r  r  r   r  r  rE  r  r0   r/   r1   rX  rr  )
rE  _member_names__new_member_r>  rX  addrr  r  sortedrF  )r  interestingr(   r(   r,   rG    s   


rG  c                 C   s   | j jtu rtg d}ntt| }| j  D ]9}|j D ]1\}}|d dkr*qt|t	j
rF|jd us:|| jvr@|| q|| q|tjvrP|| qqt|S )N)r  r   r-   __hash__r0   r   r  r   r   )r  r  r>  rE  rF  ro  rs  r!  rY  r~   r   r   r-  r  discardmemmberr  )r   allowedr  r   r`   r(   r(   r,   rJ    s    


rJ  __main__r   )r  r~   r   r   r   r   r   r   aenumdoctestr  osr  rv  r  	threadingrN  builtinsrZ  r  r   r  r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   ior   pickler   r   r   r   textwrapr   r    version_infor  r/   rP  r  r  r%   r  r4   r>  r  r  r<   r  r=   r>   rA   rE   rF   rH   rM   rP   rQ   rT   r^   ra   TestCaserb   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  r  r  r5  r_  r^  r]  rN  r`  r\  CONVERT_STRING_TEST_NAME_DCONVERT_STRING_TEST_NAME_CCONVERT_STRING_TEST_NAME_Br|  CONVERT_STRING_TEST_NAME_ECONVERT_STRING_TEST_NAME_Frw  rv  rg  ri  rh  rq  ro  rp  rB  rG  rJ  mainr(   r(   r(   r,   <module>   sV    (
6   2'&0


               Z?   $   ;/  I9   o
