
    ,h                       d dl mZ d dlZd dlZd dlmZ d dlmZ d dlZd dl	Z	d dl
mZmZ d dlmZ ej                  dk  rd dlmZmZ erd d	lmZ d&d
Z	 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!d)dZ"d)dZ#ejH                  jK                  dejL                  v 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%Z0y)+    )annotationsN)TracebackType)TYPE_CHECKING)MatcherRaisesGroup)repr_callable)      )BaseExceptionGroupExceptionGroup)RaisesContextc                8    dt        j                  |       z   dz   S )N^$)reescape)ss    f/var/www/html/Resume-Scraper/venv/lib/python3.12/site-packages/trio/_tests/test_testing_raisesgroup.pywrap_escaper      s    1##    c                z    | d   dk7  sJ d       |rdnd}t        j                  t        t        || z               S )N
z<developer error, expected string should not end with newlinez&Raised exception group did not match:  match)pytestraisesAssertionErrorr   )msg
add_prefixprefixs      r   fails_raises_groupr#      sE     	B4FEF :D5F=={6C</HIIr   c                 (   t        j                  t        t        dt	               d            5  t        t	                      d d d        t        t              5  t        dt               f      # 1 sw Y   .xY w# 1 sw Y   nxY wt        d      5  t        t              5  t        dt               f      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        t        t              5  t        dt               t               f      # 1 sw Y   nxY wt        t        t              5  t        dt               t               f      # 1 sw Y   nxY wt        t        t                    5  t        dt        dt               f      f      # 1 sw Y   nxY wt        t        t        t              t        t                    5  t        dt               t        dt               f      t        dt               f      f      # 1 sw Y   y xY w)NzInvalid argument "z2" must be exception type, Matcher, or RaisesGroup.r   fooz)'SyntaxError' is not of type 'ValueError'barr   )
r   r   
ValueErrorr   	TypeErrorr   r   r#   SyntaxErrorRuntimeError r   r   test_raises_groupr,   #   s   	 /ab

 ! 	IK ! 
Z	  5UZ\O44! !5 5 	FG6J6 U[]$455	6 6 6 6 6 
Z	- CUZ\;=$ABBC C 
[*	- CUZ\;=$ABBC C 
[,	- OU^EJL?%K$MNNO O 
JL!
 

 uz|o6rLN#45
 	

 
se   A2A>2A;>BC%B;;C	 CC0DD/EE2!FF
>HHc                    t        d      5  t        t              5  t        dt	               t               f      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        d      5  t        t        t
              5  t        dt               f      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        d      5  t        t        t              5  t        dt               f      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        d      5  t        t              5  t        dt               t               f      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        d      5  t        t        t              5  t        dt               t               g      # 1 sw Y   nxY wd d d        y # 1 sw Y   y xY w)Nz>1 matched exception. Unexpected exception(s): [RuntimeError()]r   zS1 matched exception. Too few exceptions raised, found no match for: ['SyntaxError']z
1 matched exception. 
Too few exceptions raised!
The following expected exceptions did not find a match:
  'ValueError'
    It matches ValueError() which was paired with 'ValueError'z
1 matched exception. 
Unexpected exception(s)!
The following raised exceptions did not find a match
  ValueError():
    It matches 'ValueError' which was paired with ValueError()a  
1 matched exception. 
The following expected exceptions did not find a match:
  'ValueError'
    It matches ValueError() which was paired with 'ValueError'
The following raised exceptions did not find a match
  SyntaxError():
    'SyntaxError' is not of type 'ValueError')r#   r   r'   r   r*   r)   r+   r   r    test_incorrect_number_exceptionsr.   O   s    	L	
A 	J	A R,.*,!?@@A A A A A 	a	
2 	J,	2 R*,112 2 2 2 2 	M	
2 	J
+2 R*,112 2 2 2 2 	M	
? 	J? R*,
!=>>? ? ? ? ? 	<		
@ 	J
+@ R*,!>??@ @ @ @ @s   A;A	 AA'B'<BB	B''B0>C>C))C2	.C>>DE%EE		EE"0F9F$$F-	)F99Gc                 	   t        t        d      5  t        dt        dt               f      f      # 1 sw Y   nxY wt        t        t        d      5  t        dt        dt               t               f      f      # 1 sw Y   nxY wt        t        t        d      5  t        dt        dt               g      t               g      # 1 sw Y   nxY wt        t        t        d            5  t        dt        dt               f      f      # 1 sw Y   nxY wt        t        t        d            5  t        dt        dt        dt               f      f      f      # 1 sw Y   nxY wt	        j
                  t        d      5  t        t        t              d       d d d        n# 1 sw Y   nxY wt        d      5  t        t        d      5  t        # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        d      5  t        t        t        d            5  t        dt               f      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        dd	
      5  t        t        t              5  t        dt        dt               t               g      g      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        dd	
      5  t        t        t        d       5  t        dt        dt               t               g      g      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        dd	
      5  t        t              5  t        dt        dt               g      g      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        d      5  t        t              5  t        dt        dt               g      g      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        d      5  t        t        t                    5  t        dt        dt        dt               g      g      g      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        d      5  t        t              5  t        dt        dt               g      g      # 1 sw Y   nxY wd d d        y # 1 sw Y   y xY w)NT)flatten_subgroupsr   z@^You cannot specify a nested structure inside a RaisesGroup withr   S'ValueError' is not an exception group, but would match with `allow_unwrapped=True`zRaisesGroup(ValueError, flatten_subgroups=True): 'ValueError' is not an exception group, but would match with `allow_unwrapped=True`a  Raised exception group did not match: 
The following expected exceptions did not find a match:
  'ValueError'
  'TypeError'
The following raised exceptions did not find a match
  ExceptionGroup('', [ValueError(), TypeError()]):
    Unexpected nested 'ExceptionGroup', expected 'ValueError'
    Unexpected nested 'ExceptionGroup', expected 'TypeError'
Did you mean to use `flatten_subgroups=True`?Fr!   c                2    t        | j                        dk(  S )N   )len
exceptions)egs    r   <lambda>z(test_flatten_subgroups.<locals>.<lambda>   s    S/14 r   checkzRaised exception group did not match: Unexpected nested 'ExceptionGroup', expected 'ValueError'
  Did you mean to use `flatten_subgroups=True`?z9Unexpected nested 'ExceptionGroup', expected 'ValueError'zRaisesGroup(ValueError): Unexpected nested 'ExceptionGroup', expected 'ValueError'
  Did you mean to use `flatten_subgroups=True`?z4'BaseExceptionGroup' is not of type 'ExceptionGroup')	r   r'   r   r(   r   r   r#   r   KeyboardInterruptr+   r   r   test_flatten_subgroupsr<      s   	Z4	8 IR.jl_"E!GHHI I 
Zd	C UR.jlIK5P"Q!STTU U	Zd	C TR.jl^"Dik!RSST T 
[tD	E IR.jl_"E!GHHI I	[tD	E 
BZ\O!D FGI
 	

 
 
Q
 E 	K
+tD	E E E 	a	
 	J$7	      	 S	
2 	K
dCD	2 R*,112 2 2 2 2 	< 	
T 	J	*T R.jlIK5P"Q!RSST T T T T$ 	< 	
T 	4	
T& R.jlIK5P"Q!RSS'T T T T T. 	>	
G 	JG R.jl^"D!EFFG G G G G 	VWFJF R.ik]"C!DEE	F F F F F 	>	



 	K
+,

 BZ\N!C DEF
 	


 

 

 

 

  	QRVN#V !&8>O>Q=R&S%TUU	V V V V Vs4  !3<*A??B!*CC1!DD8,E$$E-F//F8G4GG(	$G44G=I&H<<I	II*J>?*J))J2	.J>>KL./*LL"	L..L7N!M88N	=NN$O*4!OO	O**O3Q,QQ	QQ$2R8!R##R,	(R88Sc            
     f   t        t        d      5  t        # 1 sw Y   nxY wt        j                  t        d      5  t        t        t        d       d d d        n# 1 sw Y   nxY wt        t        d       d      5  t        # 1 sw Y   nxY wt        j                  t        d      5  t        t        t              d       d d d        n# 1 sw Y   nxY wt        t        t        d            5  t        dt        dt               g      g      # 1 sw Y   nxY wt        t        t        d            5  t        dt               g      # 1 sw Y   nxY wt        d	      5  t        t              5  t        d
      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        d      5  t        t        d      5  t        dt        dt               g      g      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        t        dd      5  t        dt        dt               g      g      # 1 sw Y   nxY wt        dd      5  t        t        d      5  t        d      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        dd      5  t        t        t              d      5  t        # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        d      5  t        t        t                    5  t        # 1 sw Y   nxY wd d d        y # 1 sw Y   y xY w)NTallow_unwrappedz,^You cannot specify multiple exceptions withr   c                .    t        | t        t        f      S N)
isinstancer)   r'   es    r   r8   z1test_catch_unwrapped_exceptions.<locals>.<lambda>  s    
1{J.G H r   r9   zhas no effect when expectingr   r1   zvalue error textziUnexpected nested 'ExceptionGroup', expected 'ValueError'
  Did you mean to use `flatten_subgroups=True`?r%   r&   )r?   r0   zORaised exception (group) did not match: 'TypeError' is not of type 'ValueError'Fr2   z.this text doesn't show up in the error messagezdRaised exception (group) did not match: Matcher(ValueError): 'TypeError' is not of type 'ValueError'z&'ValueError' is not an exception group)	r   r'   r   r   r)   r   r   r#   r(   r+   r   r   test_catch_unwrapped_exceptionsrE     s    
Z	6   
=
 C 	KTB	C C C 
HI
  	  
z)G	H CK
+TBC C C
 
[TB	C GR.jl^"D!EFFG G	[TB	C 1R*,001 1
 	a	
- 	J	- +,,- - - - - 	>	
M
 	J5M U^EJL>%J$KLLM M M M M 
Z	N GR.jl^"D!EFFG G
 	]	
J
 	J5J HIIJ J J J J 	r	

 	GJ'>      	CDK
+, 	    s   " A  A)BB2CC<!DD&EE"0F! FF	F!!F*8H 
!G++G4	0H  H	!H??IJ*I66I?	;JJ$K?KK	KK$2L'LL	L''L0c                 8   t        t        d      5  t        dt               f      # 1 sw Y   nxY wt        t        d      5  t        dt               f      # 1 sw Y   nxY wt        t        d      5  t        dt               f      } | j                  d       | # 1 sw Y   nxY wt        t        d      5  t        dt               f      } | j                  d       | # 1 sw Y   nxY wt	        d      5  t        t        d      5  t        dt               f      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt	        d      5  t        t        d      5  t        dt        d      g      # 1 sw Y   nxY wd d d        y # 1 sw Y   y xY w)	Nr&   r   ^bar$zmy notez^bar
my note$z;Regex pattern 'foo' did not match 'bar' of 'ExceptionGroup'r%   zRegex pattern 'foo' did not match 'bar' of 'ExceptionGroup', but matched the expected 'ValueError'. You might want RaisesGroup(Matcher(ValueError, match='foo')))r   r'   r   add_noter#   rC   s    r   
test_matchrI   X  s~   	Zu	- 5UZ\O445 5 
Zw	/ 5UZ\O445 5 
Zy	1 5:</2	

9  
Z'7	8 5:</2	

9  	I	
5 	Je,	5 UZ\O445 5 5 5 5 	 o	
9 	Je,	9 UZ%6$7889 9 9 9 9sh   (1AA$8)B!!B*>)C''C0>D;D&&D/	+D;;EF$E;;F	 FFc                 @   t        dt               f      dfd} t        |       }t        t        |       5  # 1 sw Y   nxY wt	        d| d      5  t        t        |       5  t        dt               f      # 1 sw Y   nxY wd d d        y # 1 sw Y   y xY w)Nr   c                    | u S rA   r+   )rD   excs    r   is_excztest_check.<locals>.is_exc  s    Cxr   r9   zcheck z did not return True)rD   zExceptionGroup[ValueError]returnbool)r   r'   r   r   r#   )rM   is_exc_reprrL   s     @r   
test_checkrQ     s    
jl_
-C  'K	Zv	. 	  	VK=0DEF2Jf-2 R*,11	2 2 2 2 2s'   <AB)A??B	BBc                    dd} d}t        j                  t        t        j                  |            5  t        t        dd       d d d        t        j                  t        t        j                  |            5  t        t        d|        d d d        t        t        t        d      d	      }|5  t        d      # 1 sw Y   |xY w# 1 sw Y   ?xY w# 1 sw Y   nxY w|5  t        d
t        d      g      # 1 sw Y   nxY wt        t        d	      5 }t        dt        d      g      # 1 sw Y   nxY wt        j                  t              r-t        t        d      j                  |j                        sJ y y )Nc                     y)NTr+   rC   s    r   my_checkz,test_unwrapped_match_check.<locals>.my_check  s    r   av  `allow_unwrapped=True` bypasses the `match` and `check` parameters if the exception is unwrapped. If you intended to match/check the exception you should use a `Matcher` object. If you want to match/check the exceptiongroup when the exception *is* wrapped you need to do e.g. `if isinstance(exc.value, ExceptionGroup): assert RaisesGroup(...).matches(exc.value)` afterwards.r   Tr%   )r?   r   )r?   r:   z^foo$r>   r   r&   )rD   objectrN   rO   )r   r   r'   r   r   r   r   r   rB   valuematches)rT   r    rgrL   s       r   test_unwrapped_match_checkrY     sJ   	C  
z3	8 CJEBC	z3	8 FJHEF 
WZw7	NB	  C CF F
   	 6R*U"3!4556 6 
Z	6 9#UZ%6$7889 9#))^,:U3;;CIIFFF -s;   C>C7CCCC$)D  D	D44D=c                     t        t              } | j                  d       rJ | j                  t                     rJ | j                  t        dt               f            sJ y )Nr   )r   r'   rW   r   )rX   s    r   test_RaisesGroup_matchesr[     sI    	Z	 Bzz$zz*,''::nR*,9:::r   c            	     2   	 	 	 	 	 	 dd}  | dt        t                      | dt        t        t                      | dt        t        t                            | dt        t        t        d                    | dt        t        d                    | d	t        t                      | d
t        t        t                            | dt        t        t                            | dt        t        t              t        t                           y )Nc                    t        j                  t        dt        j                  |        d      5  |5  	 d d d        d d d        y # 1 sw Y   xY w# 1 sw Y   y xY w)Nz'^DID NOT RAISE any exception, expected r   r   )r   r   r   r   r   )messagebodys     r   check_messagez#test_message.<locals>.check_message  s^    
 MM?		'@R?SSTU	
 	 	 	 	 	 	 	s!   AA	A	A	AAzExceptionGroup(ValueError)z&ExceptionGroup(ValueError, ValueError)z*ExceptionGroup(ExceptionGroup(ValueError))z3ExceptionGroup(Matcher(ValueError, match='my_str'))my_strz'ExceptionGroup(Matcher(match='my_str'))r   z%BaseExceptionGroup(KeyboardInterrupt)z.BaseExceptionGroup(Matcher(KeyboardInterrupt))z9BaseExceptionGroup(BaseExceptionGroup(KeyboardInterrupt))zUBaseExceptionGroup(BaseExceptionGroup(KeyboardInterrupt), ExceptionGroup(ValueError)))r^   strr_   zRaisesGroup[BaseException]rN   None)r   r'   r   r;   )r`   s    r   test_messagerd     s   ( 
 .J0GH0J
+
 4K
+, =GJ12 1G(+, /%&
 8G-./
 CK 123
 _K 12K
4KLr   c                    t        d      5  t        t              5  t        dt	               g      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        dd      5  t        t        t              t        t        d            5  t        dt        dt               g      t               g      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        dd      5  t        t        t        t              t        t
              t        t                    5  t        dt               t	               t        d	      t        d
      g      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        d      5  t        t        t              5  t        dt               t               g      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        d      5  t        t        t                    5  t        dt	               g      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        dd      5  t        t        d      5  t        dt               g      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        d      5  t        t        d            5  t        dt        d      g      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        dd      5  t        t        t        t        t              5  t        dt        dt               t	               g      g      # 1 sw Y   nxY wd d d        y # 1 sw Y   y xY w)Nz''TypeError' is not of type 'ValueError'aaJ  Raised exception group did not match: 
The following expected exceptions did not find a match:
  RaisesGroup(ValueError)
  RaisesGroup(ValueError, match='a')
The following raised exceptions did not find a match
  ExceptionGroup('', [RuntimeError()]):
    RaisesGroup(ValueError): 'RuntimeError' is not of type 'ValueError'
    RaisesGroup(ValueError, match='a'): Regex pattern 'a' did not match '' of 'ExceptionGroup'
  RuntimeError():
    RaisesGroup(ValueError): 'RuntimeError' is not an exception group
    RaisesGroup(ValueError, match='a'): 'RuntimeError' is not an exception groupFr2   r   r   a  Raised exception group did not match: 
2 matched exceptions. 
The following expected exceptions did not find a match:
  RaisesGroup(RuntimeError)
  RaisesGroup(ValueError)
The following raised exceptions did not find a match
  RuntimeError():
    RaisesGroup(RuntimeError): 'RuntimeError' is not an exception group, but would match with `allow_unwrapped=True`
    RaisesGroup(ValueError): 'RuntimeError' is not an exception group
  ValueError('bar'):
    It matches 'ValueError' which was paired with ValueError('foo')
    RaisesGroup(RuntimeError): 'ValueError' is not an exception group
    RaisesGroup(ValueError): 'ValueError' is not an exception group, but would match with `allow_unwrapped=True`r%   r&   z@1 matched exception. 'AssertionError' is not of type 'TypeError'z<Matcher(ValueError): 'TypeError' is not of type 'ValueError'zRaised exception group did not match: Regex pattern 'h(ell)o' did not match 'h(ell)o' of 'ExceptionGroup'
  Did you mean to `re.escape()` the regex?zh(ell)oztMatcher(match='h(ell)o'): Regex pattern 'h(ell)o' did not match 'h(ell)o'
  Did you mean to `re.escape()` the regex?a  Raised exception group did not match: 
The following expected exceptions did not find a match:
  'ValueError'
  'ValueError'
  'ValueError'
  'ValueError'
The following raised exceptions did not find a match
  ExceptionGroup('', [ValueError(), TypeError()]):
    Unexpected nested 'ExceptionGroup', expected 'ValueError'
    Unexpected nested 'ExceptionGroup', expected 'ValueError'
    Unexpected nested 'ExceptionGroup', expected 'ValueError'
    Unexpected nested 'ExceptionGroup', expected 'ValueError')r#   r   r'   r   r(   r*   r   r   r+   r   r   test_assert_messagerg     s(   
 	DE1J1 S9;-00	1 1 1 1 1 	
_ 	

 	K
+[3-OP
" B 01<>B
 	
#
 
 
 
 
. 	 !	

& 	I%
#		
'
4 ^Y[*U*;Z=NO
 	
5
 
 
 
 
@ 	N	
D 	J	*	D S:<1A"BCCD D D D D 	J	
1 	GJ'(	1 S9;-001 1 1 1 1 	9	
8 	Ji08 Y778 8 8 8 8 	9	
:
 	G),-: R*Y"7!899: : : : : 	L 	
T  	J
J
C!T$ R.jlIK5P"Q!RSS%T T T T Ts   A2;	AA )C	*B33B<	8CC!:E#3EE	E##E,:GF..F7	3GGH3H		H	HH'7I4	II(	$I44I=K!J88K	=KK&M*L//L8	4MMc                    t        dd      5  t        t        t        t              t              5  t        dt        dt	               t               g      t	               g      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        dd      5  t        t        t        t                    5  t        dt        dt	               t               g      g      # 1 sw Y   nxY wd d d        y # 1 sw Y   y xY w)Na  Raised exception group did not match: 
The following expected exceptions did not find a match:
  RaisesGroup(ValueError, ValueError)
  'ValueError'
The following raised exceptions did not find a match
  ExceptionGroup('', [TypeError(), RuntimeError()]):
    RaisesGroup(ValueError, ValueError): 
      The following expected exceptions did not find a match:
        'ValueError'
        'ValueError'
      The following raised exceptions did not find a match
        TypeError():
          'TypeError' is not of type 'ValueError'
          'TypeError' is not of type 'ValueError'
        RuntimeError():
          'RuntimeError' is not of type 'ValueError'
          'RuntimeError' is not of type 'ValueError'
    Unexpected nested 'ExceptionGroup', expected 'ValueError'
  TypeError():
    RaisesGroup(ValueError, ValueError): 'TypeError' is not an exception group
    'TypeError' is not of type 'ValueError'Fr2   r   a  Raised exception group did not match: 
RaisesGroup(ValueError, ValueError): 
  The following expected exceptions did not find a match:
    'ValueError'
    'ValueError'
  The following raised exceptions did not find a match
    TypeError():
      'TypeError' is not of type 'ValueError'
      'TypeError' is not of type 'ValueError'
    RuntimeError():
      'RuntimeError' is not of type 'ValueError'
      'RuntimeError' is not of type 'ValueError')r#   r   r'   r   r(   r*   r+   r   r   test_message_indentri   k  s    :. 1	
&
6 	
J/	
7&
@ rIK#@A
 	
A&
 &
 &
 &
 &
P 	? 	

  	
J/	
!
( rIK#@A
 	
)
 
 
 
 
s:   #A93A$$A-	)A99BC/0*CC#	C//C8c                    t        d      5  t        t        t              t              5  t        dt        dt        dt               g      g      g      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        d      5  t        t        t        t              t              5  t        dt        dt               t        dt               g      g      g      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        d      5  t        t        t        d      t              5  t        dt        dt	               g      g      # 1 sw Y   nxY wd d d        y # 1 sw Y   y xY w)Na  
The following expected exceptions did not find a match:
  RaisesGroup(ValueError)
  'ValueError'
The following raised exceptions did not find a match
  ExceptionGroup('', [ExceptionGroup('', [ValueError()])]):
    RaisesGroup(ValueError): Unexpected nested 'ExceptionGroup', expected 'ValueError'
      Did you mean to use `flatten_subgroups=True`?
    Unexpected nested 'ExceptionGroup', expected 'ValueError'r   a  
The following expected exceptions did not find a match:
  RaisesGroup(ValueError, ValueError)
  'ValueError'
The following raised exceptions did not find a match
  ExceptionGroup('', [ValueError(), ExceptionGroup('', [ValueError()])]):
    RaisesGroup(ValueError, ValueError): 
      1 matched exception. 
      The following expected exceptions did not find a match:
        'ValueError'
          It matches ValueError() which was paired with 'ValueError'
      The following raised exceptions did not find a match
        ExceptionGroup('', [ValueError()]):
          Unexpected nested 'ExceptionGroup', expected 'ValueError'
      Did you mean to use `flatten_subgroups=True`?
    Unexpected nested 'ExceptionGroup', expected 'ValueError'a  
The following expected exceptions did not find a match:
  RaisesGroup(Exception, match='^hello')
  'ValueError'
The following raised exceptions did not find a match
  ExceptionGroup('^hello', [Exception()]):
    RaisesGroup(Exception, match='^hello'): Regex pattern '^hello' did not match '^hello' of 'ExceptionGroup'
      Did you mean to `re.escape()` the regex?
    Unexpected nested 'ExceptionGroup', expected 'ValueError'z^hellor   )r#   r   r'   r   	Exceptionr+   r   r   )test_suggestion_on_nested_and_brief_errorrl     sZ    	L
	

 	K
+Z8
 BZ\N!C DEF
 	

 
 
 
 
( 	L	

& 	K
J7D'
* B~b:<./Q RST
 	
+
 
 
 
 
8 	L
	
L 	K	:JGL R.IK="I!JKKL L L L LsX   A+,AA	A++A4#C/%5CC#	C//C8 E&!EE	EE%c                    t        dd      5  t        t        t              t        t        t                    t        t        t        d            t        t        t                    5  t        dt	        d      t        dt	        d	      g      t        dt	        d
      t	        d      g      g      # 1 sw Y   nxY wd d d        y # 1 sw Y   y xY w)Na  Raised exception group did not match: 
The following expected exceptions did not find a match:
  RaisesGroup(ValueError)
  RaisesGroup(RaisesGroup(ValueError))
  RaisesGroup(Matcher(TypeError, match='foo'))
  RaisesGroup(TypeError, ValueError)
The following raised exceptions did not find a match
  TypeError('aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'):
    RaisesGroup(ValueError): 'TypeError' is not an exception group
    RaisesGroup(RaisesGroup(ValueError)): 'TypeError' is not an exception group
    RaisesGroup(Matcher(TypeError, match='foo')): 'TypeError' is not an exception group
    RaisesGroup(TypeError, ValueError): 'TypeError' is not an exception group
  ExceptionGroup('Exceptions from Trio nursery', [TypeError('bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb')]):
    RaisesGroup(ValueError): 'TypeError' is not of type 'ValueError'
    RaisesGroup(RaisesGroup(ValueError)): RaisesGroup(ValueError): 'TypeError' is not an exception group
    RaisesGroup(Matcher(TypeError, match='foo')): Matcher(TypeError, match='foo'): Regex pattern 'foo' did not match 'bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb'
    RaisesGroup(TypeError, ValueError): 1 matched exception. Too few exceptions raised, found no match for: ['ValueError']
  ExceptionGroup('Exceptions from Trio nursery', [TypeError('cccccccccccccccccccccccccccccccccccccccc'), TypeError('dddddddddddddddddddddddddddddddddddddddd')]):
    RaisesGroup(ValueError): 
      The following expected exceptions did not find a match:
        'ValueError'
      The following raised exceptions did not find a match
        TypeError('cccccccccccccccccccccccccccccccccccccccc'):
          'TypeError' is not of type 'ValueError'
        TypeError('dddddddddddddddddddddddddddddddddddddddd'):
          'TypeError' is not of type 'ValueError'
    RaisesGroup(RaisesGroup(ValueError)): 
      The following expected exceptions did not find a match:
        RaisesGroup(ValueError)
      The following raised exceptions did not find a match
        TypeError('cccccccccccccccccccccccccccccccccccccccc'):
          RaisesGroup(ValueError): 'TypeError' is not an exception group
        TypeError('dddddddddddddddddddddddddddddddddddddddd'):
          RaisesGroup(ValueError): 'TypeError' is not an exception group
    RaisesGroup(Matcher(TypeError, match='foo')): 
      The following expected exceptions did not find a match:
        Matcher(TypeError, match='foo')
      The following raised exceptions did not find a match
        TypeError('cccccccccccccccccccccccccccccccccccccccc'):
          Matcher(TypeError, match='foo'): Regex pattern 'foo' did not match 'cccccccccccccccccccccccccccccccccccccccc'
        TypeError('dddddddddddddddddddddddddddddddddddddddd'):
          Matcher(TypeError, match='foo'): Regex pattern 'foo' did not match 'dddddddddddddddddddddddddddddddddddddddd'
    RaisesGroup(TypeError, ValueError): 
      1 matched exception. 
      The following expected exceptions did not find a match:
        'ValueError'
      The following raised exceptions did not find a match
        TypeError('dddddddddddddddddddddddddddddddddddddddd'):
          It matches 'TypeError' which was paired with TypeError('cccccccccccccccccccccccccccccccccccccccc')
          'TypeError' is not of type 'ValueError'Fr2   r%   r   r   (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaazExceptions from Trio nursery(bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb(cccccccccccccccccccccccccccccccccccccccc(dddddddddddddddddddddddddddddddddddddddd)r#   r   r'   r   r(   r   r+   r   r   test_assert_message_nestedrr     s     	1@d g4	
M
l 	
#J/0	78	:.		
mM
z DE2IJK 2!"LM!"LM
 	
{M
 M
 M
 M
 M
s   AC
*AB55B>	:C

C
hypothesisz-hypothesis may have monkeypatched _check_repr)reasonc            	         t        j                  t        d      5  t        t	        d       t
              5  t        dt        d      t        d      g      # 1 sw Y   nxY wd d d        y # 1 sw Y   y xY w)Na`  ^Raised exception group did not match: \nThe following expected exceptions did not find a match:\n  Matcher\(check=<function test_check_no_patched_repr.<locals>.<lambda> at .*>\)\n  'TypeError'\nThe following raised exceptions did not find a match\n  ValueError\('foo'\):\n    Matcher\(check=<function test_check_no_patched_repr.<locals>.<lambda> at .*>\): check did not return True\n    'ValueError' is not of type 'TypeError'\n  ValueError\('bar'\):\n    Matcher\(check=<function test_check_no_patched_repr.<locals>.<lambda> at .*>\): check did not return True\n    'ValueError' is not of type 'TypeError'$r   c                     y)NFr+   )xs    r   r8   z,test_check_no_patched_repr.<locals>.<lambda>]  s    r   r9   r   r%   r&   )r   r   r   r   r   r(   r   r'   r+   r   r   test_check_no_patched_reprrx   C  st     	
@	
I" 	G/2I>#I& R*U"3Z5F!GHH'I I I I Is   A.!AA"	A..A7c                    t        d      5  t        t        t        t        t        t        d            5  t	        dt        d      t        d      t        d      t        d      g      # 1 sw Y   nxY wd d d        y # 1 sw Y   y xY w)Naz  
3 matched exceptions. 
The following expected exceptions did not find a match:
  Matcher(ValueError, match='foo')
    It matches ValueError('foo') which was paired with 'ValueError'
    It matches ValueError('foo') which was paired with 'ValueError'
    It matches ValueError('foo') which was paired with 'ValueError'
The following raised exceptions did not find a match
  ValueError('bar'):
    It matches 'ValueError' which was paired with ValueError('foo')
    It matches 'ValueError' which was paired with ValueError('foo')
    It matches 'ValueError' which was paired with ValueError('foo')
    Matcher(ValueError, match='foo'): Regex pattern 'foo' did not match 'bar'
There exist a possible match when attempting an exhaustive check, but RaisesGroup uses a greedy algorithm. Please make your expected exceptions more stringent with `Matcher` etc so the greedy algorithm can function.r%   r   r   r&   )r#   r   r'   r   r   r+   r   r   test_misordering_examplerz   b  s    f	

" 	
J
%0P	
#
* 5!5!5!5!	
 	
+
 
 
 
 
s   *B 5A++A4	0B  B	c                 B   t        d      5  t        t        t              5  t	        dt               t               g      # 1 sw Y   nxY wddd       n# 1 sw Y   nxY wt        d      5  t        t        t              5  t	        dt               t               g      # 1 sw Y   nxY wddd       n# 1 sw Y   nxY wt        d      5  t        t        t              5  t	        dt               t               g      # 1 sw Y   nxY wddd       y# 1 sw Y   yxY w)zif only one raised and one expected fail to match up, we print a full table iff
    the raised exception would match one of the expected that previously got matchedz>1 matched exception. 'TypeError' is not of type 'RuntimeError'r   Na  
1 matched exception. 
The following expected exceptions did not find a match:
  'RuntimeError'
The following raised exceptions did not find a match
  TypeError():
    It matches 'Exception' which was paired with ValueError()
    'TypeError' is not of type 'RuntimeError'a  
1 matched exception. 
The following expected exceptions did not find a match:
  'ValueError'
    It matches ValueError() which was paired with 'ValueError'
The following raised exceptions did not find a match
  TypeError():
    'TypeError' is not of type 'ValueError')r#   r   r'   r*   r   r(   rk   r+   r   r   test_brief_error_on_one_failr|     s   
 	L	
> 	J-	> R*,	!<==> > > > > 	<		
> 	I|,> R*,	!<==> > > > >" 	:		
> 	J
+> R*,	!<==> > > > >sX   AA  A		AA,B5B  B)	%B55B>D!D  D		DDc            
        t        d      5  t        t        t        t        t              5  t	        dt               t               t               t               g      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        d      } t        d      }t        d      5  t        |||      5  t	        d| | | g      # 1 sw Y   nxY wd d d        y # 1 sw Y   y xY w)Nz?3 matched exceptions. 'RuntimeError' is not of type 'TypeError'r   r%   r&   r   aC  
The following expected exceptions did not find a match:
  Matcher(match='bar')
  Matcher(match='bar')
  Matcher(match='bar')
The following raised exceptions did not find a match
  ValueError('foo'):
    Matcher(match='bar'): Regex pattern 'bar' did not match 'foo'
    Matcher(match='bar'): Regex pattern 'bar' did not match 'foo'
    Matcher(match='bar'): Regex pattern 'bar' did not match 'foo'
  ValueError('foo'):
    Matcher(match='bar'): Regex pattern 'bar' did not match 'foo'
    Matcher(match='bar'): Regex pattern 'bar' did not match 'foo'
    Matcher(match='bar'): Regex pattern 'bar' did not match 'foo'
  ValueError('foo'):
    Matcher(match='bar'): Regex pattern 'bar' did not match 'foo'
    Matcher(match='bar'): Regex pattern 'bar' did not match 'foo'
    Matcher(match='bar'): Regex pattern 'bar' did not match 'foo')r#   r   r'   r(   r   r*   r   )rD   ms     r   test_identity_oopsiesr     s     	M	

 	J
J	B	
 z|Z\<>J
 	

 
 
 
 
 	5AeAP	
,* 	Aq!+,. R!Q++/, , , , ,s:   A11AA%	!A11A:C-B==C	CCc            	     f   t        j                  t        d      5  t                d d d        t        j                  t        dt	        j
                  t        t                     d      5  t        t               d d d        t        t        t                    5  t        dt               f      # 1 sw Y   xY w# 1 sw Y   CxY w# 1 sw Y   nxY wt        d      5  t        t        t                    5  t        dt               f      # 1 sw Y   nxY wd d d        y # 1 sw Y   y xY w)Nz6^You must specify at least one parameter to match on.$r   z^exception_type z% must be a subclass of BaseException$r   z;Matcher(TypeError): 'ValueError' is not of type 'TypeError')r   r   r'   r   r   r   reprrU   r   r   r#   r(   r+   r   r   test_matcherr     s    	G
  			
 
 4<!8 99^_
  		 
WZ(	) 2R*,11 
 2 2 	I	
2 	GI&'	2 R*,112 2 2 2 2sA   B4.C C4B= C	C#D'<DD	D''D0c                    t        t        t        d            5  t        dt        d      f      # 1 sw Y   nxY wt	        d      5  t        t        t        d            5  t        dt        d      f      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        t        d            5  t        dt        d      f      # 1 sw Y   nxY wt	        d      5  t        t        d            5  t        dt        d      f      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt        t        t        d            5  t        dt        d      g      # 1 sw Y   nxY wt	        d      5  t        t        t        d            5  t        dt        d	      g      # 1 sw Y   nxY wd d d        y # 1 sw Y   y xY w)
Nr%   r   zIMatcher(ValueError, match='foo'): Regex pattern 'foo' did not match 'bar'r&   r   z=Matcher(match='foo'): Regex pattern 'foo' did not match 'bar'rG   zNMatcher(ValueError, match='^bar$'): Regex pattern '^bar$' did not match 'barr'barr)r   r   r'   r   r#   r+   r   r   test_matcher_matchr     s   	WZ/	0 7R*U"3!5667 7 	W	
7 	GJ./	7 R*U"3!5667 7 7 7 7 
W5)	* 7R*U"3!5667 7 	K	
7 	G%()	7 R*U"3!5667 7 7 7 7 
WZw7	8 6R*U"3!4556 6 	\	
7 	GJg67	7 R*V"4!5667 7 7 7 7sz   1:B"A99B	>BB/CCD3D

D	DD(EE%3F:F%%F.	*F::Gc                    dd} t        t        |             5  t        dt        dd      f      # 1 sw Y   nxY wdd}t        t        t        |            5  t        dt        dd      f      # 1 sw Y   nxY wt	        d|d      5  t        t        t        |            5  t        dt        dd      f      # 1 sw Y   nxY wd d d        n# 1 sw Y   nxY wt	        d	|d
|d      5  t        t        t        t        |                  5  t        dt        dt        dd      g      g      # 1 sw Y   nxY wd d d        y # 1 sw Y   y xY w)Nc                D    t        | t              xr | j                  dk(  S N   )rB   OSErrorerrnorC   s    r   check_oserror_and_errno_is_5z8test_Matcher_check.<locals>.check_oserror_and_errno_is_5  s    !W%6!''Q,6r   r9   r   r   c                     | j                   dk(  S r   )r   rC   s    r   check_errno_is_5z,test_Matcher_check.<locals>.check_errno_is_5  s    ww!|r   zMatcher(OSError, check=z): check did not return True   z#RaisesGroup(Matcher(OSError, check=z)): Matcher(OSError, check=)rD   BaseExceptionrN   rO   )rD   r   rN   rO   )r   r   r   r   r#   )r   r   s     r   test_Matcher_checkr     sp   7 
W#?@	A 4R'!R.!2334 4 
WW,<=	> 4R'!R.!2334 4
 	%&6%99UV	
4 	GG+;<=	4 R'!R.!2334 4 4 4 4 	12B1EE`aq`t  uQ  R	
I 	K7G HIJ	I R.gan5E"F!GHHI I I I IsP   2;A44A=C*CC	CC 5$E#D<<E	EEc                    t        t        t                    dk(  sJ t        t        d            dk(  sJ t        j                  dd      } t        t        |             dk(  sJ t        j                  dt        j
                        }t        t        |            d|d	k(  sJ t        t        t        d
t                    dt        d	k(  sJ y )NzMatcher(ValueError)[a-z]r   zMatcher(match='[a-z]')noflagr   zMatcher(match='noflag')zMatcher(match=)r   r   r:   z&Matcher(ValueError, match='re', check=)rb   r   r'   r   compile
IGNORECASErO   )pattern_no_flagspattern_flagss     r   test_matcher_tostringr   6  s    wz"#'<<<wW%&*BBBzz)Q/w-./3LLLJJy"--8Mw]+,.@QQR0SSSGJd$783D81=	>	>r   c                     dd}  | d        | d        | d        | d        | d       t        t        t        dt                    d	t        d
k(  sJ y )Nc                ^    t        |       }| t        |      cxk(  rt        |      k(  sJ  J y rA   )evalrb   r   )r   evaleds     r   check_str_and_reprz5test_raisesgroup_tostring.<locals>.check_str_and_reprD  s,    aCK/4</////r   zRaisesGroup(ValueError)z$RaisesGroup(RaisesGroup(ValueError))z RaisesGroup(Matcher(ValueError))z-RaisesGroup(ValueError, allow_unwrapped=True)z%RaisesGroup(ValueError, match='aoeu')r   r   z-RaisesGroup(ValueError, match='[a-z]', check=r   )r   rb   rN   rc   )rb   r   r'   rO   )r   s    r   test_raisesgroup_tostringr   C  sf    0 01=>9:FG>? 	K
'>?:4(!D	E	Er   c                   | j                  t        j                  j                  dt        j                  j                  j                         t        j                  j                  t              5 }t        dt        d      f      # 1 sw Y   nxY wj                  t        u sJ |j                  j                  d   j                  dk(  sJ t        |j                  t              sJ y )NExceptionInfor   hellor   )r   )setattrtriotesting_raises_group_ExceptionInfor   r'   r   typerV   r6   argsrB   tbr   )monkeypatchexcinfos     r   test__ExceptionInfor   T  s    """"11
 
	!	!*	- 9R*W"5!7889 9<<>))==##A&++z99gjj-000s   1BB)r   rb   rN   rb   )T)r    rb   r!   rO   rN   zRaisesContext[AssertionError])rN   rc   )r   zpytest.MonkeyPatchrN   rc   )1
__future__r   r   systypesr   typingr   r   r   trio.testingr   r   trio.testing._raises_groupr   version_infoexceptiongroupr   r   _pytest.python_apir   r   r#   r,   r.   r<   rE   rI   rQ   rY   r[   rd   rg   ri   rl   rr   markskipifmodulesrx   rz   r|   r   r   r   r   r   r   r   r+   r   r   <module>r      s#   " 	 
      - 4gA0$
 "&J	JJ"J)
X;@|xVvM`(9V2"G>;8vsTlA
H>LBP
f CKK:  I	I6
B*>Z(,V2.7DID
"
1r   