
    ;e5                     @   d dl Zd dlZd dlZd dlZ G d dej                  Z G d dej                  Z G d dej                  Z G d d	ej                  Z	d
 Z
 G d dej                  Z G d dej                  Z G d de          Z G d de          Z G d dej                  Zd"dZ G d dej                  Zd Z G d de          Z G d de          Z G d de          Z G d d e          Zed!k    r ej                     dS dS )#    Nc                        e Zd Zd Zd Zd ZdS )TestExceptionGroupTypeHierarchyc                    |                      t          t          t                               |                      t          t          t                               |                      t          t          t
                               d S N)
assertTrue
issubclassExceptionGroup	ExceptionBaseExceptionGroupBaseExceptionselfs    0/usr/lib/python3.11/test/test_exception_group.pytest_exception_group_typesz:TestExceptionGroupTypeHierarchy.test_exception_group_types   s^    
>9==>>>
>3EFFGGG
#5}EEFFFFF    c                     |                      t          d          5  t          t                    d d d            d S # 1 swxY w Y   d S )Nr
   )assertRaisesRegex	TypeErrorr
   OSErrorr   s    r   "test_exception_is_not_generic_typezBTestExceptionGroupTypeHierarchy.test_exception_is_not_generic_type   s    ##I{;; 	 	g	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   <A A c                     t           }|                     t          |         t          j                   |                     t
          |         t          j                   d S r   )r   assertIsInstancer	   typesGenericAliasr   )r   Es     r   $test_exception_group_is_generic_typezDTestExceptionGroupTypeHierarchy.test_exception_group_is_generic_type   sJ    nQ/1CDDD03U5GHHHHHr   N)__name__
__module____qualname__r   r   r    r   r   r   r      sI        G G G
  I I I I Ir   r   c                   &    e Zd Zd Zd Zd Zd ZdS )BadConstructorArgsc                    d}|                      t          |          5  t          d           d d d            n# 1 swxY w Y   |                      t          |          5  t          t          d          g           d d d            n# 1 swxY w Y   |                      t          |          5  t          dt          d          gt          d          g           d d d            d S # 1 swxY w Y   d S )Nz8BaseExceptionGroup.__new__\(\) takes exactly 2 argumentsz	no errorszno msgegtoomanyr   r   r	   
ValueErrorr   MSGs     r   'test_bad_EG_construction__too_many_argsz:BadConstructorArgs.test_bad_EG_construction__too_many_args   s   I##Is33 	( 	(;'''	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(##Is33 	3 	3Jx001222	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3##Is33 	K 	K4*U"3"3!4y7H7H6IJJJ	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	K 	Ks1   :>> B

BB0.C++C/2C/c                 h   d}|                      t          |          5  t          t          d          t	          d                     d d d            n# 1 swxY w Y   |                      t          |          5  t          d t          d          g           d d d            d S # 1 swxY w Y   d S )Nzargument 1 must be str, not    z
bad syntax)r   r   r	   r(   SyntaxErrorr)   s     r   %test_bad_EG_construction__bad_messagez8BadConstructorArgs.test_bad_EG_construction__bad_message!   s4   ,##Is33 	F 	F:b>>;|+D+DEEE	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F##Is33 	3 	34*R..!1222	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3s#   +AAA;B''B+.B+c                    d}|                      t          |          5  t          dt          d          h           d d d            n# 1 swxY w Y   |                      t          |          5  t          dd            d d d            n# 1 swxY w Y   d}|                      t          |          5  t          dg            d d d            d S # 1 swxY w Y   d S )Nz1second argument \(exceptions\) must be a sequencezerrors not sequence*   r$   z;second argument \(exceptions\) must be a non-empty sequencer'   r)   s     r   +test_bad_EG_construction__bad_excs_sequencez>BadConstructorArgs.test_bad_EG_construction__bad_excs_sequence(   s   B##Is33 	D 	D0:b>>2BCCC	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D##Is33 	' 	'4&&&	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' M##J44 	% 	%4$$$	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	%s5   A		AA/BBB4CCCc                 &   d}|                      t          |          5  t          dt          g           d d d            n# 1 swxY w Y   |                      t          |          5  t          ddg           d d d            d S # 1 swxY w Y   d S )NzAItem [0-9]+ of second argument \(exceptions\) is not an exceptionzexpect instance, not typez	bad errorznot an exception)r   r(   r	   r   r)   s     r   /test_bad_EG_construction__nested_non_exceptionszBBadConstructorArgs.test_bad_EG_construction__nested_non_exceptions3   s&   %##J44 	D 	D6	BBB	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D##J44 	> 	>;);(<===	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	> 	>s#   AAA'BB
B
N)r   r   r   r+   r/   r2   r4   r    r   r   r"   r"      sS        K K K3 3 3	% 	% 	%> > > > >r   r"   c                   J    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 ZdS )InstanceCreationc                     t          d          t          d          g}|                     t          t	          d|                    t                     d S )N      r$   )r(   r   assertIstyper	   r   excss     r   $test_EG_wraps_Exceptions__creates_EGz5InstanceCreation.test_EG_wraps_Exceptions__creates_EG=   sP    1y||,d++,,	 	 	 	 	r   c                     t          d          t          d          g}|                     t          t	          d|                    t
                     d S )Nr8   r9   beg)r(   r   r:   r;   r   r	   r<   s     r   %test_BEG_wraps_Exceptions__creates_EGz6InstanceCreation.test_BEG_wraps_Exceptions__creates_EGC   sQ    1y||,#E40011	 	 	 	 	r   c                     d}|                      t          |          5  t          dt          d          t	          d          g          }d d d            d S # 1 swxY w Y   d S )Nz/Cannot nest BaseExceptions in an ExceptionGroupr$   r8   r9   )r   r   r	   r(   KeyboardInterrupt)r   r*   r$   s      r   -test_EG_wraps_BaseException__raises_TypeErrorz>InstanceCreation.test_EG_wraps_BaseException__raises_TypeErrorI   s    >##Is33 	M 	Mz!}}6G6J6J&KLLB	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	M 	Ms   -AAAc                     t          dt          d          t          d          g          }|                     t	          |          t                      d S )Nr@   r8   r9   )r   r(   rC   r:   r;   )r   r@   s     r   )test_BEG_wraps_BaseException__creates_BEGz:InstanceCreation.test_BEG_wraps_BaseException__creates_BEGN   sF     A8I!8L8L(MNNd3ii!344444r   c                      G d dt                     }|                     t           |dt          d          t	          d          g                    |           d S )Nc                       e Zd ZdS )IInstanceCreation.test_EG_subclass_wraps_non_base_exceptions.<locals>.MyEGNr   r   r   r    r   r   MyEGrI   S           Dr   rK   r$   r-   r1   )r	   r:   r;   r(   r   r   rK   s     r   *test_EG_subclass_wraps_non_base_exceptionsz;InstanceCreation.test_EG_subclass_wraps_non_base_exceptionsR   sy    	 	 	 	 	> 	 	 	 	dZ^^Yr]];<<==	 	 	 	 	r   c                      G d dt                     }d}|                     t          |          5   |dt          d          t	          d          g           d d d            d S # 1 swxY w Y   d S )Nc                       e Zd ZdS )MInstanceCreation.test_EG_subclass_does_not_wrap_base_exceptions.<locals>.MyEGNrJ   r    r   r   rK   rQ   [   rL   r   rK   $Cannot nest BaseExceptions in 'MyEG'r$   r-   r1   )r	   r   r   r(   rC   r   rK   msgs      r   .test_EG_subclass_does_not_wrap_base_exceptionsz?InstanceCreation.test_EG_subclass_does_not_wrap_base_exceptionsZ   s    	 	 	 	 	> 	 	 	 5##Is33 	@ 	@D
2(9"(=(=>???	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@s   )A''A+.A+c                      G d dt           t                    }d}|                     t          |          5   |dt          d          t	          d          g           d d d            d S # 1 swxY w Y   d S )Nc                       e Zd ZdS )TInstanceCreation.test_BEG_and_E_subclass_does_not_wrap_base_exceptions.<locals>.MyEGNrJ   r    r   r   rK   rX   c   rL   r   rK   rR   r$   r-   r1   )r   r(   r   r   rC   rS   s      r   5test_BEG_and_E_subclass_does_not_wrap_base_exceptionszFInstanceCreation.test_BEG_and_E_subclass_does_not_wrap_base_exceptionsb   s    	 	 	 	 	%z 	 	 	 5##Is33 	@ 	@D
2(9"(=(=>???	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@s   )A--A14A1c                      G d dt           t                    } |dt          d          t                      g           d S )Nc                       e Zd ZdS )[InstanceCreation.test_EG_and_specific_subclass_can_wrap_any_nonbase_exception.<locals>.MyEGNrJ   r    r   r   rK   r\   k   rL   r   rK   r$   r-   )r	   r(   r
   rM   s     r   <test_EG_and_specific_subclass_can_wrap_any_nonbase_exceptionzMInstanceCreation.test_EG_and_specific_subclass_can_wrap_any_nonbase_exceptionj   sW    	 	 	 	 	>: 	 	 	 	TJrNNIKK011111r   c                      G d dt           t                    } |dt          d          t                      g           d S )Nc                       e Zd ZdS )\InstanceCreation.test_BEG_and_specific_subclass_can_wrap_any_nonbase_exception.<locals>.MyEGNrJ   r    r   r   rK   r`   r   rL   r   rK   r$   r-   )r   r(   r
   rM   s     r   =test_BEG_and_specific_subclass_can_wrap_any_nonbase_exceptionzNInstanceCreation.test_BEG_and_specific_subclass_can_wrap_any_nonbase_exceptionq   sX    	 	 	 	 	%z 	 	 	 	TJrNNIKK011111r   c                 P    G d dt                     }|                     t           |dt          d          t	          d          g                    |           |                     t           |dt          d          t          d          g                    |           d S )Nc                       e Zd ZdS )@InstanceCreation.test_BEG_subclass_wraps_anything.<locals>.MyBEGNrJ   r    r   r   MyBEGrd   z   rL   r   re   r$   r-   r1   )r   r:   r;   r(   r   rC   )r   re   s     r    test_BEG_subclass_wraps_anythingz1InstanceCreation.test_BEG_subclass_wraps_anythingy   s    	 	 	 	 	& 	 	 	 	tjnnimm<==>>	 	 	 	tjnn.?.C.CDEEFF	 	 	 	 	r   N)r   r   r   r>   rA   rD   rF   rN   rU   rY   r]   ra   rf   r    r   r   r6   r6   <   s            M M M
5 5 5  @ @ @@ @ @2 2 22 2 2	 	 	 	 	r   r6   c                        e Zd Zd Zd Zd ZdS )StrAndReprTestsc           	         t          dt          d          t          d          g          }|                     t	          |          d           |                     t          |          d           t          d|t          d          |t          d          g          }|                     t	          |          d           |                     t          |          d           d S )	Nflatr8   r9   flat (2 sub-exceptions)z5ExceptionGroup('flat', [ValueError(1), TypeError(2)])nestednested (4 sub-exceptions)zExceptionGroup('nested', [ExceptionGroup('flat', [ValueError(1), TypeError(2)]), ValueError(1), ExceptionGroup('flat', [ValueError(1), TypeError(2)]), TypeError(2)]))r   r(   r   assertEqualstrreprr   r$   s     r   test_ExceptionGroupz#StrAndReprTests.test_ExceptionGroup   s    Z]]IaLL13 3 	R";<<<bC	E 	E 	E  r:a=="ill;= = 	R"=>>>bE	F 	F 	F 	F 	Fr   c                    t          dt          d          t          d          g          }|                     t	          |          d           |                     t          |          d           t          d|t          d          |g          }|                     t	          |          d           |                     t          |          d           d S )	Nrj   r8   r9   rk   zABaseExceptionGroup('flat', [ValueError(1), KeyboardInterrupt(2)])rl   znested (3 sub-exceptions)zBaseExceptionGroup('nested', [BaseExceptionGroup('flat', [ValueError(1), KeyboardInterrupt(2)]), ValueError(1), BaseExceptionGroup('flat', [ValueError(1), KeyboardInterrupt(2)])]))r   r(   rC   rn   ro   rp   rq   s     r   test_BaseExceptionGroupz'StrAndReprTests.test_BaseExceptionGroup   s    Z]]$5a$8$89; ; 	R";<<<b9	: 	: 	:
  r:a=="-/ / 	R"=>>>b?	@ 	@ 	@ 	@ 	@r   c           	          G d dt                     } |dt          d          t          d          g          }|                     t	          |          d           |                     t          |          d            |d|t          d          |t          d          g          }|                     t	          |          d	           |                     t          |          d
           d S )Nc                       e Zd ZdS )3StrAndReprTests.test_custom_exception.<locals>.MyEGNrJ   r    r   r   rK   rw      rL   r   rK   rj   r8   r9   rk   z+MyEG('flat', [ValueError(1), TypeError(2)])rl   rm   zMyEG('nested', [MyEG('flat', [ValueError(1), TypeError(2)]), ValueError(1), MyEG('flat', [ValueError(1), TypeError(2)]), TypeError(2)]))r	   r(   r   rn   ro   rp   )r   rK   r$   s      r   test_custom_exceptionz%StrAndReprTests.test_custom_exception   s
   	 	 	 	 	> 	 	 	 TZ]]IaLL13 3 	R";<<<b#PQQQTr:a=="ill;= = 	R"=>>>b'	) 	) 	) 	) 	)r   N)r   r   r   rr   rt   rx   r    r   r   rh   rh      sG        F F F(@ @ @,) ) ) ) )r   rh   c                     g } 	 	 t          d          # t           $ r}t          d          |d }~ww xY w# t          $ r}|                     |           Y d }~nd }~ww xY w	 	 t          d          # t          $ r}t	          t
                    d }~ww xY w# t          $ r}|                     |           Y d }~nd }~ww xY w	 	 t          d          # t          $ r}t          d          d }~ww xY w# t          $ r}|                     |           Y d }~nd }~ww xY w	 t          d|           # t          $ r}|cY d }~S d }~ww xY w)Nz#context and cause for ValueError(1)r8   zcontext for TypeErrorzcontext for ValueError(2)r9   	simple eg)MemoryErrorr(   appendr   r   intImportErrorr	   )r=   es     r   create_simple_egr      s   D	'CDDD 	' 	' 	'Q--Q&	'   A	!1222 	! 	! 	!C.. 	!   A	 9::: 	  	  	 Q--	    A[$///   s    
3.36 
A AA$A3 3
B=BBB 
C#B==CC 
C4 C//C44C7 7
D DD $D4 4
E
>E?E
E
c                       e Zd Zd Zd ZdS )ExceptionGroupFieldsc                    t                      }|                     |j        d           |                     |j        d         d           |                     |j        d         t                     |                     |j        d         j        t                     |                     |j        d         j	        t                     |                     |j        d         t                     |                     |j        d         j                   |                     |j        d         j	        t                     |                     |j        d         t                     |                     |j        d         j                   |                     |j        d         j	        t                     t           j        j        }|dz   |dz   |dz   |dz   gg}|                     |j        j        |d                    |                     |j        j                   t'          d	          D ]U}|j        |         j        }|                     |j                   |                     |j        |d         |                    Vd S )
Nrz   r   r8   r9                  )r   rn   messageargsr   
exceptionsr(   	__cause__r{   __context__r   assertIsNoner   r~   __code__co_firstlineno__traceback__	tb_linenotb_nextrange)r   r$   line0
tb_linenositbs         r   !test_basics_ExceptionGroup_fieldsz6ExceptionGroupFields.test_basics_ExceptionGroup_fields   s+    	[111[111 	bmA.
;;;bmA.8+FFFbmA.:KHHHbmA.	:::"-*4555bmA.:GDDDbmA.
;;;"-*4555bmA.:KHHH !)8bjqy%"*ebj9;
)3Z]CCC"*2333q 	= 	=Aq!/Bbj)))R\:a=+;<<<<	= 	=r   c                    t          dt          d          t          d          g          }|                     t	          |j                  t                     |j         |                     t                    5  d|_        d d d            n# 1 swxY w Y   |j         |                     t                    5  t          d          g|_        d d d            d S # 1 swxY w Y   d S )Nr$   r8   r9   znew msgxyz)
r	   r   r   rn   r;   r   tupler   assertRaisesAttributeErrorrq   s     r   test_fields_are_readonlyz-ExceptionGroupFields.test_fields_are_readonly  sJ   D9Q<<"<==bm,,e444


~.. 	# 	#"BJ	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	~.. 	- 	-$U^^,BM	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	-s$   ;BBB;CC"%C"N)r   r   r   r   r   r    r   r   r   r      s2        = = =:- - - - -r   r   c                       e Zd Zd ZdS )ExceptionGroupTestBasec                 l   |#|                      t          |          |           t          |t                    r|                     |t
          j        j                   |                     t          |j
                  t          |                     t          |j
        |          D ]\  }}|                     |d|           dS |                     |t                     |                     t          |          t          |                     |                     |j        |j                   dS )a   Assert that the exception matches the template

            A template describes the shape of exc. If exc is a
            leaf exception (i.e., not an exception group) then
            template is an exception instance that has the
            expected type and args value of exc. If exc is an
            exception group, then template is a list of the
            templates of its nested exceptions.
        N)r:   r;   
isinstancer   r   collectionsabcSequencern   lenr   zipassertMatchesTemplater   r   )r   excexc_typetemplater   ts         r   r   z,ExceptionGroupTestBase.assertMatchesTemplate  s    MM$s))X...c-.. 	6!!(KO,DEEES00#h--@@@CNH55 7 71**1dA66667 7 !!(M:::T#YYX777SXx}55555r   N)r   r   r   r   r    r   r   r   r     s#        6 6 6 6 6r   r   c                   >    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	S )
ExceptionGroupSubgroupTestsc                     t                      | _        t          d          t          t                    t          d          g| _        d S Nr8   r9   r   r$   r(   r   r}   eg_templater   s    r   setUpz!ExceptionGroupSubgroupTests.setUp,  6    "$$&qMM9S>>:a==Ir   c                    dt          d          t           t          gt           dfg}|D ]}|                     t                    5  | j                            |           d d d            n# 1 swxY w Y   |                     t                    5  | j                            |           d d d            n# 1 swxY w Y   d S )Nzbad argzinstance not typer1   )r   r   r   r$   subgroupsplit)r   bad_argsargs      r   (test_basics_subgroup_split__bad_arg_typezDExceptionGroupSubgroupTests.test_basics_subgroup_split__bad_arg_type0  s?   /00i(bM#  	# 	#C""9-- & &  %%%& & & & & & & & & & & & & & &""9-- # #c"""# # # # # # # # # # # # # # #	# 	#s$   A,,A0	3A0	B88B<	?B<	c                    | j         }|                     ||                    t                               |                     ||                    t                               |                     ||                    t
                               |                     ||                    t                               d S r   )r$   r:   r   r   r
   r   r	   rq   s     r   )test_basics_subgroup_by_type__passthroughzEExceptionGroupSubgroupTests.test_basics_subgroup_by_type__passthrough;  s    Wb"++m44555b"++i00111b"++&899:::b"++n5566666r   c                 j    |                      | j                            t                               d S r   )r   r$   r   r   r   s    r   &test_basics_subgroup_by_type__no_matchzBExceptionGroupSubgroupTests.test_basics_subgroup_by_type__no_matchB  s,    $'**73344444r   c                    | j         }t          t          d          t          d          gft          t          t                    gft          t          f| j        fg}|D ]\  }}|                     |          5  |                    |          }|                     |j        |j                   | 	                    |t          |           d d d            n# 1 swxY w Y   d S )Nr8   r9   )match)r$   r(   r   r}   r   subTestr   rn   r   r   r	   )r   r$   	testcases
match_typer   subegs         r   #test_basics_subgroup_by_type__matchz?ExceptionGroupSubgroupTests.test_basics_subgroup_by_type__matchE  s.   W *Q--A783())$d&67	9	 %. 	L 	L JJ// L LJ//  
;;;**5.(KKKL L L L L L L L L L L L L L L	L 	Ls   :ACC	C	c                 n    |                      | j        | j                            d                      d S )Nc                     dS NTr    r   s    r   <lambda>z\ExceptionGroupSubgroupTests.test_basics_subgroup_by_predicate__passthrough.<locals>.<lambda>T  s    $ r   )r:   r$   r   r   s    r   .test_basics_subgroup_by_predicate__passthroughzJExceptionGroupSubgroupTests.test_basics_subgroup_by_predicate__passthroughS  s0    dgtw//??@@@@@r   c                 b    |                      | j                            d                      d S )Nc                     dS NFr    r   s    r   r   zYExceptionGroupSubgroupTests.test_basics_subgroup_by_predicate__no_match.<locals>.<lambda>W  s    U r   )r   r$   r   r   s    r   +test_basics_subgroup_by_predicate__no_matchzGExceptionGroupSubgroupTests.test_basics_subgroup_by_predicate__no_matchV  s.    $'**??;;<<<<<r   c                 x   | j         }t          t          d          t          d          gft          t          t                    gft          t          f| j        fg}|D ]Y\  }|                    fd          }|                     |j        |j                   |                     |t          |           Zd S )Nr8   r9   c                 $    t          |           S r   r   r   r   s    r   r   zVExceptionGroupSubgroupTests.test_basics_subgroup_by_predicate__match.<locals>.<lambda>b  s    *Q
*C*C r   )
r$   r(   r   r}   r   r   rn   r   r   r	   )r   r$   r   r   r   r   s        @r   (test_basics_subgroup_by_predicate__matchzDExceptionGroupSubgroupTests.test_basics_subgroup_by_predicate__matchY  s    W *Q--A783())$d&67	9	 %. 	H 	H JKK C C C CDDEU]BJ777&&unhGGGG	H 	Hr   N)r   r   r   r   r   r   r   r   r   r   r   r    r   r   r   r   +  s        J J J	# 	# 	#7 7 75 5 5L L LA A A= = =H H H H Hr   r   c                   8    e Zd Zd Zd Zd Zd Zd Zd Zd Z	dS )	ExceptionGroupSplitTestsc                     t                      | _        t          d          t          t                    t          d          g| _        d S r   r   r   s    r   r   zExceptionGroupSplitTests.setUph  r   r   c                     t           t          t          t          fD ]U}| j                            |          \  }}|                     |t          | j                   |                     |           Vd S r   )	r   r
   r   r	   r$   r   r   r   r   )r   r   r   rests       r   &test_basics_split_by_type__passthroughz?ExceptionGroupSplitTests.test_basics_split_by_type__passthroughl  sw    $n6 	$ 	$A'--**KE4&&~t'79 9 9d####	$ 	$r   c                     | j                             t                    \  }}|                     |           |                     |t
          | j                   d S r   )r$   r   r   r   r   r	   r   r   r   r   s      r   #test_basics_split_by_type__no_matchz<ExceptionGroupSplitTests.test_basics_split_by_type__no_matcht  sY    gmmG,,t%   "".$"2	4 	4 	4 	4 	4r   c                    | j         }t          }t          }| |d           |d          g |t                    gf| |t                    g |d           |d          gf||f| j        d ft
          |f |d           |d          g |t                    gfg}|D ]\  }}}|                    |          \  }}	|                     |j        |j                   | 	                    |t          |           |=|                     |	j        |j                   | 	                    |	t          |           |                     |	           d S r   )r$   r(   r   r}   r   r   r   rn   r   r   r	   r   )
r   r$   VETEr   r   match_templaterest_templater   r   s
             r    test_basics_split_by_type__matchz9ExceptionGroupSplitTests.test_basics_split_by_type__matchz  sw   W ""Q%%A""S''+""S''RRUUBBqEEN+"Xt'.r]RRUUBBqEENRRWWI6
	 :C 
	( 
	(5J((:..KE4U]BJ777&&~~7 7 7(  rz:::**.-9 9 9 9 !!$''''
	( 
	(r   c                     | j                             d           \  }}|                     |t          | j                   |                     |           d S )Nc                     dS r   r    r   s    r   r   zVExceptionGroupSplitTests.test_basics_split_by_predicate__passthrough.<locals>.<lambda>  s    d r   )r$   r   r   r	   r   r   r   s      r   +test_basics_split_by_predicate__passthroughzDExceptionGroupSplitTests.test_basics_split_by_predicate__passthrough  sP    gmmNN33t""5.$:JKKK$r   c                     | j                             d           \  }}|                     |           |                     |t          | j                   d S )Nc                     dS r   r    r   s    r   r   zSExceptionGroupSplitTests.test_basics_split_by_predicate__no_match.<locals>.<lambda>  s    e r   )r$   r   r   r   r	   r   r   s      r   (test_basics_split_by_predicate__no_matchzAExceptionGroupSplitTests.test_basics_split_by_predicate__no_match  sP    gmmOO44t%   ""49IJJJJJr   c                 $  	 | j         }t          }t          }| |d           |d          g |t                    gf| |t                    g |d           |d          gf||f| j        d fg}|D ]\  	}}|                    	fd          \  }}|                     |j        |j                   |                     |t          |           |<|                     |j        |j                   |                     |t          |           d S )Nr8   r9   c                 $    t          |           S r   r   r   s    r   r   zPExceptionGroupSplitTests.test_basics_split_by_predicate__match.<locals>.<lambda>  s    Z:-F-F r   )
r$   r(   r   r}   r   r   rn   r   r   r	   )
r   r$   r   r   r   r   r   r   r   r   s
            @r   %test_basics_split_by_predicate__matchz>ExceptionGroupSplitTests.test_basics_split_by_predicate__match  s9   W ""Q%%A""S''+""S''RRUUBBqEEN+"Xt'.	
	 :C 	9 	95J((#F#F#F#FGGKE4U]BJ777&&~~7 7 7(  rz:::**.-9 9 9	9 	9r   N)
r   r   r   r   r   r   r   r   r   r   r    r   r   r   r   g  s        J J J$ $ $4 4 4( ( (0     
K K K
9 9 9 9 9r   r   c                        e Zd Zd Zd Zd ZdS )DeepRecursionInSplitAndSubgroupc                 j    t          d          }t          d          D ]}t          d|g          }|S )Nr8   i  r$   )r   r   r	   )r   r   r   s      r   make_deep_egz,DeepRecursionInSplitAndSubgroup.make_deep_eg  s:    aLLt 	* 	*AtaS))AAr   c                     |                                  }|                     t                    5  |                    t                     d d d            d S # 1 swxY w Y   d S r   )r   r   RecursionErrorr   r   r   r   s     r   test_deep_splitz/DeepRecursionInSplitAndSubgroup.test_deep_split  s    ~.. 	 	GGI	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	   AAAc                     |                                  }|                     t                    5  |                    t                     d d d            d S # 1 swxY w Y   d S r   )r   r   r   r   r   r   s     r   test_deep_subgroupz2DeepRecursionInSplitAndSubgroup.test_deep_subgroup  s    ~.. 	" 	"JJy!!!	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	"r   N)r   r   r   r   r   r   r    r   r   r   r     sA            
" " " " "r   r   c              #      K   |g }|                     | j                   t          | t                    r!| j        D ]}t          ||          E d {V  n| |fV  |                                 d S r   )r|   r   r   r   r   leaf_generatorpop)r   tbsr   s      r   r   r     s      
{JJs !!!#)**  	. 	.A%a----------	. 3hGGIIIIIr   c                       e Zd Zd ZdS )LeafGeneratorTestc                     t                      }|                     d t          |          D             |j                   t          |          D ]'\  }}|                     ||j        |j        g           (d S )Nc                     g | ]\  }}|S r    r    .0r   _s      r   
<listcomp>z9LeafGeneratorTest.test_leaf_generator.<locals>.<listcomp>  s    ...41aQ...r   )r   assertSequenceEqualr   r   r   )r   r$   r   r   s       r   test_leaf_generatorz%LeafGeneratorTest.test_leaf_generator  s      ..>"--...M	 	 	 %R(( 	: 	:FAs$$b&8: : : :	: 	:r   N)r   r   r   r  r    r   r   r   r     s#        
	: 	: 	: 	: 	:r   r   c                     g } 	 	 t          t                    # t           $ r}t          d|g          d }~ww xY w# t          $ r}|                     |           Y d }~nd }~ww xY w	 	 t	          d          # t          $ r}t          d          |d }~ww xY w# t
          $ r}|                     |           Y d }~nd }~ww xY w	 t          d|           # t          $ r}|cY d }~S d }~ww xY w)Nrl   zout of memoryr8   root)r   bytesr	   r|   r{   r(   )r=   r   r$   s      r   create_nested_egr
    sH   D	0E""" 	0 	0 	0 A3///	0   A	'o... 	' 	' 	'Q--Q&	'   AVT***   						ss    
949< 
A%A  A%*A9 9
BBBB 
C%B??CC 
C."C)#C.)C.c                   &    e Zd Zd Zd Zd Zd ZdS )NestedExceptionGroupBasicsTestc                     t                      }|                     |t          t          t                    gt          d          g           d S )Nr8   )r
  r   r	   r   r	  r(   rq   s     r   "test_nested_group_matches_templatezANestedExceptionGroupBasicsTest.test_nested_group_matches_template  sN    ""A/	1 	1 	1 	1 	1r   c                 $   t                      }|                     |j        d         j        t                     |                     |j        d         j        t                     |                     |j        d         j        t                     d S )Nr8   r   )r
  r   r   r   r{   r   r   rq   s     r   test_nested_group_chainingz9NestedExceptionGroupBasicsTest.test_nested_group_chaining  ss    bmA.:KHHHbmA.8+FFFbmA.:IFFFFFr   c                 n   t                      }t           j        j        }|j        |dz   f|j        d         j        |dz   f|j        d         j        |dz   f|j        d         j        d         j        |dz   ffD ]:\  }}|                     |j        |           |                     |j                   ;d S )N   r   r   r8   r      )	r
  r   r   r   r   rn   r   r   r   )r   r$   r   r   expecteds        r   &test_nested_exception_group_tracebackszENestedExceptionGroupBasicsTest.test_nested_exception_group_tracebacks
  s     )8urz*]1+UQY7]1+URZ8]1(+9519E	
 	* 	*NR R\8444bj))))	* 	*r   c           	         t                      }|                     t          t          t	          |                              d           t           j        j        }|dz   |dz   |dz   g|dz   |dz   gg}t          t	          |                    D ].\  }\  }}|                     d |D             ||                    /d S )Nr9   r  r   r  r   c                     g | ]	}|j         
S r    r   r  r   s     r   r  zQNestedExceptionGroupBasicsTest.test_iteration_full_tracebacks.<locals>.<listcomp>#  s    ,,,",,,r   )	r
  rn   r   listr   r   r   	enumerater  )r   r$   r   expected_tbsr   r  r   s          r   test_iteration_full_tracebacksz=NestedExceptionGroupBasicsTest.test_iteration_full_tracebacks  s     	T."4"45566::: )8"*eai;"*ebj13 '~b'9'9:: 	! 	!MQC$$,,,,,Q! ! ! !	! 	!r   N)r   r   r   r  r  r  r  r    r   r   r  r    sS        1 1 1G G G* * *! ! ! ! !r   r  c                       e Zd Zd ZdS )ExceptionGroupSplitTestBasec                    |                      |t                     |                    |          \  }}|                    |          }||                      |t                     t	          |          D ]\  }}|                      ||           |                     |           |                      |t                     t	          |          D ]\  }}|                      ||           ||                      |t                     d }|                      ||           ||                      ||          }	 ||          }
|                     t           ||                    t           ||                    t           ||                    z               ||          D ] }| 	                    |o||	v |o||
v            !|||fD ]}||                     |j
        |j
                   |                     |j        |j                   |                     |j        |j                   |                     |j        |j                   |                     t          |dd          t          |dd                     d }d }|||fD ]L} ||          D ]>}|                      | |||                     | |||                               ?M||fS )z5 Split an EG and do some sanity checks on the result Nc                 <    | g nd t          |           D             S )Nc                     g | ]\  }}|S r    r    r  s      r   r  zUExceptionGroupSplitTestBase.split_exception_group.<locals>.leaves.<locals>.<listcomp>>  s    *L*L*L11*L*L*Lr   r   )r   s    r   leaveszAExceptionGroupSplitTestBase.split_exception_group.<locals>.leaves=  s'    22*L*Ls8K8K*L*L*LLr   	__notes__c                 @    t          |          D ]\  }}|| u r|c S d S r   r#  )leafr$   r   r   s       r   tbs_for_leafzGExceptionGroupSplitTestBase.split_exception_group.<locals>.tbs_for_leafZ  s>    (,,  399JJJ  r   c                     d | D             S )Nc                      g | ]}||j         S r    r  r  s     r   r  zYExceptionGroupSplitTestBase.split_exception_group.<locals>.tb_linenos.<locals>.<listcomp>`  s    555R"5BL555r   r    )r   s    r   r   zEExceptionGroupSplitTestBase.split_exception_group.<locals>.tb_linenos_  s    5535555r   )r   r   r   r   r   assertIsNotNoner  rn   r   assertNotEqualr   r:   r   r   r   getattr)r   r$   r   r   r   sgr   r  r$  match_leavesrest_leavespartr(  r   s                 r   split_exception_groupz1ExceptionGroupSplitTestBase.split_exception_group)  sf   b"4555hhuoot[[!!%);<<<%e,, 0 0!%%a////  $$$!!"&8999%b)) 0 0!%%a////!!$(:;;;	M 	M 	M 	  r

;;;ve}}fTllr

OOuVVD\\!2!22	4 	4 	4  	+ 	+A+!|+)k)+ + + +
 D"% 	6 	6D  T\:::blDN;;;bnd.>???b.0BCCC  BT22D+t446 6 6	 	 	
	6 	6 	6 D"% 	7 	7DVD\\ 7 7((J||Ar2233J||At44557 7 7 77
 d{r   N)r   r   r   r2  r    r   r   r  r  '  s(        @ @ @ @ @r   r  c                   &    e Zd Zd Zd Zd Zd ZdS )NestedExceptionGroupSplitTestc                   	
  G d dt                     	d d 
	
fd}	  |             n># t           $ r1}|                    dt          |                      |}Y d }~nd }~ww xY wt          d          t	          t
                    t          d          gt          d          t	          t
                    t          d	          gt          d	          gt          d          g}t          d          t          d          gt          d          t          d	          gt          d	          gt          d          g}t	          t
                    gt	          t
                    ggg}|                     |t           |           |                     |t                    \  }}| 	                    |           |                     |t           |           |                     |t                    \  }}|                     |t           |           | 	                    |           |                     |t          t          f          \  }}|                     |t           |           | 	                    |           |                     |t                    \  }}|                     |t           |           |                     |t           |           |                     |t          t          f          \  }}|                     |t           |           |                     |t           |           |                    t                     \  }}|                     ||           | 	                    |           |                    	          \  }}|                     |t           |d
         g           |                     |t           |d         g           d S )Nc                       e Zd ZdS )JNestedExceptionGroupSplitTest.test_split_by_type.<locals>.MyExceptionGroupNrJ   r    r   r   MyExceptionGroupr7  o  rL   r   r8  c                      t          |           r   )r(   )vs    r   raiseVEzANestedExceptionGroupSplitTest.test_split_by_type.<locals>.raiseVEr  s    Q--r   c                      t          |           r   )r   )r   s    r   raiseTEzANestedExceptionGroupSplitTest.test_split_by_type.<locals>.raiseTEu  s    A,,r   c                  H    fdfdfd}  | d           d S )Nc                     g }| ft           f| dz   ffD ]=\  }}	  ||           # t          $ r}|                    |           Y d }~6d }~ww xY wt          d|          )Nr8   msg1)r}   r
   r|   r	   )r   r=   fr   r   r=  r;  s        r   level1zVNestedExceptionGroupSplitTest.test_split_by_type.<locals>.nested_group.<locals>.level1y  s     '|gs^gqs^L ' 'FAs'#$ ' ' 'A'$VT222s   )
AAAc                     g }| f| dz   f| dz   ffD ]=\  }}	  ||           # t           $ r}|                    |           Y d }~6d }~ww xY w d|          )Nr8   r9   msg2)r
   r|   )r   r=   rA  r   r   r8  rB  r;  s        r   level2zVNestedExceptionGroupSplitTest.test_split_by_type.<locals>.nested_group.<locals>.level2  s     &{VQqSMGQqS>J ' 'FAs'#$ ' ' 'A'&&vt444s   '
AAAc                     g }| dz   f| dz   ffD ]=\  }}	  ||           # t           $ r}|                    |           Y d }~6d }~ww xY wt          d|          )Nr8   r9   msg3)r
   r|   r	   )r   r=   rA  r   r   rE  r;  s        r   level3zVNestedExceptionGroupSplitTest.test_split_by_type.<locals>.nested_group.<locals>.level3  s     &!}w!n= ' 'FAs'#$ ' ' 'A'$VT222s   $
AAA   r    )rH  rB  rE  r8  r=  r;  s    @@r   nested_groupzFNestedExceptionGroupSplitTest.test_split_by_type.<locals>.nested_groupx  sw    3 3 3 3 3 35 5 5 5 5 5 53 3 3 3 3 3 F1IIIIIr   z
the note: r         r   r8   )r	   add_noteidr(   r   r}   r   r2  r.   r   r   r   r:   )r   rJ  r   r$   r   valueErrors_templatetypeErrors_templater   r   r8  r=  r;  s            @@@r   test_split_by_typez0NestedExceptionGroupSplitTest.test_split_by_typen  s   	 	 	 	 	~ 	 	 		  	  	 	 	 		 	 	 	 	 	 	<	LNNNN 	 	 	JJ+BqEE++,,,BBBBBB	 A	#
1>A	#
1>1
 qMM A
1.A
1.1
 qMM  "+3 09S>>2BCD""2~{CCC 00[AAt%   ""4EEE 00]CCt""5.+FFF$00j)5LMMt""5.+FFF$ 00Z@@t""5.:NOOO""49LMMM 00i5MNNt""5.:MNNN""49MNNN hh~..teR   $ hh/00t""5.;q>:JKKK""4+a.9IJJJJJs   
0 
A+'A&&A+c           	      >   d }	 t          d |t          d                     |t          d                    g          # t           $ r}|}Y d }~nd }~ww xY w|                     |t                    \  }}|                     |           |                     |t           t          d          t          d          g           |                     |t          t          f          \  }}|                     |t           t          d          t          d          g           |                     |           |                     |t                    \  }}|                     |t          t          d          g           |                     |t           t          d          g           |                     |t                    \  }}|                     |t           t          d          g           |                     |t          t          d          g           d S )Nc                 :    	 | # t           $ r}|cY d }~S d }~ww xY wr   )r   )exr   s     r   r   zHNestedExceptionGroupSplitTest.test_split_BaseExceptionGroup.<locals>.exc  s:        s    
r@   r8   r9   )r   r(   rC   r2  r   r   r   r	   )r   r   r   r@   r   r   s         r   test_split_BaseExceptionGroupz;NestedExceptionGroupSplitTest.test_split_BaseExceptionGroup  sD   	 	 		$JqMM**CC0A!0D0D,E,EFH H H! 	 	 	CCCCCC	 00i@@t%   ""$z!}}6G6J6J&K	M 	M 	M 00*/02 2t""%
17H7K7K'L	N 	N 	N$ 00jAAt"">JqMM?	4 	4 	4""$'8';';&<	> 	> 	> 006GHHt""%(9!(<(<'=	? 	? 	?"".:a==/	3 	3 	3 	3 	3s   >A 
AAAc                    t          dt          d          t          d          g          }|                    d           |                    d           t	          |j                  }|                    t                    \  }}|                     |j        |           |                     |j        |           |                     |j        |           |                     |j        |j                   |                     |j        |j                   |                     |j        |j                   |                    d           |                    d           |                    d           |                     |j        |dgz              |                     |j        |dgz              |                     |j        |dgz              d S )Nr$   r8   r9   note1note2r   r   )	r	   r(   r   rM  r  r%  r   rn   assertIsNot)r   r$   
orig_notesr   r   s        r   test_split_copies_notesz5NestedExceptionGroupSplitTest.test_split_copies_notes  s   D:a==)A,,"?@@
G
G",''
hhy))tz222*555444u777t~666$.999
DwfzTF':;;;*y*@AAAvh)>?????r   c                 2   t          dt          d          t          d          g          }d|_        |                    t                    \  }}|                     t          |d                     |                     t          |d                     d S )Nr$   r8   r9   {   r%  )r	   r(   r   r%  r   assertFalsehasattr)r   r$   r   r   s       r   +test_split_does_not_copy_non_sequence_noteszINestedExceptionGroupSplitTest.test_split_does_not_copy_non_sequence_notes  s     D:a==)A,,"?@@hhy))t44555{3344444r   N)r   r   r   rQ  rU  r[  r`  r    r   r   r4  r4  l  s[        aK aK aKF&3 &3 &3P@ @ @(5 5 5 5 5r   r4  c                        e Zd Zd Zd Zd ZdS )%NestedExceptionGroupSubclassSplitTestc                 "    G d dt                     }	 	 	 t          d          # t          $ r} |d|g          d }~ww xY w# |$ r5}	 t          d          # t          $ r} |d||g          d }~ww xY wd }~ww xY w# |$ r}|}Y d }~nd }~ww xY w|                     ||t          d          t          d          gg           |                     |t
                    \  }}|                     |           |                     |t           t          d          t          d          gg           |                     |t          t          f          \  }}|                     |t           t          d          t          d          gg           |                     |           |                     |t                    \  }}|                     |t           t          d          g           |                     |t           t          d          gg           |                     |t                    \  }}|                     |t           t          d          gg           |                     |t           t          d          g           d S )Nc                       e Zd ZdS )nNestedExceptionGroupSubclassSplitTest.test_split_ExceptionGroup_subclass_no_derive_no_new_override.<locals>.EGNrJ   r    r   r   EGre    rL   r   rf  r9   rl   r8   r$   )r	   r   r(   r   r2  r   r   )	r   rf  terl   ver   r$   r   r   s	            r   <test_split_ExceptionGroup_subclass_no_derive_no_new_overridezbNestedExceptionGroupSubclassSplitTest.test_split_ExceptionGroup_subclass_no_derive_no_new_override  s   	 	 	 	 	 	 	 			1-#A,,&  - - -"Xt,,,- 1 1 11$Q--'! 1 1 1"TB<00011
  	 	 	BBBBBB	 	""2rJqMMIaLL>+JKKK 00W==t%   "".:a==9Q<<."A	C 	C 	C 00j)5LMMt"">JqMMIaLL>#B	D 	D 	D$ 00Z@@t""5.:a==/JJJ""49Q<<.9IJJJ 00Y??t""5.IaLL>:JKKK""4*Q--IIIIIsZ   & 
A=AA A?A
A7$A22A77A::A??B BBBc                     G d dt                     }	  |dt          d          t          d          gd          # |$ r}|}Y d }~nd }~ww xY w|                     ||t          d          t          d          g           |                     |t
                    \  }}|                     |           |                     |t           t          d          t          d          g           |                     |t          t          f          \  }}|                     |t           t          d          t          d          g           |                     |           |                     |t                    \  }}|                     |t          t          d          g           |                     |t           t          d          g           |                     |t                    \  }}|                     |t           t          d          g           |                     |t          t          d          g           d S )Nc                        e Zd Z fdZ xZS )oNestedExceptionGroupSubclassSplitTest.test_split_BaseExceptionGroup_subclass_no_derive_new_override.<locals>.EGc                 J    t                                          | ||          S r   )super__new__)clsr   r=   unused	__class__s       r   ro  zwNestedExceptionGroupSubclassSplitTest.test_split_BaseExceptionGroup_subclass_no_derive_new_override.<locals>.EG.__new__E  s    
 wwsGT:::r   )r   r   r   ro  __classcell__)rr  s   @r   rf  rl  D  s8        ; ; ; ; ; ; ; ; ;r   rf  r$   r8   r9   rq  )r   r(   rC   r   r2  r   r   r	   )r   rf  r   r$   r   r   s         r   =test_split_BaseExceptionGroup_subclass_no_derive_new_overridezcNestedExceptionGroupSubclassSplitTest.test_split_BaseExceptionGroup_subclass_no_derive_new_overrideC  si   	; 	; 	; 	; 	;# 	; 	; 	;	"TJqMM+<Q+?+?@(KKK 	 	 	BBBBBB	 	""Z]]$5a$8$89	; 	; 	; 00W==t%   ""$z!}}6G6J6J&K	M 	M 	M 00./1 1t""%
17H7K7K'L	N 	N 	N$ 00Z@@t""5.:a==/JJJ""$'8';';&<	> 	> 	> 005FGGt""%(9!(<(<'=	? 	? 	?""4*Q--IIIIIs   )> AA

Ac                 d    G fddt                     	 	 	 t          d          # t          $ r} d|gd          d }~ww xY w# $ r6}	 t          d          # t          $ r} d||gd          d }~ww xY wd }~ww xY w# $ r}|}Y d }~nd }~ww xY w|                     |t          d          t          d          gg           |                     |t
                    \  }}|                     |           |                     |t          d          t          d          gg           |                     |j        d           |                     |j	        d         j        d           |                     |t          t          f          \  }}|                     |t          d          t          d          gg           |                     |j        d           |                     |j	        d         j        d           |                     |           |                     |t                    \  }}|                     |t          d          g           |                     |j        d           |                     |t          d          gg           |                     |j        d           |                     |j	        d	         j        d           |                     |t                    \  }}|                     |t          d          gg           |                     |j        d           |                     |j	        d	         j        d           |                     |t          d          g           |                     |j        d           d S )
Nc                   *     e Zd Z fdZfdZ xZS )mNestedExceptionGroupSubclassSplitTest.test_split_ExceptionGroup_subclass_derive_and_new_overrides.<locals>.EGc                 \    t                                          | ||          }||_        |S r   )rn  ro  code)rp  r   r=   ry  objrr  s        r   ro  zuNestedExceptionGroupSubclassSplitTest.test_split_ExceptionGroup_subclass_derive_and_new_overrides.<locals>.EG.__new__o  s(    ggooc7D99
r   c                 2     | j         || j                  S r   )r   ry  )r   r=   rf  s     r   deriveztNestedExceptionGroupSubclassSplitTest.test_split_ExceptionGroup_subclass_derive_and_new_overrides.<locals>.EG.derivet  s    r$,di888r   )r   r   r   ro  r|  rs  )rr  rf  s   @r   rf  rw  n  sR            
9 9 9 9 9 9 9 9 9r   rf  r9   rl   e   r8   r$   r1   r   )
r	   r   r(   r   r2  r   r   rn   ry  r   )	r   rg  rl   rh  r   r$   r   r   rf  s	           @r   ;test_split_ExceptionGroup_subclass_derive_and_new_overrideszaNestedExceptionGroupSubclassSplitTest.test_split_ExceptionGroup_subclass_derive_and_new_overridesm  s   	9 	9 	9 	9 	9 	9 	9 	9 	9 	9		52#A,,&  2 2 2"XtS1112 5 5 55$Q--'! 5 5 5"TB<44455
  	 	 	BBBBBB	 	""2rJqMMIaLL>+JKKK 00W==t%   ""4jmmill^-LMMMB'''+0#666 00j)5LMMt""5"z!}}y||n.MNNNR((()!,13777$ 00Z@@t""5"z!}}o>>>R(((""4y||n-=>>>B'''+0#666 00Y??t""5"	!~.>???R((()!,13777""4jmm_===B'''''s\   ) 
AAAA	 	BA
A<(A77A<<A??BB BBBN)r   r   r   ri  rt  r~  r    r   r   rb  rb    sI        (J (J (JT(J (J (JT6( 6( 6( 6( 6(r   rb  __main__r   )collections.abcr   	tracebackr   unittestTestCaser   r"   r6   rh   r   r   r   r   r   r   r   r   r
  r  r  r4  rb  r   mainr    r   r   <module>r     s4            I I I I Ih&7 I I I "> "> "> "> ">* "> "> ">JF F F F Fx( F F FR>) >) >) >) >)h' >) >) >)B  @)- )- )- )- )-8, )- )- )-X6 6 6 6 6X. 6 6 629H 9H 9H 9H 9H"8 9H 9H 9HxH9 H9 H9 H9 H95 H9 H9 H9V" " " " "h&7 " " "$   : : : : :) : : :"  0(! (! (! (! (!%; (! (! (!VB B B B B"8 B B BJh5 h5 h5 h5 h5$? h5 h5 h5VL( L( L( L( L(,G L( L( L(^ zHMOOOOO r   