
    +g                       S SK Jr  S SKrS SKrS SKJr  S SKJr  S SKrS SK	r	S SK
JrJr  S SKJr  \R                  S:  a  S SKJrJr  \(       a  S S	KJr  S&S
 jr S'     S(S jjrS)S jrS)S jrS)S jrS)S jrS)S jrS)S jrS)S jrS)S jrS)S jrS)S jr S)S jr!S)S jr"S)S jr#\RH                  RK                  S\RL                  ;   SS9S)S j5       r'S)S jr(S)S jr)S)S jr*S)S  jr+S)S! jr,S)S" jr-S)S# jr.S)S$ jr/S*S% jr0g)+    )annotationsN)TracebackType)TYPE_CHECKING)MatcherRaisesGroup)repr_callable)      )BaseExceptionGroupExceptionGroup)RaisesContextc                :    S[         R                  " U 5      -   S-   $ )N^$)reescape)ss    l/Users/Alptekin/Desktop/izin_takip/venv/lib/python3.13/site-packages/trio/_tests/test_testing_raisesgroup.pywrap_escaper      s    1##    c                    U S   S:w  d   S5       eU(       a  SOSn[         R                  " [        [        X -   5      S9$ )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#      sC     	B4FEF9C5F=={6</HIIr   c                 x   [         R                  " [        [        S[	        5       < S35      S9   [        [	        5       5        S S S 5        [        [        5         [        S[        5       45      e! , (       d  f       N3= f! , (       d  f       O= f[        S5         [        [        5         [        S[        5       45      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        [        [        5         [        S[        5       [        5       45      e! , (       d  f       O= f[        [        [        5         [        S[        5       [        5       45      e! , (       d  f       O= f[        [        [        5      5         [        S[        S[        5       45      45      e! , (       d  f       O= f[        [        [        [        5      [        [        5      5         [        S[        5       [        S[        5       45      [        S[        5       45      45      e! , (       d  f       g = f)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	 UZ\O44
 
 
!	  	FGJU[]$455 	  	HGG 
Z	-UZ\;=$ABB 
.	- 
[*	-UZ\;=$ABB 
.	- 
[,	-U^EJL?%K$MNN 
.	- 
JL!

 uz|o6rLN#45
 	

 
se   A1B1
A?
BC.C
C	C
C-D##
D1E''
E5!F11
F?->H++
H9c                    [        S5         [        [        5         [        S[	        5       [        5       45      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        S5         [        [        [
        5         [        S[        5       45      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        S5         [        [        [        5         [        S[        5       45      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        S5         [        [        5         [        S[        5       [        5       45      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        S5         [        [        [        5         [        S[        5       [        5       /5      e! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f)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   ss    	L	
 	JR,.*,!?@@ 	 	
 	
 	
 	a	
 	J,R*,11 	-,,	
 	
 	
 	M	
 	J
+R*,11 	,++	
 	
 	
 	M	
 	JR*,
!=>> 	 	
 	
 	
 	<		
 	J
+R*,!>?? 	,++		
 		
 		
s   A;
A		A
A$2B8B
B+	'B88
CD)C??
D		D
D(6F E%%
E3	/F  
FG+1G
G	G++
G9c                 (
   [        [        SS9   [        S[        S[        5       45      45      e! , (       d  f       O= f[        [        [        SS9   [        S[        S[        5       [        5       45      45      e! , (       d  f       O= f[        [        [        SS9   [        S[        S[        5       /5      [        5       /5      e! , (       d  f       O= f[        [        [        SS95         [        S[        S[        5       45      45      e! , (       d  f       O= f[        [        [        SS95         [        S[        S[        S[        5       45      45      45      e! , (       d  f       O= f[        R
                  " [        SS9   [        [        [        5      SS9  S S S 5        O! , (       d  f       O= f[        S5         [        [        SS9   [        e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        S5         [        [        [        SS95         [        S[        5       45      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        SS	S
9   [        [        [        5         [        S[        S[        5       [        5       /5      /5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        SS	S
9   [        [        [        S S9   [        S[        S[        5       [        5       /5      /5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        SS	S
9   [        [        5         [        S[        S[        5       /5      /5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        S5         [        [        5         [        S[        S[        5       /5      /5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        S5         [        [        [        5      5         [        S[        S[        S[        5       /5      /5      /5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        S5         [        [        5         [        S[        S[        5       /5      /5      e! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f)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    [        U R                  5      S:H  $ )N   )len
exceptions)egs    r   <lambda>(test_flatten_subgroups.<locals>.<lambda>   s    S/14r   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R.jl_"E!GHH 
9	8 
Zd	CR.jlIK5P"Q!STT 
D	C	Zd	CR.jl^"Dik!RSS 
D	C 
[tD	ER.jl_"E!GHH 
F	E	[tD	EBZ\O!D FGI
 	
 
F	E 
Q
 	K
+tD	
 
 
 	a	
 	J$7 	877	
 	
 	
 	 S	
 	K
dCDR*,11 	EDD	
 	
 	
 	< 	
 	J	*R.jlIK5P"Q!RSS 	+**	
 	
 	
" 	< 	
 	4	
 R.jlIK5P"Q!RSS	
 	
 	
	
 	
 	
, 	>	

 	JR.jl^"D!EFF 	 	
 	
 	
 	VWJR.ik]"C!DEE 	  	XWW 	>	
 	K
+,BZ\N!C DEF
 	
 	-,,		
 	
 	
 	QRN# &8>O>Q=R&S%TUU 	$## 	SRRs4  !0
>*A>>
B"*C
C4!D
D#=,E))
E7F44
GHG&&
G4	0H
HI&5I
I	I&&
I4K*K  
K	
K
K)6M*L55
M	?M
M+N7;!N
N*	&N77
OP#!P
P	P
P-;R,R  
R	
R
R)7T!S((
S6	2T
Tc            
        [        [        SS9   [        e! , (       d  f       O= f[        R                  " [        SS9   [        [        [        SS9  S S S 5        O! , (       d  f       O= f[        [        S S9SS9   [        e! , (       d  f       O= f[        R                  " [        SS9   [        [        [        5      SS9  S S S 5        O! , (       d  f       O= f[        [        [        SS95         [        S[        S[        5       /5      /5      e! , (       d  f       O= f[        [        [        SS95         [        S[        5       /5      e! , (       d  f       O= f[        S	5         [        [        5         [        S
5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        S5         [        [        SS9   [        S[        S[        5       /5      /5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        [        SSS9   [        S[        S[        5       /5      /5      e! , (       d  f       O= f[        SSS9   [        [        SS9   [        S5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        SSS9   [        [        [        5      SS9   [        e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        S5         [        [        [        5      5         [        e! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f)NTallow_unwrappedz,^You cannot specify multiple exceptions withr   c                .    [        U [        [        45      $ N)
isinstancer)   r'   es    r   r8   1test_catch_unwrapped_exceptions.<locals>.<lambda>  s    
1{J.G Hr   r:   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_exceptionsrG     s    
Z	6 
7	6 
=
 	KTB	
 
 
 
HI
 	
 
 
z)G	HK
+TB 
I	H	H
 
[TB	CR.jl^"D!EFF 
D	C	[TB	CR*,00 
D	C
 	a	
 	J+,, 	 	
 	
 	
 	>	
 	J5U^EJL>%J$KLL 	655		
 	
 	
 
Z	NR.jl^"D!EFF 
O	N
 	]	
 	J5HII 	655		
 	
 	
 	r	
 	GJ'> 	?>>		
 	
 	
 	CDK
+, 	-,, 	EDDs   
$ A
A+ B
B1C
C :!D
D)E
E'5F,F
F	F,,
F:H!G88
H	H
H!3!I
I"/J%>J


J	J%%
J3 K:K
K-	)K::
LM/L66
M	 M
Mc                 h   [        [        SS9   [        S[        5       45      e! , (       d  f       O= f[        [        SS9   [        S[        5       45      e! , (       d  f       O= f[        [        SS9   [        S[        5       45      n U R                  S5        U e! , (       d  f       O= f[        [        SS9   [        S[        5       45      n U R                  S5        U e! , (       d  f       O= f[	        S5         [        [        SS9   [        S[        5       45      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[	        S5         [        [        SS9   [        S[        S5      /5      e! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f)	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#   rD   s    r   
test_matchrK   X  sL   	Zu	-UZ\O44 
.	- 
Zw	/UZ\O44 
0	/ 
Zy	15:</2	

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

9 
9	8 	I	
 	Je,UZ\O44 	-,,	
 	
 	
 	 o	
 	Je,UZ%6$788 	-,,	
 	
 	
sh   %
3A
A(9)B""
B0)C**
C8ED++
D9	5E
E"F#1F
F	F##
F1c                 X  ^ [        S[        5       45      mSU4S jjn [        U 5      n[        [        U S9   Te! , (       d  f       O= f[	        SU S35         [        [        U S9   [        S[        5       45      e! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f)Nr   c                   > U TL $ rB   r+   )rE   excs    r   is_exctest_check.<locals>.is_exc  s    Cxr   r:   zcheck z did not return True)rE   zExceptionGroup[ValueError]returnbool)r   r'   r   r   r#   )rO   is_exc_reprrN   s     @r   
test_checkrT     s    
jl_
-C  'K	Zv	.	 
/	. 	VK=0DEFJf-R*,11 	.-- 	GFFs'   ;
A	B*B  
B	
B
B)c                 0   SS jn Sn[         R                  " [        [        R                  " U5      S9   [        [        SSS9  S S S 5        [         R                  " [        [        R                  " U5      S9   [        [        SU S9  S S S 5        [        [        [        SS9SS	9nU   [        S5      e! , (       d  f       Nw= f! , (       d  f       NC= f! , (       d  f       O= fU   [        S
[        S5      /5      e! , (       d  f       O= f[        [        SS	9 n[        S[        S5      /5      e! , (       d  f       O= f[        WR                  [        5      (       a/  [        [        SS9R                  UR                  5      (       d   eg g )Nc                    g)NTr+   rD   s    r   my_check,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&   )rE   objectrQ   rR   )r   r   r'   r   r   r   r   r   rC   valuematches)rW   r    rgrN   s       r   test_unwrapped_match_checkr]     s!   	C  
z3	8JEB 
9	z3	8JHE 
9 
WZw7	NB	 
9	8	8	8
 
	R*U"3!455 
 
Z	6#UZ%6$788 
7	6#))^,,:U3;;CIIFFFF -s;   B6:C*C6
C
C
C&+D
D!D88
Ec                     [        [        5      n U R                  S 5      (       a   eU R                  [        5       5      (       a   eU R                  [        S[        5       45      5      (       d   eg )Nr   )r   r'   r[   r   )r\   s    r   test_RaisesGroup_matchesr_     sX    	Z	 Bzz$zz*,''''::nR*,9::::r   c            	     .         SS jn U " S[        [        5      5        U " S[        [        [        5      5        U " S[        [        [        5      5      5        U " S[        [        [        S5      5      5        U " S[        [        SS95      5        U " S	[        [        5      5        U " S
[        [        [        5      5      5        U " S[        [        [        5      5      5        U " S[        [        [        5      [        [        5      5      5        g )Nc                    [         R                  " [        S[        R                  " U 5       S3S9   U    S S S 5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f)Nz'^DID NOT RAISE any exception, expected r   r   )r   r   r   r   r   )messagebodys     r   check_message#test_message.<locals>.check_message  sT    
 MM?		'@R?SSTU  	  D	 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)))rb   strrc   zRaisesGroup[BaseException]rQ   None)r   r'   r   r<   )rd   s    r   test_messageri     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                 &   [        S5         [        [        5         [        S[	        5       /5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        SSS9   [        [        [        5      [        [        SS95         [        S[        S[        5       /5      [        5       /5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        SSS9   [        [        [        [        5      [        [
        5      [        [        5      5         [        S[        5       [	        5       [        S	5      [        S
5      /5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        S5         [        [        [        5         [        S[        5       [        5       /5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        S5         [        [        [        5      5         [        S[	        5       /5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        SSS9   [        [        SS9   [        S[        5       /5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        S5         [        [        SS95         [        S[        S5      /5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        SSS9   [        [        [        [        [        5         [        S[        S[        5       [	        5       /5      /5      e! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f)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_messagerl     s   
 	DEJS9;-00 	  	FEE
 	
_ 	
 	K
+[3-OPB 01<>B
 	
 	QPP	
 	
 	
, 	 !	
$ 	I%
#		
 ^Y[*U*;Z=NO
 	
	
 	
 	
%	
 	
 	
> 	N	
 	J	*S:<1A"BCC 	+**	
 	
 	
 	J	
 	GJ'(S9;-00 	)((	
 	
 	
 	9	

 	Ji0Y77 	100	
 	
 	
 	9	
 	G),-R*Y"7!899 	.--		
 	
 	
 	L 	
 	J
J
CR.jlIK5P"Q!RSS 	DCC	
 	
 	
s   A2
A 	A
A(&C*B88
C	C
C!.:E6(3E
E)	%E66
FG!'G
G	G!!
G/=IH,,
H:	6I
I"J"1J
J	J""
J0>LK((
K6	2L
LN=*M''
M5	1N
Nc                    [        SSS9   [        [        [        [        5      [        5         [        S[        S[	        5       [        5       /5      [	        5       /5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        SSS9   [        [        [        [        5      5         [        S[        S[	        5       [        5       /5      /5      e! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f)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_indentrn   k  s    :. 1	
4 	
J/	

 rIK#@A
 	
	
 	
 	
5	
 	
 	
N 	? 	
 	
J/	
 rIK#@A
 	
		
 	
 	
	
 	
 	
s:   #A<3A!!
A/	+A<<
B
C:5*C
C-	)C::
Dc                    [        S5         [        [        [        5      [        5         [        S[        S[        S[        5       /5      /5      /5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        S5         [        [        [        [        5      [        5         [        S[        S[        5       [        S[        5       /5      /5      /5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        S5         [        [        [        SS9[        5         [        S[        S[	        5       /5      /5      e! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f)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_errorrq     s4    	L
	
 	K
+Z8BZ\N!C DEF
 	
 	988
	
 
	
 
	
& 	L	
$ 	K
J7DB~b:<./Q RST
 	
 	EDD%	
 	
 	
6 	L
	
 	K	:JGR.IK="I!JKK 	HGG
	
 
	
 
	
sX   A1,A
A$	 A11
A?#D 05C%%
C3	/D  
DE59!E
E(	$E55
Fc                    [        SSS9   [        [        [        5      [        [        [        5      5      [        [        [        SS95      [        [        [        5      5         [        S[	        S5      [        S[	        S	5      /5      [        S[	        S
5      [	        S5      /5      /5      e! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f)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_nestedrw     s     	1@d g4	
j 	
#J/0	78	:.		
 DE2IJK 2!"LM!"LM
 	
	
 	
 	
k4	
 4	
 4	
s   AC
$AB//
B=	9C


C
hypothesisz-hypothesis may have monkeypatched _check_repr)reasonc            	         [         R                  " [        SS9   [        [	        S S9[
        5         [        S[        S5      [        S5      /5      e! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f)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                    g)NFr+   )xs    r   r8   ,test_check_no_patched_repr.<locals>.<lambda>]  s    Er   r:   r   r%   r&   )r   r   r   r   r   r(   r   r'   r+   r   r   test_check_no_patched_reprr~   C  sb     	
@	
  	G/2I>R*U"3Z5F!GHH 	?>>!	
 	
 	
s   A/!A
A"	A//
A=c                 (   [        S5         [        [        [        [        [        [        SS95         [	        S[        S5      [        S5      [        S5      [        S5      /5      e! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f)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_exampler   b  s    f	
  	
J
%0P	
 5!5!5!5!	
 	
		
 	
 	
!	
 	
 	
s   'B5A((
A6	2B
Bc                    [        S5         [        [        [        5         [	        S[        5       [        5       /5      e! , (       d  f       O= f SSS5        O! , (       d  f       O= f[        S5         [        [        [        5         [	        S[        5       [        5       /5      e! , (       d  f       O= f SSS5        O! , (       d  f       O= f[        S5         [        [        [        5         [	        S[        5       [        5       /5      e! , (       d  f       O= f SSS5        g! , (       d  f       g= f)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(   rp   r+   r   r   test_brief_error_on_one_failr     s    
 	L	
 	J-R*,	!<== 	.--	
 	
 	
 	<		
 	I|,R*,	!<== 	-,,		
 		
 		
  	:		
 	J
+R*,	!<== 	,++		
 		
 		
sX   AA  
A	
A
A)7CB++
B9	5C
C"D17D
D$	 D11
D?c            
        [        S5         [        [        [        [        [        5         [	        S[        5       [        5       [        5       [        5       /5      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        S5      n [        SS9n[        S5         [        XU5         [	        SX U /5      e! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f)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   )rE   ms     r   test_identity_oopsiesr     s     	M	
 	J
J	Bz|Z\<>J
 	
 	CBB	
 	
 	
 	5AeAP	
( 	A!R!++ 	)	
 	
 	
s:   A71A
A*	&A77
B'C4C
C	C
C,c            	        [         R                  " [        SS9   [        5         S S S 5        [         R                  " [        S[        R
                  " [        [        5      5       S3S9   [        [        5        S S S 5        [        [        [        5      5         [        S[        5       45      e! , (       d  f       N= f! , (       d  f       NM= f! , (       d  f       O= f[        S5         [        [        [        5      5         [        S[        5       45      e! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f)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   reprrY   r   r   r#   r(   r+   r   r   test_matcherr     s    	G
 			

 
 4<!8 99^_
 		
 
WZ(	)R*,11
 


 
 
*	) 	I	
 	GI&'R*,11 	(''	
 	
 	
sA   B1+CC1
B?
C
C!/D9D
D,	(D99
Ec                    [        [        [        S5      5         [        S[        S5      45      e! , (       d  f       O= f[	        S5         [        [        [        S5      5         [        S[        S5      45      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        [        SS95         [        S[        S5      45      e! , (       d  f       O= f[	        S5         [        [        SS95         [        S[        S5      45      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[        [        [        SS95         [        S[        S5      /5      e! , (       d  f       O= f[	        S5         [        [        [        SS95         [        S[        S	5      /5      e! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f)
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'rI   zNMatcher(ValueError, match='^bar$'): Regex pattern '^bar$' did not match 'barr'barr)r   r   r'   r   r#   r+   r   r   test_matcher_matchr     sv   	WZ/	0R*U"3!566 
1	0 	W	
 	GJ./R*U"3!566 	0//	
 	
 	
 
W5)	*R*U"3!566 
+	* 	K	
 	G%()R*U"3!566 	*))	
 	
 	
 
WZw7	8R*U"3!455 
9	8 	\	
 	GJg67R*V"4!566 	877	
 	
 	
sz   1
?B'A>>
B	B
B'<C
C!/D4D
D'	#D44
EE33
FG'F>>
G	G
G'c                    SS jn [        [        U S95         [        S[        SS5      45      e! , (       d  f       O= fSS jn[        [        [        US95         [        S[        SS5      45      e! , (       d  f       O= f[	        SU< S35         [        [        [        US95         [        S[        SS5      45      e! , (       d  f       O= f S S S 5        O! , (       d  f       O= f[	        S	U< S
U< S35         [        [        [        [        US95      5         [        S[        S[        SS5      /5      /5      e! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f)Nc                N    [        U [        5      =(       a    U R                  S:H  $ N   )rC   OSErrorerrnorD   s    r   check_oserror_and_errno_is_58test_Matcher_check.<locals>.check_oserror_and_errno_is_5  s    !W%6!''Q,6r   r:   r   r   c                     U R                   S:H  $ r   )r   rD   s    r   check_errno_is_5,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=)rE   BaseExceptionrQ   rR   )rE   r   rQ   rR   )r   r   r   r   r#   )r   r   s     r   test_Matcher_checkr     sG   7 
W#?@	AR'!R.!233 
B	A 
WW,<=	>R'!R.!233 
?	>
 	%&6%99UV	
 	GG+;<=R'!R.!233 	>==	
 	
 	
 	12B1EE`aq`t  uQ  R	
 	K7G HIJR.gan5E"F!GHH 	KJJ	
 	
 	
sP   0
>A55
BC!.C
C	C!!
C/!E%'#E


E	E%%
E3c                    [        [        [        5      5      S:X  d   e[        [        SS95      S:X  d   e[        R                  " SS5      n [        [        U S95      S:X  d   e[        R                  " S[        R
                  5      n[        [        US95      SU< S	3:X  d   e[        [        [        S
[        S95      S[        < S	3:X  d   eg )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=)rg   r   r'   r   compile
IGNORECASErR   )pattern_no_flagspattern_flagss     r   test_matcher_tostringr   6  s    wz"#'<<<<wW%&*BBBBzz)Q/w-./3LLLLJJy"--8Mw]+,.@QQR0SSSSGJd$783D81=	>	>r   c                     SS jn U " S5        U " S5        U " S5        U " S5        U " S5        [        [        [        S[        S95      S	[        < S
3:X  d   eg )Nc                b    [        U 5      nU [        U5      s=:X  a  [        U5      :X  d   e   eg rB   )evalrg   r   )r   evaleds     r   check_str_and_repr5test_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   rg   rQ   rh   )rg   r   r'   rR   )r   s    r   test_raisesgroup_tostringr   C  sf    0 01=>9:FG>? 	K
'>?:4(!D	E	Er   c                   U R                  [        R                  R                  S[        R                  R                  R                  5        [        R                  R                  [        5       n[        S[        S5      45      e! , (       d  f       O= fWR                  [        L d   eUR                  R                  S   R                  S:X  d   e[        UR                  [        5      (       d   eg )NExceptionInfor   hellor   )r   )setattrtriotesting_raises_group_ExceptionInfor   r'   r   typerZ   r6   argsrC   tbr   )monkeypatchexcinfos     r   test__ExceptionInfor   T  s    """"11
 
	!	!*	-R*W"5!788 
.	-<<>)))==##A&++z999gjj-0000s   1B
B)r   rg   rQ   rg   )T)r    rg   r!   rR   rQ   zRaisesContext[AssertionError])rQ   rh   )r   zpytest.MonkeyPatchrQ   rh   )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=   rG   rK   rT   r]   r_   ri   rl   rn   rq   rw   markskipifmodulesr~   r   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   