+
    Bi             
          ^ RI Ht ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t	^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIt^ RIHtHtHtHtHtHtHt ^ RIHtHt ^ RIHtHtH t  ^ RI!H"t" ^ R	IH#t#H$t$ ^ RI%t%^ RI&t&^ RI't'^ R
I(H)t) ^ RI*H+t+ ^ RI,t,]-R8X  d   ]- R2MRt.]! RRR.4      t/R ]/n0        ]! R. R[O4      t1]! R. R\O4      t2RRRRRR/t3],Ph                  PN                  Pk                  4        U Uu/ uF,  w  r]3Pm                  W ^ ,          Po                  4       4      VbK.  	  upp t8]+! ]94      Pt                  R,          t; ! R R]	Px                  4      t= ! R R4      t> ! R  R!4      t? ! R" R#]?4      t@]! 4        ! R$ R%4      4       tA ! R& R']	Px                  4      tB]! 4       ]$ ! R( R)]>]A]	Px                  4      4       4       tC]]! 4       ]$ ! R* R+]?]A]	Px                  4      4       4       4       tD]]! 4       ]$ ! R, R-]@]A]	Px                  4      4       4       4       tE ! R. R/4      tFR0tGR1tH]P                  ! R2]P                  ! ]G4      : R3]P                  ! ]H4      : R424      tK]$ ! R5 R6]	Px                  ]F4      4       tL]]$ ! R7 R8]	Px                  ]F4      4       4       tM ! R9 R:4      tN]$ ! R; R<]N]	Px                  4      4       tO]$ ! R= R>]N]	Px                  4      4       tP ! R? R@]	Px                  4      tQ ! RA RB]	Px                  4      tR ! RC RD]	Px                  4      tS ! RE RF]	Px                  4      tT ! RG RH4      tU ! RI RJ]V4      tW ! RK RL]X4      tY ! RM RN]	Px                  4      tZ ! RO RP]	Px                  4      t[Rt\ ! RQ RR4      t] ! RS RT]>]]]	Px                  4      t^] ! RU RV]?]]]	Px                  4      4       t_ ! RW RX]	Px                  4      t` ! RY RZ]	Px                  4      ta]-R8X  d   ]	P                  ! 4        R# R# u upp i )]    )
namedtuple)StringION)support)Errorcaptured_outputcpython_only	ALWAYS_EQrequires_debug_rangeshas_no_debug_rangesrequires_subprocess)TESTFNunlink)assert_python_okassert_python_failuremake_script)forget)force_not_colorizedforce_not_colorized_test_class)partial)Path__main__. codeco_filenameco_namec                     \        R.4      # )   )r   r   r   r   )iter)_s   &*/usr/lib/python3.14/test/test_traceback.py<lambda>r"   $   s    4#7    frametbresetzfilenamefnerror_highlightEzlevenshtein_examples.jsonc                   J  a a ] tR t^2t oV 3R ltV 3R ltR tR tR tR t	R t
R tR	 tR
 tR tR t]R 4       tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R t#]$! 4       ]R  4       4       t%R! t&R" t'R# t(R$ t)R% t*R& t+R' t,R( t-R)t.Vt/V ;t0# )*TracebackCasesc                d   < \         SV `  4        \        P                  V n        R \        n        R# )FN)supersetUp	_colorizeCOLORIZEcolorizeself	__class__s   &r!   r0   TracebackCases.setUp5   s!    !**"	r#   c                N   < \         SV `  4        V P                  \        n        R # N)r/   tearDownr3   r1   r2   r4   s   &r!   r:   TracebackCases.tearDown:   s    !]]	r#   c                |     V! 4        \        R 4      h  T d!   p\        P                  ! Y#4      u Rp?# Rp?ii ; i)zcall did not raise exceptionN)
ValueError	tracebackformat_exception_only)r5   funcexcvalues   &&& r!   get_exception_format#TracebackCases.get_exception_format>   s=    	=F ;<<  	?223>>	?s    ;6;;c                     \        R RR4       R# )zdef fact(x):
	return x!
?execNcompiler5   s   &r!   syntax_error_with_caret&TracebackCases.syntax_error_with_caretF   s    -sF;r#   c                     \        R RR4       R# )z1 +
rF   rG   NrH   rJ   s   &r!   syntax_error_with_caret_2(TracebackCases.syntax_error_with_caret_2I   s    f%r#   c                     \        R RR4       R# )zf(x, y for y in range(30), z)rF   rG   NrH   rJ   s   &r!   syntax_error_with_caret_range,TracebackCases.syntax_error_with_caret_rangeL   s    /f=r#   c                     \        R RR4       R# )z def spam():
  print(1)
 print(2)rF   rG   NrH   rJ   s   &r!   syntax_error_bad_indentation+TracebackCases.syntax_error_bad_indentationO   s    4c6Br#   c                     \        R RR4       R# )u   Python = "Ṕýţĥòñ" +rF   rG   NrH   rJ   s   &r!   !syntax_error_with_caret_non_ascii0TracebackCases.syntax_error_with_caret_non_asciiR   s    =sFKr#   c                     \        R RR4       R# )z	 print(2)rF   rG   NrH   rJ   s   &r!   syntax_error_bad_indentation2,TracebackCases.syntax_error_bad_indentation2U   s    S&)r#   c                     \        R RR4       R# )z
blech  (  rF   rG   NrH   rJ   s   &r!    tokenizer_error_with_caret_range/TracebackCases.tokenizer_error_with_caret_rangeX   s    c6*r#   c                .   V P                  V P                  \        4      pV P                  \	        V4      ^4       V P                  V^,          P                  4       R4       V P                  RV^,          4       V P                  V^,          P                  R4      V^,          P                  R4      4       V P                  V^,          P                  R4      ^4       V P                  V P                  \        4      pV P                  RV^,          4       V P                  V^,          P                  R4      ^4       V P                  V^,          P                  R4      ^,           V^,          P                  R4      4       V P                  V^,          P                  R4      ^4       V P                  V P                  \        4      pV P                  RV^,          4       V P                  V^,          P                  R4      ^4       V P                  V^,          P                  R4      ^,           V^,          P                  R4      4       V P                  V^,          P                  R4      ^4       V P                  V P                  \        4      pV P                  RV^,          4       V P                  V^,          P                  R4      ^4       V P                  V^,          P                  R4      V^,          P                  R4      4       V P                  V^,          P                  R4      \	        R4      4       V P                  V P                  \        4      pV P                  RV^,          4       V P                  V^,          P                  R4      ^4       V P                  V^,          P                  R4      V^,          P                  R4      4       V P                  V^,          P                  R4      ^4       R	# )
   z	return x!^!
+yzy for y in range(30)(N)rC   rK   SyntaxErrorassertEquallenstripassertInfindcountrN   rW   rQ   r]   r5   errs   & r!   
test_caretTracebackCases.test_caret[   s   ''(D(D(35S1%Q5c3q6"QS)3q6;;s+;<Qc*A.''(F(F(35c3q6"Qd+Q/QS)A-s1v{{3/?@Qc*A.''(N(N(35c3q6"Qd+Q/QS)A-s1v{{3/?@Qc*A.''(J(J(35c3q6"Qd+Q/QS)3q6;;s+;<Qc*C0F,GH''(M(M(35c3q6"Qd+Q/QS)3q6;;s+;<Qc*A.r#   c                    \        R R4      p\        P                  ! \         V4      pV P                  \	        V4      ^4       V P                  V^,          P                  4       R4       R# )errorN
bad syntaxzx.py   Nrt   )rg   r>   r?   rh   ri   rj   r5   rA   ro   s   &  r!   test_nocaretTracebackCases.test_nocaret   sO    '#CD--k3?S1%Q6r#   c                    \        \        R 4      ;_uu_ 4       pVP                  R4       RRR4       \        RR\        4      w   r#VP	                  4       pV P                  \        V4      ^4       V P                  V^ ,          R4       V P                  RV^,          4       V P                  V^,          R4       V P                  V^,          R4       \        \        4       R#   + '       g   i     L; i  \        \        4       i ; i)	wz
x = 1 / 0
N-Xno_debug_ranges"   Traceback (most recent call last):s   line 1, in <module>       x = 1 / 0#   ZeroDivisionError: division by zero)	openr   writer   
splitlinesrh   ri   rk   r   )r5   fr    stderrliness   &    r!   'test_no_caret_with_no_debug_ranges_flag6TracebackCases.test_no_caret_with_no_debug_ranges_flag   s    	fc""a& # 1'1LAq %%'ESZ+U1X'LMMM0%(;U1X'78U1X'MN6N #" 6Ns"   C; C(B+C; (C8	3C; ;Dc                J   \         P                  ! R 4      p \        \        R4      ;_uu_ 4       pVP	                  V4       RRR4       \        RR\        4      w   r4VP                  4       pV P                  \        V4      ^4       V P                  V^ ,          R4       V P                  RV^,          4       V P                  V^,          R4       V P                  V^,          R4       \        \        4       R#   + '       g   i     L; i  \        \        4       i ; i)	z
            import traceback
            try:
                x = 1 / 0
            except ZeroDivisionError:
                traceback.print_exc()
            r{   Nr|   r}   r~   s   line 4, in <module>r   r   )textwrapdedentr   r   r   r   r   rh   ri   rk   r   )r5   r   r   r    r   r   s   &     r!   8test_no_caret_with_no_debug_ranges_flag_python_tracebackGTracebackCases.test_no_caret_with_no_debug_ranges_flag_python_traceback   s       	fc""a # ,'1LAq %%'ESZ+U1X'LMMM0%(;U1X'78U1X'MN6N #" 6Ns#   D C>B+D >D		D D"c                N   \         P                  ! R 4      p \        \        R4      ;_uu_ 4       pVP	                  V4       RRR4       \        \        4      w  p pV P                  V^ 4       \        \        4       R#   + '       g   i     LF; i  \        \        4       i ; i)a>  
                import sys
                from weakref import ref

                sys.setrecursionlimit(15)

                def f():
                    ref(lambda: 0, [])
                    f()

                try:
                    f()
                except RecursionError:
                    pass
        r{   N)r   r   r   r   r   r   rh   r   )r5   r   r   rcr    s   &    r!   %test_recursion_error_during_traceback4TracebackCases.test_recursion_error_during_traceback   su       	fc""a # (/HB1R#6N #" 6Ns"   B B -B  B	B B$c                J   V P                  V P                  \        4      pV P                  \	        V4      ^4       V P                  V^,          P                  4       R4       V P                  RV^,          4       V P                  V^,          P                  R4      ^,           V^,          P                  R4      4       V P                  V P                  \        4      pV P                  \	        V4      ^4       V P                  V^,          P                  4       R4       R# )r`   zprint(2)ra   )N)	rC   rT   IndentationErrorrh   ri   rj   rk   rl   rZ   rn   s   & r!   test_bad_indentation#TracebackCases.test_bad_indentation   s    ''(I(I(8:S1%Q4c3q6"QS)A-s1v{{3/?@ ''(J(J(8:S1%Q4r#   c                    \        4       p\        P                  ! VP                  V4      pV P	                  VR .4       R# )zKeyboardInterrupt
N)KeyboardInterruptr>   r?   r6   rh   )r5   elsts   &  r!   test_base_exception"TracebackCases.test_base_exception   s4    --akk1=456r#   c                `    ! R  R\         4      p\        P                  ! W! 4       4      pV P                  \	        V4      ^4       RpVP
                  R9   d   VP                  pM'RP                  VP
                  VP                  .4      pV P                  V^ ,          V: RV: R24       R# )c                   &   a  ] tR t^t o R tRtV tR# )?TracebackCases.test_format_exception_only_bad__str__.<locals>.Xc                    ^^ ,           R#    N rJ   s   &r!   __str__GTracebackCases.test_format_exception_only_bad__str__.<locals>.X.__str__       !r#   r   N__name__
__module____qualname____firstlineno__r   __static_attributes____classdictcell____classdict__s   @r!   Xr            r#   r   <exception str() failed>r   : rc   N)r   builtins)	Exceptionr>   r?   rh   ri   r   r   joinr5   r   ro   	str_valuestr_names   &    r!   %test_format_exception_only_bad__str__4TracebackCases.test_format_exception_only_bad__str__   s    		 	 --a5S1%.	<<33~~Hxxq~~ >?HQx!CDr#   c                    \        R \        R4      .4      p\        P                  ! V4      pV P	                  VR.4       R# )AB$ExceptionGroup: A (1 sub-exception)
NExceptionGroupr=   r>   r?   rh   r5   egro   s   &  r!   .test_format_exception_group_without_show_group=TracebackCases.test_format_exception_group_without_show_group   s9    C*S/!23--b1FGHr#   c                    \        R \        R4      .4      p\        P                  ! VRR7      pV P	                  VRR.4       R# r   r   T
show_groupr      ValueError: B
Nr   r   s   &  r!   test_format_exception_group*TracebackCases.test_format_exception_group   sB    C*S/!23--bTB3 
 	r#   c                    \        R \        R4      .4      p\        P                  ! VRR7      pV P	                  VRR.4       R# )r   r   Tr   z(BaseExceptionGroup: A (1 sub-exception)
z   BaseException: B
N)BaseExceptionGroupBaseExceptionr>   r?   rh   r   s   &  r!    test_format_base_exception_group/TracebackCases.test_format_base_exception_group   sC    mC&8%9:--bTB7#
 	r#   c                    \        R 4      pVP                  R4       \        RV.4      p\        P                  ! VRR7      pV P                  V. RO4       R# )r   Noter   Tr   N)r   r   z   Note
)r=   add_noter   r>   r?   rh   r5   rA   r   ro   s   &   r!   %test_format_exception_group_with_note4TracebackCases.test_format_exception_group_with_note  sL    oVC#'--bTB 
 	r#   c                    \        R \        R4      .4      p\        P                  ! \         VRR7      pV P	                  VRR.4       R# r   r   r   s   &  r!   *test_format_exception_group_explicit_class9TracebackCases.test_format_exception_group_explicit_class  sD    C*S/!23--nbTR3 
 	r#   c                    \        R \        R4      \        R4      .4      p\        P                  ! VRR7      pV P                  V. RO4       R# )r   r   CTr   N)%ExceptionGroup: A (2 sub-exceptions)
r   z   TypeError: C
)r   r=   	TypeErrorr>   r?   rh   r   s   &  r!   /test_format_exception_group_multiple_exceptions>TracebackCases.test_format_exception_group_multiple_exceptions  sB    C*S/9S>!BC--bTB 
 	r#   c                    \        R \        R4      .4      p\        P                  ! VRR7      pV P	                  V. RO4       R# )A
1zB
2Tr   N)&ExceptionGroup: A
1 (1 sub-exception)
r      2
r   r   s   &  r!   .test_format_exception_group_multiline_messages=TracebackCases.test_format_exception_group_multiline_messages  s=    FZ%7$89--bTB 
 	r#   c                    \        R 4      pVP                  R4       \        RV\        R4      .4      p\        P
                  ! VRR7      pV P                  V. RO4       R# )zB

2
z
C

3zA

1
DTr   N)
z)ExceptionGroup: A

1
 (2 sub-exceptions)
r      
r   r   r   z   C
r   z   3
z   IndexError: D
)r=   r   r   
IndexErrorr>   r?   rh   r   s   &   r!   /test_format_exception_group_multiline2_messages>TracebackCases.test_format_exception_group_multiline2_messages&  sT    $Z Jjo(>?--bTB 
 	r#   c                    \        R R4      p\        RV.4      p\        P                  ! VRR7      pV P	                  V. RO4       R# )rs   Nr   Tr   ru   )r   z     File "x.py", line 23
z       bad syntax
z   SyntaxError: error
)rg   r   r>   r?   rh   r   s   &   r!   (test_format_exception_group_syntax_error7TracebackCases.test_format_exception_group_syntax_error8  sD    '#CDFSE*--bTB 
 	r#   c                   \        R 4      pVP                  R4       \        R\        R4      \        RV\	        R4      .4      \        R4      .4      p\        P                  ! VRR7      pV P                  V. R
O4       R	# )r   zNote
multiliner   r   r   r+   FTr   N)z%ExceptionGroup: A (3 sub-exceptions)
r   z(   ExceptionGroup: C (2 sub-exceptions)
z      IndexError: D
z      Note
z      multiline
z      LookupError: E
z   TypeError: F
)	r   r   r   r=   LookupErrorr   r>   r?   rh   r   s   &   r!   -test_format_exception_group_nested_with_notes<TracebackCases.test_format_exception_group_nested_with_notesC  st    o&'CsO3k#&6 78cN"
 
 --bTB 	
 		r#   c           	         R  pR p\        RV! 4       \        RV! 4       .4      .4      p\        P                  ! VRR7      pV P                  V. RO4       R# )c                  N     ^^ ,           R#   \          d   p T u Rp ? # Rp ? ii ; ir   ZeroDivisionErrorr   s    r!   r   ETracebackCases.test_format_exception_group_with_tracebacks.<locals>.fX  s%    A$ s   	 $$$c                  N     \        R 4      h  \          d   p T u Rp ? # Rp ? ii ; igNr   r   s    r!   r   ETracebackCases.test_format_exception_group_with_tracebacks.<locals>.g^  s&    n$ s    $$$r   r   Tr   N)r   z'   ZeroDivisionError: division by zero
z'   ExceptionGroup: B (1 sub-exception)
z      TypeError: g
r   r>   r?   rh   )r5   r   r   r   ro   s   &    r!   +test_format_exception_group_with_tracebacks:TracebackCases.test_format_exception_group_with_tracebacksW  s[    		 CC3&"
  --bTB 
 	r#   c                    R  p\        RV! 4       .4      p\        P                  ! VRR7      pV P                  VRR.4       R# )c                        ^^ ,           R#   \          d    \        ^ 4      hi ; i  \         d   p T u Rp ? # Rp ? ii ; ir   )r   r=   r   r   s    r!   r   @TracebackCases.test_format_exception_group_with_cause.<locals>.fq  sB    (EE( ($Q-'( s   	 %( ?:??r   Tr   r   z   ValueError: 0
Nr   )r5   r   r   ro   s   &   r!   &test_format_exception_group_with_cause5TracebackCases.test_format_exception_group_with_causep  sF    	 C!#'--bTB3 
 	r#   c                   \        R R4      \        R R.^,          4      \        R R	4      \        R R	4      \        R R
4      \        R R4      \        R R.^,          4      \        R R4      \        R R4      3	 F  pV P                  VR7      ;_uu_ 4        \        P                  ! VRR7      pVP                  eD   V P                  \        V4      ^4       V P                  V^ ,          P                  R4      4       MV P                  \        V4      ^4       V P                  VR,          R4       RRR4       K  	  R#   + '       g   i     K  ; i)rs   abcdNabcdefrA   Tr     FilezSyntaxError: error
)r         r`   )r   abr  )r   r  r  r`      r   )r   r  r  r  cd)	rg   subTestr>   r?   linenorh   ri   
assertTrue
startswithrw   s   &  r!   ;test_format_exception_group_syntax_error_with_custom_valuesJTracebackCases.test_format_exception_group_syntax_error_with_custom_values  s    ($!,..!12*$!,!34!;<
C #&&55cdK::)$$SXq1OOCF$5$5h$?@$$SXq1  R*@A '&
 '&&s   BD??Ec                   a aaa	 ^ RI o	^ RIoSP                  S	P                  RR.SP                  SP
                  R7      pVP                  4       w  r#\        VR4      P                  4       ^ ,          oVV VV	3R lpV! RRR^4       R Fd  pVR8X  d   RpMVR
8X  d   RpMRpV! RP                  V4      We^4       V! RP                  V4      We^4       V! RP                  V4      We^4       Kf  	  V! RRR	^4       R# )r   N-cz&import sys; print(sys.stdout.encoding)stdoutr   asciic                    <  \        \        R VR7      ;_uu_ 4       pVP                  RP                  W4      4       RRR4       SP	                  SP
                  \        .SP                  SP                  R7      pVP                  4       w  rgVP                  S4      P                  4       p\        \        4       VP                  SR4      pVP                  S4      p	RP                  V	4      p
RP                  V	4      pSP                  RV,          V^,          4       SP                  V^,          V
4       V^,          pSP                  W4       R#   + '       g   i     EL#; i  \        \        4       i ; i)	r{   )encodingz}{0}if 1:
                        import traceback;
                        raise RuntimeError('{1}')
                        Nr  backslashreplacezraise RuntimeError('{0}')zRuntimeError: {0}zline %s)r   r   r   formatPopen
executablePIPESTDOUTcommunicatedecoder   r   encoderk   assertEndsWithrh   )
firstlinesmessagecharsetr  outputprocessr  r   encoded_messagemessage_asciierr_lineerr_msgactual_err_msgoutput_encodingr5   
subprocesssyss   &&&&         r!   do_test1TracebackCases.test_encoded_file.<locals>.do_test  s;   &#88FLL " #F:79 9 %**CNNF+C%??:3D3D + F!(!4!4!67BBDv &nn_-?AO ,22?CM299-HH)00?GMM)f,fQi8q	84#AYN^53 988 vs"   E, !EA1E, E)	#	E, ,E=r   fooutf-8GBKu   丂儀u   hé hoz# coding: {0}
z#!shebang
# coding: {0}
z 	
# coding: {0}
zx=0
# coding: GBK
)r  z
iso-8859-1r<  r=  )
r8  r7  r$  r%  r&  r'  r(  strr   r#  )
r5   r0  r  r   r9  r.  textr6  r7  r8  s
   f      @@@r!   test_encoded_file TracebackCases.test_encoded_file  s    	
 ""CNND$L$N*4//*4*;*; # = !,,.fg.99;A>	6 	6< 	E7A&>G'!E!%!%,,W51&077@1&,33G<1& ? 	&
GQ?r#   c                    \         P                  ! R 4      p\        RV4      w  r#p. ROpV P                  VP	                  4       V4       R# )a  
            import sys
            import traceback

            class PrintExceptionAtExit(object):
                def __init__(self):
                    try:
                        x = 1 / 0
                    except Exception as e:
                        self.exc = e
                        # self.exc.__traceback__ contains frames:
                        # explicitly clear the reference to self in the current
                        # frame to break a reference cycle
                        self = None

                def __del__(self):
                    traceback.print_exception(self.exc)

            # Keep a reference in the module namespace to call the destructor
            # when the module is unloaded
            obj = PrintExceptionAtExit()
        r  N)r~   s&     File "<string>", line 8, in __init__r   s           ^^^^^r   )r   r   r   rh   r   )r5   r   r   r  r   expecteds   &     r!   test_print_traceback_at_exit+TracebackCases.test_print_traceback_at_exit  sL        , .dD9F<
 	**,h7r#   c                    \        4       p\        P                  ! \        \        R 4      RVR7       V P	                  VP                  4       R4       R# )	projectorNfileException: projector
r   r>   print_exceptionr   rh   getvaluer5   r/  s   & r!   test_print_exception#TracebackCases.test_print_exception  s?    !!y-t&	
 	*,DEr#   c                    \        4       p\        P                  ! \        R 4      VR7       V P	                  VP                  4       R4       R# )rG  rH  rJ  NrK  rN  s   & r!   test_print_exception_exc'TracebackCases.test_print_exception_exc  s6    !!)K"8vF*,DEr#   c                   \         P                  ! \        R \        ^*4      4      ;_uu_ 4        \	        4       p\
        P                  ! VR7       V P                  VP                  4       R4       RRR4       R#   + '       g   i     R# ; i)last_excrH  zValueError: 42
N)	r   	swap_attrr8  r=   r   r>   
print_lastrh   rM  rN  s   & r!   test_print_lastTracebackCases.test_print_last  sX    sJ
2??ZF  f-V__.0BC @???s   AA::B	c                   \        R 4      p\        P                  ! V4      pV P                  VR.4       V P	                  \
        R4      ;_uu_ 4        \        P                  ! VP                  V4       RRR4       V P	                  \
        R4      ;_uu_ 4        \        P                  ! VP                  VP                  R7       RRR4       V P	                  \        R4      ;_uu_ 4        \        P                  ! VR7       RRR4       R#   + '       g   i     L; i  + '       g   i     Lc; i  + '       g   i     R# ; i)rG  rJ  zBoth or neitherNr%   zrequired positional argumentr  )	r   r>   format_exceptionrh   assertRaisesRegexr=   r6   __traceback__r   )r5   r   r/  s   &  r!   test_format_exception_exc(TracebackCases.test_format_exception_exc  s    k"++A.":!;<##J0ABB&&q{{A6 C##J0ABB&&q{{qG C##I/MNN&&1- ON	 CBBBNNNs$   "D-D#.D6D 	#D3	6E	c                j    \         P                  ! \        R 4      4      pV P                  VR.4       R# )rG  rJ  N)r>   r?   r   rh   rN  s   & r!   test_format_exception_only_exc-TracebackCases.test_format_exception_only_exc  s+    00;1GH":!;<r#   c                $   R p\        4       p\        P                  ! RVR7       V P                  VP	                  4       V4       \        4       p\        P                  ! RRRVR7       V P                  VP	                  4       V4       \        4       p\        P
                  ! RVR7       V P                  VP	                  4       V4       V P                  \        P                  ! R4      V4       V P                  \        P                  ! R4      V.4       V P                  \        P                  ! RRR4      V.4       V P                  \        P                  ! R4      V.4       V P                  \        P                  ! RR4      V.4       R# )zNoneType: None
NrH  )	r   r>   rL  rh   rM  	print_exc
format_excr\  r?   )r5   NONE_EXC_STRINGexcfiles   &  r!   test_exception_is_None%TracebackCases.test_exception_is_None  s@   ,*!!$W5))+_=*!!$dA))+_=*Dw/))+_=--d3_E33D9O;LM&&tT48?:K	M++D1O3D	F++D$7/9J	Lr#   c                t   V P                  \        \        P                  ! \        P
                  4      4      R 4       V P                  \        \        P                  ! \        P                  4      4      R4       V P                  \        \        P                  ! \        P                  4      4      R4       R# )zV(exc, /, value=<implicit>, tb=<implicit>, limit=None, file=None, chain=True, **kwargs)zK(exc, /, value=<implicit>, tb=<implicit>, limit=None, chain=True, **kwargs)z9(exc, /, value=<implicit>, *, show_group=False, **kwargs)N)rh   r>  inspect	signaturer>   rL  r\  r?   rJ   s   &r!   test_signaturesTracebackCases.test_signatures3  s    !!)";";<=<	>
 	!!)"<"<=>%	'
 	!!)"A"ABCG	Ir#   r3   )1r   r   r   r   r0   r:   rC   rK   rN   rQ   rT   rW   rZ   r]   rp   rx   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r   r@  rD  rO  rR  rX  r_  rb  ri  rn  r   r   __classcell__r6   r   s   @@r!   r-   r-   2   s    #
+=<&>CL*+#/J7  &0257EI
	$	(2"B0 =@  =@~8BFF
D	.=L.I Ir#   r-   c                   d   a  ] tR tRt o RR lt]P
                  P                  ^,           tRtV t	R# )"PurePythonExceptionFormattingMixiniC  c                     V! 4        V P                  R 4       R#   \         d)    \        P                  ! 4       P	                  4       Y# u # i ; i)No exception thrown.N)failr   r>   rf  r   )r5   callableslice_start	slice_ends   &&&&r!   get_exception0PurePythonExceptionFormattingMixin.get_exceptionD  sK    	.J II,-  	N'')446{MM	Ns    0AAr   Nr   r  )
r   r   r   r   r{  __code__co_firstlinenocallable_liner   r   r   s   @r!   rt  rt  C  s"     . "**99A=Mr#   rt  c                   h   a  ] tR tRt o ^ tRR lt]P                  P                  ^,           tRt	V t
R# )CAPIExceptionFormattingMixiniO  c                8   ^ RI Hp  V! 4        V P                  R4       R#   \         dm   p\	        R4      ;_uu_ 4       pT! YPP
                  4       RRR4       M  + '       g   i     M; iXP                  4       P                  4       Y# u Rp?# Rp?ii ; i)r   exception_printrv  r   N)	_testcapir  rw  r   r   LEGACYrM  r   )r5   rx  ry  rz  r  r   tbstderrs   &&&&   r!   r{  *CAPIExceptionFormattingMixin.get_exceptionR  st    -	KJII,- 	K **h;;/ +***$$&113KJJ	Ks2   " BB A	BA,''BBBr   Nr}  )r   r   r   r   r  r{  r~  r  r  r   r   r   s   @r!   r  r  O  s(     FK "**99A=Mr#   r  c                       ] tR tRt^tRtR# )"CAPIExceptionFormattingLegacyMixini^  r   N)r   r   r   r   r  r   r   r#   r!   r  r  ^  s    Fr#   r  c                   "  a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R  t"R! t#R" t$R# t%R$ t&R% t'R& t(R' t)R( t*R) t+R* t,R+ t-R, t.R-t/V t0R.# )/#TracebackErrorLocationCaretTestBaseia  c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                      \        R4      h)Tzbasic caret testsr=   r   r#   r!   r   ?TracebackErrorLocationCaretTestBase.test_basic_caret.<locals>.fi  s    %&9::r#   +Traceback (most recent call last):
  File "", line 9, in get_exception
    callable()
    ~~~~~~~~^^
  File "zm, in f
    if True: raise ValueError("basic caret tests")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nr~  r  __file__r  r{  rh   r   )r5   r   lineno_f
expected_fresult_liness   &    r!   test_basic_caret4TracebackErrorLocationCaretTestBase.test_basic_caretf  s    	; ::,,j););(< =  j! 5C	C 	 ))!,'<'<'>?r#   c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                      \        R4      h)Tu   Ĥellö Wörldr  r   r#   r!   f_with_unicodeRTracebackErrorLocationCaretTestBase.test_line_with_unicode.<locals>.f_with_unicode|  s    %&677r#   r  r  r  uq   , in f_with_unicode
    if True: raise ValueError("Ĥellö Wörld")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Nr  )r5   r  r  r  r  s   &    r!   test_line_with_unicode:TracebackErrorLocationCaretTestBase.test_line_with_unicodey  s    	8 "**99j););(< =  j! 5=	= 	 )).9'<'<'>?r#   c                
   R  pVP                   P                  pR\         RV P                   R\         RV^,            R\         RV^,            R2pV P	                  V4      pV P                  WCP                  4       4       R# )c                  *    R  R lp V P                    R# )c                0    V ^8  d   QhR\         R\        /# )r  r  return)THIS_DOES_NOT_EXISTint)r#  s   "r!   __annotate__lTracebackErrorLocationCaretTestBase.test_caret_in_type_annotation.<locals>.f_with_type.<locals>.__annotate__  s      *  r#   c                     ^ # )r   r   r  s   &r!   r;  cTracebackErrorLocationCaretTestBase.test_caret_in_type_annotation.<locals>.f_with_type.<locals>.foo  s    r#   N)__annotations__r;  s    r!   f_with_typeVTracebackErrorLocationCaretTestBase.test_caret_in_type_annotation.<locals>.f_with_type  s    r#   r  r  r  z1, in f_with_type
    foo.__annotations__
  File "zb, in __annotate__
    def foo(a: THIS_DOES_NOT_EXIST ) -> int:
               ^^^^^^^^^^^^^^^^^^^
Nr  )r5   r  r  r  r  s   &    r!   test_caret_in_type_annotationATracebackErrorLocationCaretTestBase.test_caret_in_type_annotation  s    	 
 ''66j););(< =  j! 5j! 533 	 ))+6'<'<'>?r#   c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                      \        R4      h)Tzerror over multiple linesr  r   r#   r!   f_with_multiline]TracebackErrorLocationCaretTestBase.test_caret_multiline_expression.<locals>.f_with_multiline  s    %+ r#   r  r  r  z, in f_with_multiline
    if True: raise ValueError(
             ^^^^^^^^^^^^^^^^^
        "error over multiple lines"
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^Nr  r5   r  r  r  r  s   &    r!   test_caret_multiline_expressionCTracebackErrorLocationCaretTestBase.test_caret_multiline_expression  s    	
 $,,;;j););(< =  j! 5	
 	 ))*:;'<'<'>?r#   c           	     0  a \         P                  ! R 4      oV3R lpVP                  P                  pR\         RV P
                   R\         RV^,            R2	pV P                  V4      pV P                  WCP                  4       4       \         P                  ! R4      oV3R lpVP                  P                  pR\         RV P
                   R\         RV^,            R2	pV P                  V4      pV P                  WCP                  4       4       R	# )
z
        def foo(*args, **kwargs):
            pass

        a, b, c = 1, 2, 3

        foo(a, z
                for z in
                    range(10), b, c)
        c                     < \        S R R4      # rF   rG   rH   r   s   r!   r  jTracebackErrorLocationCaretTestBase.test_caret_multiline_expression_syntax_error.<locals>.f_with_multiline      4f--r#   r  r  r  zh, in f_with_multiline
    return compile(code, "?", "exec")
  File "?", line 7
    foo(a, z
           ^zX
        dummy_call(
            "dummy value"
            foo="bar",
        )
        c                     < \        S R R4      # r  rH   r  s   r!   r  r    r  r#   zr, in f_with_multiline
    return compile(code, "?", "exec")
  File "?", line 3
    "dummy value"
    ^^^^^^^^^^^^^N)	r   r   r~  r  r  r  r{  rh   r   )r5   r  r  r  r  r   s   &    @r!   ,test_caret_multiline_expression_syntax_errorPTracebackErrorLocationCaretTestBase.test_caret_multiline_expression_syntax_error  s)     	  		. $,,;;j););(< =  j! 5	 	 ))*:;'<'<'>?    	. $,,;;j););(< =  j! 5 	  	 ))*:;'<'<'>?r#   c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                  "    ^^^ ,          ,           # )r  r   r   r#   r!   r  dTracebackErrorLocationCaretTestBase.test_caret_multiline_expression_bin_op.<locals>.f_with_multiline  s    A r#   r  r  r  z9, in f_with_multiline
    2 + 1 /
        ~~^
    0
    ~Nr  r  s   &    r!   &test_caret_multiline_expression_bin_opJTracebackErrorLocationCaretTestBase.test_caret_multiline_expression_bin_op  s    	 $,,;;j););(< =  j! 5	 	 ))*:;'<'<'>?r#   c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                  4    ^p ^
V ^ ,          ,           ^,           #    r   divisors    r!   f_with_binary_operatorcTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators.<locals>.f_with_binary_operator  s    G!#b((r#   r  r  r  zY, in f_with_binary_operator
    return 10 + divisor / 0 + 30
                ~~~~~~~~^~~
Nr  r5   r  r  expected_errorr  s   &    r!   test_caret_for_binary_operatorsCTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators  s    	) *22AAj););(< =  j! 5,	, 	 ))*@A'@'@'BCr#   c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                  4    ^p ^
V ^ ,          ,           ^,           # r  r   )   áóís    r!   r  pTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators_with_unicode.<locals>.f_with_binary_operator%  s    F
?R''r#   r  r  r  uT   , in f_with_binary_operator
    return 10 + áóí / 0 + 30
                ~~~~^~~
Nr  r  s   &    r!   ,test_caret_for_binary_operators_with_unicodePTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators_with_unicode$  s    	( *22AAj););(< =  j! 5(	( 	 ))*@A'@'@'BCr#   c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                  4    ^p ^
V ^ ,          ,           ^,           # r  r   r  s    r!   r  lTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators_two_char.<locals>.f_with_binary_operator7  s    G1$r))r#   r  r  r  z[, in f_with_binary_operator
    return 10 + divisor // 0 + 30
                ~~~~~~~~^^~~
Nr  r  s   &    r!   (test_caret_for_binary_operators_two_charLTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators_two_char6  s    	* *22AAj););(< =  j! 5-	- 	 ))*@A'@'@'BCr#   c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                  *    ^p R;rW,           V,           # r   r   r   r  r  r  s      r!   r  TracebackErrorLocationCaretTestBase.test_caret_for_binary_operators_with_spaces_and_parenthesis.<locals>.f_with_binary_operatorI  s    AJA<!##r#   r  r  r  zP, in f_with_binary_operator
    return ( a   )   +b + c
           ~~~~~~~~~~^~
Nr  r  s   &    r!   ;test_caret_for_binary_operators_with_spaces_and_parenthesis_TracebackErrorLocationCaretTestBase.test_caret_for_binary_operators_with_spaces_and_parenthesisH  s    	$
 *22AAj););(< =  j! 5(	( 	 ))*@A'@'@'BCr#   c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                       ^p RpV V,           pV# r  r   r  r  r  s      r!   r  mTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators_multiline.<locals>.f_with_binary_operator\  s     AAA Hr#   r  r  r  zn, in f_with_binary_operator
       a = b    \
           ~~~~~~
    +\
    ^~
          c  # test
          ~
Nr  r  s   &    r!   )test_caret_for_binary_operators_multilineMTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators_multiline[  s    	 *22AAj););(< =  j! 5	
 	 ))*@A'@'@'BCr#   c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                       ^p RpV V,          pV# r  r   r  s      r!   r  vTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators_multiline_two_char.<locals>.f_with_binary_operatorv  s%    AA   Hr#   r  r  r  z, in f_with_binary_operator
        (b  # test +
        ~~~~~~~~~~~~
            )  \
            ~~~~
        # +
        ~~~
    << (c  # test
    ^^~~~~~~~~~~~
        \
        ~
    )  # test
    ~
Nr  r  s   &    r!   2test_caret_for_binary_operators_multiline_two_charVTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators_multiline_two_charu  s    	 *22AAj););(< =  j! 5	 	& ))*@A'@'@'BCr#   c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                      ^p RV ,           pV# )r   u
   ááááár   )r  r  s     r!   r  zTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators_multiline_with_unicode.<locals>.f_with_binary_operator  s    AAHr#   r  r  r  ug   , in f_with_binary_operator
    a = ("ááá" +
        ~~~~~~~~
        "áá") + b
        ~~~~~~^~~
Nr  r  s   &    r!   6test_caret_for_binary_operators_multiline_with_unicodeZTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators_multiline_with_unicode  s    	 *22AAj););(< =  j! 5"	" 	 ))*@A'@'@'BCr#   c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                  <    R RR//p V R ,          R,          R,          # xre   Nr'   r   	some_dicts    r!   f_with_subscriptVTracebackErrorLocationCaretTestBase.test_caret_for_subscript.<locals>.f_with_subscript  s$    sDk*IS>#&s++r#   r  r  r  z^, in f_with_subscript
    return some_dict['x']['y']['z']
           ~~~~~~~~~~~~~~~~~~~^^^^^
Nr  r5   r  r  r  r  s   &    r!   test_caret_for_subscript<TracebackErrorLocationCaretTestBase.test_caret_for_subscript  s    	, $,,;;j););(< =  j! 54	4 	 ))*:;'@'@'BCr#   c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                  R    R RRR^////p V R ,          R,          R,          R,          # )   ó   á   íthetabetar   r  s    r!   r  ^TracebackErrorLocationCaretTestBase.test_caret_for_subscript_unicode.<locals>.f_with_subscript  s3    tgq\&:;<IT?4(.v66r#   r  r  r  uq   , in f_with_subscript
    return some_dict['ó']['á']['í']['beta']
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
Nr  r  s   &    r!    test_caret_for_subscript_unicodeDTracebackErrorLocationCaretTestBase.test_caret_for_subscript_unicode  s    	7 $,,;;j););(< =  j! 5<	< 	 ))*:;'@'@'BCr#   c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                  *    . p ^;rW,          V,           # r   r   r  s      r!   r  xTracebackErrorLocationCaretTestBase.test_caret_for_subscript_with_spaces_and_parenthesis.<locals>.f_with_binary_operator  s    AIA?Q&&r#   r  r  r  zV, in f_with_binary_operator
    return b     [    a  ] + c
           ~~~~~~^^^^^^^^^
Nr  r  s   &    r!   4test_caret_for_subscript_with_spaces_and_parenthesisXTracebackErrorLocationCaretTestBase.test_caret_for_subscript_with_spaces_and_parenthesis  s    	'
 *22AAj););(< =  j! 5+	+ 	 ))*@A'@'@'BCr#   c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                  2    / p ^p^pV VV,           ,          pV# r  r   )bbbbbcccdddr  s       r!   r  `TracebackErrorLocationCaretTestBase.test_caret_for_subscript_multiline.<locals>.f_with_subscript  s-    ECCA Hr#   r  r  r  z, in f_with_subscript
    b = bbbbb \
        ~~~~~~~
        [  ccc # test
        ^^^^^^^^^^^^^
    
    
         + ddd  \
         ^^^^^^^^
    
    
        ] # test
        ^
Nr  r  s   &    r!   "test_caret_for_subscript_multilineFTracebackErrorLocationCaretTestBase.test_caret_for_subscript_multiline  s    
	 $,,;;j););(< =  j! 5	 	& ))*:;'@'@'BCr#   c                
   R  pVP                   P                  pR\         RV P                   R\         RV^,            R\         RV^,            R2pV P	                  V4      pV P                  WCP                  4       4       R# )c                  0    R  p V ! R4      ! R4      ! R4      # )c                     R  pV# )c                     \        R 4      hrw  RuntimeErrorr  s   &r!   f2dTracebackErrorLocationCaretTestBase.test_caret_for_call.<locals>.f_with_call.<locals>.f1.<locals>.f2      &v..r#   r   r  r!  s   & r!   f1XTracebackErrorLocationCaretTestBase.test_caret_for_call.<locals>.f_with_call.<locals>.f1      /	r#   r  re   r'   r   r%  s    r!   f_with_callLTracebackErrorLocationCaretTestBase.test_caret_for_call.<locals>.f_with_call  s     c73<$$r#   r  r  r  zN, in f_with_call
    return f1("x")("y")("z")
           ~~~~~~~^^^^^
  File "', in f2
    raise RuntimeError("fail")
Nr  r5   r)  r  r  r  s   &    r!   test_caret_for_call7TracebackErrorLocationCaretTestBase.test_caret_for_call  s    	% ''66j););(< =  j! 5  j! 5// 	 ))+6'@'@'BCr#   c                
   R  pVP                   P                  pR\         RV P                   R\         RV^,            R\         RV^,            R2pV P	                  V4      pV P                  WCP                  4       4       R# )c                  $    R  p V ! R4      ! R4      # )c                     R  pV# )c                     \        R 4      hr  r  r   s   &r!   r!  lTracebackErrorLocationCaretTestBase.test_caret_for_call_unicode.<locals>.f_with_call.<locals>.f1.<locals>.f2%  r#  r#   r   r$  s   & r!   r%  `TracebackErrorLocationCaretTestBase.test_caret_for_call_unicode.<locals>.f_with_call.<locals>.f1$  r'  r#   r  r  r   r(  s    r!   r)  TTracebackErrorLocationCaretTestBase.test_caret_for_call_unicode.<locals>.f_with_call#  s     d8D>!r#   r  r  r  uK   , in f_with_call
    return f1("ó")("á")
           ~~~~~~~^^^^^
  File "r+  Nr  r,  s   &    r!   test_caret_for_call_unicode?TracebackErrorLocationCaretTestBase.test_caret_for_call_unicode"  s    	" ''66j););(< =  j! 5  j! 5// 	 ))+6'@'@'BCr#   c                
   R  pVP                   P                  pR\         RV P                   R\         RV^,            R\         RV^,            R2pV P	                  V4      pV P                  WCP                  4       4       R# )c                  &    R  p V ! R4      ^,           # )c                     \        R 4      hr  r  r  s   &r!   r   ~TracebackErrorLocationCaretTestBase.test_caret_for_call_with_spaces_and_parenthesis.<locals>.f_with_binary_operator.<locals>.f;  s    "6**r#   r  r   r   s    r!   r  sTracebackErrorLocationCaretTestBase.test_caret_for_call_with_spaces_and_parenthesis.<locals>.f_with_binary_operator:  s    +c$q((r#   r  r  r  zb, in f_with_binary_operator
    return f     (    "x"  ) + 2
           ~~~~~~^^^^^^^^^^^
  File "&, in f
    raise RuntimeError("fail")
Nr  r  s   &    r!   /test_caret_for_call_with_spaces_and_parenthesisSTracebackErrorLocationCaretTestBase.test_caret_for_call_with_spaces_and_parenthesis9  s    	)
 *22AAj););(< =  j! 5  j! 5// 	 ))*@A'@'@'BCr#   c                
   R  pVP                   P                  pR\         RV P                   R\         RV^,            R\         RV^,            R2pV P	                  V4      pV P                  WCP                  4       4       R# )c                  n   a  ! R  R4      oV3R lp V ! ^4      P                  ^4      ! ^4      ! ^4      pV# )c                   &   a  ] tR tRt o R tRtV tR# )aTracebackErrorLocationCaretTestBase.test_caret_for_call_multiline.<locals>.f_with_call.<locals>.CiP  c                    R  pV# )c                     \        R 4      hr  r  r   s   &r!   r   nTracebackErrorLocationCaretTestBase.test_caret_for_call_multiline.<locals>.f_with_call.<locals>.C.y.<locals>.fR  s    *622r#   r   )r5   r  r   s   && r!   re   cTracebackErrorLocationCaretTestBase.test_caret_for_call_multiline.<locals>.f_with_call.<locals>.C.yQ  s    3Hr#   r   N)r   r   r   r   re   r   r   r   s   @r!   r   rD  P  s      r#   r   c                    < S! 4       # r9   r   )r  r   s   &r!   r   aTracebackErrorLocationCaretTestBase.test_caret_for_call_multiline.<locals>.f_with_call.<locals>.gU  s
    s
r#   )re   )r   r  r   s     @r!   r)  VTracebackErrorLocationCaretTestBase.test_caret_for_call_multiline.<locals>.f_with_callO  s>     
1A Hr#   r  r  r  zf, in f_with_call
    a = (g(1).y)(
        ~~~~~~~~~
        2
        ~
    )(3)(4)
    ~^^^
  File "r>  Nr  r,  s   &    r!   test_caret_for_call_multilineATracebackErrorLocationCaretTestBase.test_caret_for_call_multilineN  s    	 ''66j););(< =  j! 5  j! 5// 	 ))+6'@'@'BCr#   c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                      ^p V R,          p R# r   Naar   r  s    r!   r   >TracebackErrorLocationCaretTestBase.test_many_lines.<locals>.fp  s    AQr#   r  r  r  zW, in f
    if True: x += (
             ^^^^^^
    ...<2 lines>...
    )  # test
    ^
Nr  r5   r   r  r  r  s   &    r!   test_many_lines3TracebackErrorLocationCaretTestBase.test_many_lineso  s}    	 ::,,j););(< =  j! 5		 	 ))!,'@'@'BCr#   c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                      ^p V R,          p R# rP  r   rR  s    r!   r   GTracebackErrorLocationCaretTestBase.test_many_lines_no_caret.<locals>.f  s    AAr#   r  r  r  z,, in f
    x += (
    ...<2 lines>...
    )
Nr  rT  s   &    r!   test_many_lines_no_caret<TracebackErrorLocationCaretTestBase.test_many_lines_no_caret  s}    	 ::,,j););(< =  j! 5	 	 ))!,'@'@'BCr#   c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                  J    ^p RpV V ,           VV,           V,           ,           pV# )r   r  r   r  s      r!   r  ]TracebackErrorLocationCaretTestBase.test_many_lines_binary_op.<locals>.f_with_binary_operator  s:    AA 	A Hr#   r  r  r  z, in f_with_binary_operator
    a = (
        ~
        b +
        ~~~
        b
        ~
    ) + (
    ~~^~~
        c +
        ~~~
    ...<2 lines>...
    )
    ~
Nr  r  s   &    r!   test_many_lines_binary_op=TracebackErrorLocationCaretTestBase.test_many_lines_binary_op  s    	 *22AAj););(< =  j! 5	 	( ))*@A'@'@'BCr#   c           	        \        R \        R4      p\        \        R4      ;_uu_ 4       pVP                  R4       RRR4       V P	                  \
        \        4       \        \        V4      pV P                  V4      pVP                  pR\         RV P                   R\         RV R2	pV P                  WFP                  4       4       R#   + '       g   i     L; i)	z1 / 0 / 1 / 2
rG   r{   z1 $ 0 / 1 / 2
Nr  r  r  z*, in <module>
    1 $ 0 / 1 / 2
    ^^^^^
)rI   r   r   r   
addCleanupr   r   rG   r{  r  r  r  rh   r   )r5   bytecoderI  r@   r  r  r  s   &      r!   /test_traceback_specialization_with_syntax_errorSTracebackErrorLocationCaretTestBase.test_traceback_specialization_with_syntax_error  s    ,ff=&#$JJ()  	'tX&))$/**j););(< = hhxj 1	 	 	'@'@'BC% s   CC	c                   Rp\        V\        R4      p\        \        R4      ;_uu_ 4       pVP                  V4       RRR4       V P	                  \
        \        4       \        \        V4      pV P                  V4      pVP                  pR\         RV P                   R\         RV RV RR	\        R 4      ,          R,            R
2pV P                  WWP                  4       4       R#   + '       g   i     L; i)z	if True: rG   r{   Nr  r  r  z, in <module>
    z
     rc   a	  if True: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^)rI   r   r   r   rb  r   r   rG   r{  r  r  r  ri   rh   r   )r5   sourcerc  rI  r@   r  r  r  s   &       r!   test_traceback_very_long_lineATracebackErrorLocationCaretTestBase.test_traceback_very_long_line  s    (6662&#$JJv 'tX&))$/**j););(< = hhxj 1( s;'''12"6 	 	'@'@'BC# s   C,,C<	c           	         R  pVP                   P                  pR\         RV P                   R\         RV^,            R2	pV P	                  V4      pV P                  WCP                  4       4       R# )c                  @    R RR//p V R ,          R,          R,           R# r  r   r  s    r!   r  ]TracebackErrorLocationCaretTestBase.test_secondary_caret_not_elided.<locals>.f_with_subscript  s$    sDk*IcN3$$r#   r  r  r  zP, in f_with_subscript
    some_dict['x']['y']['z']
    ~~~~~~~~~~~~~~~~~~~^^^^^
Nr  r  s   &    r!   test_secondary_caret_not_elidedCTracebackErrorLocationCaretTestBase.test_secondary_caret_not_elided  s    	% $,,;;j););(< =  j! 5-	- 	 ))*:;'@'@'BCr#   c           	         R  pR\          RV P                   R\          RVP                  P                  ^,            R2	pV P	                  V4      pV P                  W2P                  4       4       R# )c                  B    \        R\        ^4      \        ^4      .4      h)Tr   r   r=   r   r   r#   r!   rA   KTracebackErrorLocationCaretTestBase.test_caret_exception_group.<locals>.exc	  s    )$A	!0MNNr#   C  + Exception Group Traceback (most recent call last):
  |   File "r  zE, in get_exception
  |     callable()
  |     ~~~~~~~~^^
  |   File "aB  , in exc
  |     if True: raise ExceptionGroup("eg", [ValueError(1), TypeError(2)])
  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  | ExceptionGroup: eg (2 sub-exceptions)
  +-+---------------- 1 ----------------
    | ValueError: 1
    +---------------- 2 ----------------
    | TypeError: 2
N)r  r  r~  r  r{  rh   r   )r5   rA   r  r  s   &   r!   test_caret_exception_group>TracebackErrorLocationCaretTestBase.test_caret_exception_group  s{    
	O$:Xd.@.@-A B %:Xcll.I.IA.M-N O$	% 	 ))#.'@'@'BCr#   c                z    V P                  V4      pVR,          pV P                  VP                  4       V4       R# )r   Nr  )r{  rh   lstrip)r5   r@   expected_specializationr  specialization_lines   &&&  r!   assertSpecialized5TracebackErrorLocationCaretTestBase.assertSpecialized  s8    ))$/*2.,3357NOr#   c                @   V P                  R  R4       V P                  R R4       V P                  R R4       V P                  R R4       V P                  R R4       V P                  R R4       V P                  R	 R
4       V P                  R R
4       V P                  R R4       V P                  R R4       V P                  R R4       V P                  R R4       V P                  R R4       V P                  R R4       V P                  R R4       R# )c                      ^^ ,          # r  r   r   r#   r!   r"   TTracebackErrorLocationCaretTestBase.test_specialization_variations.<locals>.<lambda>#  s    qsr#   z~^~c                  "    ^^ ,          ^,          # r  r   r   r#   r!   r"   r  %  s    qs1ur#   c                      ^^ ,          # r  r   r   r#   r!   r"   r  '      q1ur#   z~~^~~c                  "    ^^ ,          ^,          # r  r   r   r#   r!   r"   r  )  s    q1uqyr#   c                      ^^ ,          # r  r   r   r#   r!   r"   r  +      q!tr#   z~^~~c                  "    ^^ ,          ^,          # r  r   r   r#   r!   r"   r  -  s    q!tAvr#   c                      ^^ ,          # r  r   r   r#   r!   r"   r  /  s    qqyr#   z	~~~~~^~~~c                  "    ^^ ,          ^,          # r  r   r   r#   r!   r"   r  1  s    qqyQr#   c                      ^^ ,          # r  r   r   r#   r!   r"   r  3  r  r#   z~~^~c                      ^^ ,          # r  r   r   r#   r!   r"   r  5  r  r#   z~^^~c                  "    ^^ ,          ^,          # r  r   r   r#   r!   r"   r  7  s    q!tQwr#   c                      ^^ ,          # r  r   r   r#   r!   r"   r  9  s    qAvr#   z~~^^~~c                  "    ^^ ,          ^,          # r  r   r   r#   r!   r"   r  ;  s    qAv{r#   c                      ^^ ,          # r  r   r   r#   r!   r"   r  =  r  r#   z~~^^~c                      ^^ ,          # r  r   r   r#   r!   r"   r  ?  r  r#   z~^^~~N)r{  rJ   s   &r!   test_specialization_variationsBTracebackErrorLocationCaretTestBase.test_specialization_variations"  s#   {&+	-}&+	-}&-	/0&-	/|&,	.~&,	.0&1	36&1	3|&,	.|&,	.&,	.~&.	02&.	0}&-	/}&-	/r#   c                Z  aa	 R  oR o	VV	3R lpV P                  V4      pVP                  P                  pSP                  P                  pR\         RV P                   R\         RV^,            R\         RV^,            R2pV P                  W%P                  4       4       VV	3R lpV P                  V4      pVP                  P                  pR\         RV P                   R\         RV^,            R	\         RV^,            R2pV P                  W%P                  4       4       R
# )c                     \         hr9   r   r@   s   &r!   	dec_error`TracebackErrorLocationCaretTestBase.test_decorator_application_lineno_correct.<locals>.dec_errorC  s    Or#   c                     V # r9   r   r  s   &r!   dec_fine_TracebackErrorLocationCaretTestBase.test_decorator_application_lineno_correct.<locals>.dec_fineE  s    Kr#   c                  "   < SSR  4       4       p R# )c                      R # r9   r   r   r#   r!   r   kTracebackErrorLocationCaretTestBase.test_decorator_application_lineno_correct.<locals>.applydecs.<locals>.gH  s    r#   Nr   )r   r  r  s    r!   	applydecs`TracebackErrorLocationCaretTestBase.test_decorator_application_lineno_correct.<locals>.applydecsG  s      r#   r  r  r  z5, in applydecs
    @dec_error
     ^^^^^^^^^
  File "z#, in dec_error
    raise TypeError
c                  0   < SS ! R  R4      4       4       p R# )c                       ] tR tRtRtR# )qTracebackErrorLocationCaretTestBase.test_decorator_application_lineno_correct.<locals>.applydecs_class.<locals>.Ai\  r   Nr   r   r   r   r   r   r#   r!   r   r  \  s    r#   r   Nr   )r   r  r  s    r!   applydecs_classfTracebackErrorLocationCaretTestBase.test_decorator_application_lineno_correct.<locals>.applydecs_class[  s    M  r#   z;, in applydecs_class
    @dec_error
     ^^^^^^^^^
  File "N)r{  r~  r  r  r  rh   r   )
r5   r  r  lineno_applydescslineno_dec_errorr  r  lineno_applydescs_classr  r  s
   &       @@r!   )test_decorator_application_lineno_correctMTracebackErrorLocationCaretTestBase.test_decorator_application_lineno_correctB  sU   			 )))4%..==$--<<j););(< =  j):Q)>(? @  j)9A)=(> ?$$ 	 	'@'@'BC	 ))/:"1":":"I"Ij););(< =  j)@1)D(E F  j)9A)=(> ?$$ 	 	'@'@'BCr#   c           	         R  pV P                  V4      pRR\         RV P                   R2RRR\         RVP                  P                  ^,            R2RR	.pV P                  W#4       R
# )c                  &    R P                  4        R # r9   methodr   r#   r!   r   KTracebackErrorLocationCaretTestBase.test_multiline_method_call_a.<locals>.fo  s     r#   "Traceback (most recent call last):  File "r  , in get_exception    callable()    ~~~~~~~~^^, in fz    .methodz     ^^^^^^Nr{  r  r  r~  r  rh   r5   r   actualrC  s   &   r!   test_multiline_method_call_a@TracebackErrorLocationCaretTestBase.test_multiline_method_call_an  s{    	 ##A&0z4+=+=*>>PQz1::+D+Dq+H*IP
 	*r#   c           	         R  pV P                  V4      pRR\         RV P                   R2RRR\         RVP                  P                  ^,            R2R.pV P                  W#4       R	# )
c                  &    R P                  4        R # r9   r  r   r#   r!   r   KTracebackErrorLocationCaretTestBase.test_multiline_method_call_b.<locals>.f  s     r#   r  r  r  r  r  r  r  z
    methodNr  r  s   &   r!   test_multiline_method_call_b@TracebackErrorLocationCaretTestBase.test_multiline_method_call_b  sx    	 ##A&0z4+=+=*>>PQz1::+D+Dq+H*IP
 	*r#   c           	         R  pV P                  V4      pRR\         RV P                   R2RRR\         RVP                  P                  ^,            R2RR	.pV P                  W#4       R
# )c                  &    R P                  4        R # r9   r  r   r#   r!   r   KTracebackErrorLocationCaretTestBase.test_multiline_method_call_c.<locals>.f  s    & r#   r  r  r  r  r  r  r  z    . methodz      ^^^^^^Nr  r  s   &   r!   test_multiline_method_call_c@TracebackErrorLocationCaretTestBase.test_multiline_method_call_c  s{    	 ##A&0z4+=+=*>>PQz1::+D+Dq+H*IP
 	*r#   c           	         R  pV P                  V4      pRR\         RV P                   R2RRR\         RVP                  P                  ^,            R2R.pV P                  W#4       R	# )
c                      \          R # r9   widthr   r#   r!   r   hTracebackErrorLocationCaretTestBase.test_wide_characters_unicode_with_problematic_byte_offset.<locals>.f  s    r#   r  r  r  r  r  r  r  u       ｗｉｄｔｈNr  r  s   &   r!   9test_wide_characters_unicode_with_problematic_byte_offset]TracebackErrorLocationCaretTestBase.test_wide_characters_unicode_with_problematic_byte_offset  sx    	 ##A&0z4+=+=*>>PQz1::+D+Dq+H*IP!
 	*r#   c           	         R  pV P                  V4      pRR\         RV P                   R2RRR\         RVP                  P                  ^,            R2R.pV P                  W#4       R	# )
c                      ^p \        V 4      hr  r  r  s    r!   r   [TracebackErrorLocationCaretTestBase.test_byte_offset_with_wide_characters_middle.<locals>.f  s    O_--r#   r  r  r  r  r  r  r  u%       raise ValueError(ｗｉｄｔｈ)Nr  r  s   &   r!   ,test_byte_offset_with_wide_characters_middlePTracebackErrorLocationCaretTestBase.test_byte_offset_with_wide_characters_middle  sx    	. ##A&0z4+=+=*>>PQz1::+D+Dq+H*IP3
 	*r#   c           	         R  pV P                  V4      pRR\         RV P                   R2RRR\         RVP                  P                  ^,            R2RR	R
R.	pV P                  W#4       R# )c                  2    ^p ^ p\        ^V ! V4      4       R# r   print)wwwths     r!   r   ITracebackErrorLocationCaretTestBase.test_byte_offset_multiline.<locals>.f  s     IF!Y r#   r  r  r  r  r  r  r  u       print(1, ｗｗｗ(z             ~~~~~~^u               ｔｈ))z            ^^^^^Nr  r  s   &   r!   test_byte_offset_multiline>TracebackErrorLocationCaretTestBase.test_byte_offset_multiline  s    	 ##A&0z4+=+=*>>PQz1::+D+Dq+H*IP%""

 	*r#   c           	         R  pV P                  V4      pRR\         RV P                   R2RRR\         RVP                  P                  ^,            R2RR	.pV P                  W#4       R
# )c                      ^p ^ pW,          # r  r   )   说明说明   şçöğıĤellös     r!   r   cTracebackErrorLocationCaretTestBase.test_byte_offset_with_wide_characters_term_highlight.<locals>.f  s    L !33r#   r  r  r  r  r  r  r  u+       return 说明说明 / şçöğıĤellöz            ~~~~~~~~~^~~~~~~~~~~~Nr  r  s   &   r!   4test_byte_offset_with_wide_characters_term_highlightXTracebackErrorLocationCaretTestBase.test_byte_offset_with_wide_characters_term_highlight  s{    	4
 ##A&0z4+=+=*>>PQz1::+D+Dq+H*IP9.
 	*r#   c           	         R  pV P                  V4      pRR\         RV P                   R2RRR\         RVP                  P                  ^,            R2RR	.pV P                  W#4       R
# )c                  6    R \        RR4      ,           R,           # )u   ✨🐍u   📗🚛   🐍)   func_说明说明r   r#   r!   r   ZTracebackErrorLocationCaretTestBase.test_byte_offset_with_emojis_term_highlight.<locals>.f  s$    0  $% %r#   r  r  r  r  r  r  r  u4       return "✨🐍" + func_说明说明("📗🚛",z!                    ^^^^^^^^^^^^^Nr  r  s   &   r!   +test_byte_offset_with_emojis_term_highlightOTracebackErrorLocationCaretTestBase.test_byte_offset_with_emojis_term_highlight  s{    	% ##A&0z4+=+=*>>PQz1::+D+Dq+H*IPB/
 	*r#   c           	         R  pV P                  V4      pRR\         RV P                   R2RRR\         RVP                  P                  ^,            R2RR	.pV P                  W#4       R
# )c                  \    R RRR///p V R ,          R,          R,          R,          R,          # )u
   ✨🚛✨u   说明u   🐍🐍🐍Nr  u   🐍🐍r   )my_dcts    r!   r   TTracebackErrorLocationCaretTestBase.test_byte_offset_wide_chars_subscript.<locals>.f  s?    &F ,'1&9(CJOOr#   r  r  r  r  r  r  r  uG       return my_dct["✨🚛✨"]["说明"]["🐍"]["说明"]["🐍🐍"]z)           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^Nr  r  s   &   r!   %test_byte_offset_wide_chars_subscriptITracebackErrorLocationCaretTestBase.test_byte_offset_wide_chars_subscript  s|    	P ##A&0z4+=+=*>>PQz1::+D+Dq+H*IPU7
 	*r#   c           	         R  pV P                  V4      pRR\         RV P                   R2RRR\         RVP                  P                  ^,            R2R.pV P                  W#4       R	# )
c                      \        4       hr9   )MemoryErrorr   r#   r!   r   @TracebackErrorLocationCaretTestBase.test_memory_error.<locals>.f  s
    -r#   r  r  r  r  r  r  r  z    raise MemoryError()Nr  r  s   &   r!   test_memory_error5TracebackErrorLocationCaretTestBase.test_memory_error  sx    	  ##A&8xj););(<<NOxj)B)BQ)F(GvN%' 	*r#   c                  a R  oV3R lpV P                  V4      pRR\         RV P                   R2RRR\         RVP                  P                  ^,            R2R	R\         RSP                  P                  ^,            R
2RR.	pV P                  W#4       R oV3R lpV P                  V4      pRR\         RV P                   R2RRR\         RVP                  P                  ^,            R2RRR\         RSP                  P                  ^,            R
2RR.
pV P                  W#4       R oV3R lpV P                  V4      pRR\         RV P                   R2RRR\         RVP                  P                  ^,            R2RRRR\         RSP                  P                  ^,            R
2RR.pV P                  W#4       R oV3R lpV P                  V4      pRR\         RV P                   R2RRR\         RVP                  P                  ^,            R2RRRRRRR\         RSP                  P                  ^,            R
2RR.pV P                  W#4       R# )c                      ^^ ,           R# r   r   r   r#   r!   r   cTracebackErrorLocationCaretTestBase.test_anchors_for_simple_return_statements_are_elided.<locals>.g      aCCr#   c                     < S ! 4       # r9   r   r   s   r!   r   cTracebackErrorLocationCaretTestBase.test_anchors_for_simple_return_statements_are_elided.<locals>.f!  s
    3Jr#   r  r  r  r  r  r  r  z    return g(), in g    1/0    ~^~c                      ^^ ,           R# r   r   r   r#   r!   r   r  1  r  r#   c                      < S ! 4       ^,           # r  r   r  s   r!   r   r  4  s    37Nr#   z    return g() + 1z           ~^^c                      ^^ ,           R# r   r   argss   *r!   r   r  E  r  r#   c                     < S ! ^^^^4      # r  r   r  s   r!   r   r  H  s    Q r#   z    return g(1,z             2, 4,z             5)c                      ^^ ,           R# r   r   r   s   *r!   r   r  \  r  r#   c                  (   < S ! ^^^^4      ^,           # r  r   r  s   r!   r   r  _  s"    Q r#   z           ~^^^z             ^^^^^z             5) + 1z             ^^Nr  r5   r   r  rC  r   s   &   @r!   4test_anchors_for_simple_return_statements_are_elidedXTracebackErrorLocationCaretTestBase.test_anchors_for_simple_return_statements_are_elided  s   		 ))!,8z4+=+=*>>PQz1::+D+Dq+H*IPz1::+D+Dq+H*IP	
 	0		 ))!,8z4+=+=*>>PQz1::+D+Dq+H*IP z1::+D+Dq+H*IP

 	0		
 ))!,8z4+=+=*>>PQz1::+D+Dq+H*IP z1::+D+Dq+H*IP
 	0		
 ))!,8z4+=+=*>>PQz1::+D+Dq+H*IP  !z1::+D+Dq+H*IP
 	0r#   c                  a R  oV3R lpV P                  V4      pRR\         RV P                   R2RRR\         RVP                  P                  ^,            R2R	R\         RSP                  P                  ^,            R
2RR.	pV P                  W#4       R oV3R lpV P                  V4      pRR\         RV P                   R2RRR\         RVP                  P                  ^,            R2RRRR\         RSP                  P                  ^,            R
2RR.pV P                  W#4       R oV3R lpV P                  V4      pRR\         RV P                   R2RRR\         RVP                  P                  ^,            R2RRR\         RSP                  P                  ^,            R
2RR.
pV P                  W#4       R oV3R lpV P                  V4      pRR\         RV P                   R2RRR\         RVP                  P                  ^,            R2RRRRRRR\         RSP                  P                  ^,            R
2RR.pV P                  W#4       R# )c                      ^^ ,           R# r   r   r   r#   r!   r   cTracebackErrorLocationCaretTestBase.test_anchors_for_simple_assign_statements_are_elided.<locals>.gw  r  r#   c                     < S! 4       p R # r9   r   r  r   s    r!   r   cTracebackErrorLocationCaretTestBase.test_anchors_for_simple_assign_statements_are_elided.<locals>.fz  s
    Ar#   r  r  r  r  r  r  r  z    x = g()r  r  r  c                      ^^ ,           R# r   r   r   s   *r!   r   r
    r  r#   c                     < S! ^^^^4      p R# r   r   r  s    r!   r   r    s    !QAr#   z    x = g(1,z          2, 3,z          4)c                      ^^ ,           R# r   r   r   r#   r!   r   r
    r  r#   c                     < S! 4       ;rR # r9   r   r  re   r   s     r!   r   r    s    CKAr#   z    x = y = g()z            ~^^c                      ^^ ,           R# r   r   r   s   *r!   r   r
    r  r#   c                      < S! ^^^^4      ;rR# r   r   r  s     r!   r   r    s    a Ar#   z    x = y = g(1,z            ~^^^z              2, 3,z              ^^^^^z              4)z              ^^Nr  r  s   &   @r!   4test_anchors_for_simple_assign_statements_are_elidedXTracebackErrorLocationCaretTestBase.test_anchors_for_simple_assign_statements_are_elidedv  s   		 ))!,8z4+=+=*>>PQz1::+D+Dq+H*IPz1::+D+Dq+H*IP	
 	0		
 ))!,8z4+=+=*>>PQz1::+D+Dq+H*IPz1::+D+Dq+H*IP
 	0		 ))!,8z4+=+=*>>PQz1::+D+Dq+H*IPz1::+D+Dq+H*IP

 	0		
 ))!,8z4+=+=*>>PQz1::+D+Dq+H*IP!!z1::+D+Dq+H*IP
 	0r#   r   N)1r   r   r   r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r	  r  r  r-  r6  r?  rL  rU  rZ  r_  rd  ri  rn  ru  r{  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r   r   s   @r!   r  r  a  s
    
@&@&@*@2>@@@0D$D$D$D&D4#DJD,D$D$D&"DHD.D.D*DBD0D,$DLD.D.D&D2P
/@*DX+"+ +"+ + +,+$+"+.+W1rW1 W1r#   r  c                   4   a  ] tR tRt o . ROtR tR tRtV tR# )TestKeywordTypoSuggestionsi  c           
        \         P                  ! 4       ;_uu_ 4       p\        V P                  4       F  w  pw  r4V P	                  VR 7      ;_uu_ 4        \
        P                  ! V4      P                  4       p\        VRV 2V4      p\        V4      w  rxp	V	P                  R4      p
V P                  RV R2V
4       RRR4       K  	  RRR4       R#   + '       g   i     K  ; i  + '       g   i     R# ; i)typoscript_r<  Did you mean ''N)tempfileTemporaryDirectory	enumerate
TYPO_CASESr  r   r   rj   r   r   r)  rk   )r5   
script_dirir   expected_kwrh  script_namer   r  r   stderr_texts   &          r!   "test_keyword_suggestions_from_file=TestKeywordTypoSuggestions.test_keyword_suggestions_from_file  s    ((**j*3DOO*D&&D\\{\33%__T288:F"-jGA3-"PK)>{)K&B"(--"8KMMN;-q"A;O 43 +E +*333 +**s$   8C*A*C C*C'!	C**C;	c                R   V P                    F  w  rV P                  VR 7      ;_uu_ 4        \        P                  ! V4      P	                  4       p\        RV4      w  rEpVP                  R4      pV P                  RV R2V4       RRR4       K  	  R#   + '       g   i     K  ; i)r  r  r<  r  r  N)r"  r  r   r   rj   r   r)  rk   )r5   r   r%  rh  r   r  r   r'  s   &       r!   ,test_keyword_suggestions_from_command_stringGTestKeywordTypoSuggestions.test_keyword_suggestions_from_command_string  s    !%D;//!.446%:4%H"F$mmG4{m1={K	 0/ "1///s   ABB&r   N))zwith block ad something:
  passand)zfur a in b:
  passfor)zfor a in b:
  pass
elso:
  passelse)zwhille True:
  passwhile)ziff x > 5:
  passif)zif x:
  pass
elseif y:
  passelif)ztyo:
  pass
except y:
  passtry)zclasse MyClass:
  passclass)z
impor mathimport)zform x import yfrom)z(defn calculate_sum(a, b):
  return a + bdef)zdef foo():
  returm resultr  )zlamda x: x ** 2lambda)zdef foo():
  yeld iyield)zdef foo():
  globel counterglobal)zfrum math import sqrtr6  )zasynch def fetch_data():
  passasync)z%async def foo():
  awaid fetch_data()await)zraisee ValueError("Error")raise)z[x for x
in range(3)
of x]r1  )z[123 fur x
in range(3)
if x]r.  )zfor x im n:
  passin)	r   r   r   r   r"  r(  r+  r   r   r   s   @r!   r  r    s     J2PL Lr#   r  c                       ] tR tRtRtR# )"PurePythonTracebackErrorCaretTestsi  r   Nr  r   r#   r!   r@  r@    s     	r#   r@  c                       ] tR tRtRtR# )CPythonTracebackErrorCaretTestsi  r   Nr  r   r#   r!   rB  rB         	r#   rB  c                       ] tR tRtRtR# )%CPythonTracebackLegacyErrorCaretTestsi  r   Nr  r   r#   r!   rE  rE    rC  r#   rE  c                     a  ] tR tRt o RtR tR tR t]RR l4       t	R t
R	 tR
 tR tR t]! 4       R 4       tR t]R 4       tR t]]P*                  ! 4       R 4       4       t]P*                  ! 4       R 4       t]R 4       tR tRtV tR# )TracebackFormatMixini!  Tc                    \        R 4      h)blah)KeyErrorrJ   s   &r!   some_exception#TracebackFormatMixin.some_exception$  s    vr#   c                    V Uu. uF.  p\        VP                  4       4      \        R 4      8:  d   K,  VNK0  	  up# u upi )z^~)setrj   )r5   rC  lines   && r!   _filter_debug_ranges)TracebackFormatMixin._filter_debug_ranges'  s2    !)PTZZ\1Bc$i1OPPPs   )<<c                L    V P                   '       g   V P                  V4      # V# r9   )DEBUG_RANGESrP  )r5   rC  s   &&r!   _maybe_filter_debug_ranges/TracebackFormatMixin._maybe_filter_debug_ranges*  s$       ,,X66r#   Nc                   ^ RI Hp  V P                  4        \        R4      h  \         Ed   pTP
                  pTe   T! TP                  4       RRP                  \        P                  ! T4      4      ,           pRP                  T P                  TP                  4       4      4      R,           p\        4       pT! YF4       TP                  4       p\        R4      ;_uu_ 4       p\        P                  ! T4       RRR4       M  + '       g   i     M; i\        4       p	\        P                  ! YIR7       \        R4      ;_uu_ 4       p
\        P                   ! 4        RRR4       M  + '       g   i     M; i\        P"                  ! 4       p\        4       p\        P                   ! TR7        Rp?MRp?ii ; iT P%                  YW4       T P%                  XP                  4       T	P                  4       4       T P%                  X
P                  4       TP                  4       4       T P%                  YP                  4       4       TP                  4       pT^ ,          pT P%                  \'        T4      ^4       TR,          TR,          ppT P)                  TR	4       T P)                  TR
4       T P)                  TR4       R# )r   )traceback_printz&unable to create test traceback stringNz#Traceback (most recent call last):
r   rc   r   rH  	Tracebackr  z	    raiser  )r  rW  rK  r   rJ  r^  tb_nextr   r>   	format_tbrP  r   r   rM  r   print_tbre  rf  rh   ri   assertStartsWith)r5   cleanup_funcrW  r   r%   traceback_fmtfile_
python_fmtr  tbfile	excstderrexcfmtrh  tb_linesbannerlocationsource_lines   &&               r!   check_traceback_format+TracebackFormatMixin.check_traceback_format/  s#   -	B!6 @AA5  	.B'RZZ(BGGI$7$7$;<=M !II))-*B*B*DEM JEB&..*J **h""2& +***ZFr/ **i##% +***))+FjGW--1	.: 	3**,foo.?@++-w/?/?/AB!1!1!34 ((*!X* (hrl+fk2h1k;7sE   # G B8F;'D>	F;D<F;E-$	F;-E=8>F;;G c                &    V P                  4        R # r9   ri  rJ   s   &r!   test_traceback_format*TracebackFormatMixin.test_traceback_formata  s    ##%r#   c                .    R  pV P                  V4       R# )c                 :    V P                   P                  4        R # r9   )tb_frameclearr[  s   &r!   
cleanup_tbRTracebackFormatMixin.test_traceback_format_with_cleared_frames.<locals>.cleanup_tbf  s    KKr#   Nrl  )r5   rs  s   & r!   )test_traceback_format_with_cleared_frames>TracebackFormatMixin.test_traceback_format_with_cleared_framesd  s    	 ##J/r#   c                2   \        R 4      ;_uu_ 4       p\        P                  ! \        P                  ! ^4      4       RRR4       \        4       p\        P                  ! \        P                  ! ^4      VR7       V P                  XP                  4       VP                  4       4       \        P                  ! \        P                  ! ^4      4      pV P                  VP                  4       RP                  V4      4       R#   + '       g   i     L; i)r   NrH  r   )
r   r>   print_stackr8  	_getframer   rh   rM  format_stackr   )r5   ststderrstfilestfmts   &   r!   test_stack_format&TracebackFormatMixin.test_stack_formatj  s     X&&(!!#--"23 'cmmA.V<**,foo.?@&&s}}Q'78**,bggen= '&s   +DD	c           	     ^   R  p\        R4      ;_uu_ 4       pV! 4        RRR4       VP                  P                  pV P                  XP	                  4       P                  4       RR R\        V^,           3,          RR\        V^,           3,          R.4       R#   + '       g   i     L; i)c                  0    \         P                  ! 4        R # r9   )r>   rx  r   r#   r!   prn2TracebackFormatMixin.test_print_stack.<locals>.prnx  s    !!#r#   r   Nz)  File "%s", line %d, in test_print_stackz	    prn()z  File "%s", line %d, in prnz    traceback.print_stack())r   r~  r  rh   rM  r   r  )r5   r  r   r  s   &   r!   test_print_stack%TracebackFormatMixin.test_print_stackw  s    	$X&&&E ',,*557<78VAX:NN*hq-AA)	?
 	 '&s   BB,	c                  aaa R V n         V3R lo\        R4      ;_uu_ 4       p S! 4        V P                  R4       R R R 4       SP                  P
                  pR\         RV^,            R\         RV^,            R\         RV^,            R\         RV^,            R2pV P                  VP                  4       4      pXP                  4       P                  4       pV P                  VR R VR R 4       V P                  VR,          VR,          4       V P                  VR,          VR,          4       \        P                  ! 4       pV P                  \        \         P"                  ! R	VR,          4      P%                  4       4      \'        V^<,
          V4      4       RV3R
 llo\        R4      ;_uu_ 4       p S! 4        V P                  R4       R R R 4       SP                  P
                  p	R\         RV	^,            R\         RV	^,            R\         RV	^,            R\         RV	^,            R2p
R\         RV	^,            R2pV P                  W,           P                  4       4      pXP                  4       P                  4       pV P                  We4       RVV3R llo\        R4      ;_uu_ 4       p S! 4        V P                  R4       R R R 4       SP                  P
                  pR\         RV^,            R\         RV^,            R\         RV^,            R\         RV^,            R\         RV^,            R2pV P                  W,           P                  4       4      pXP                  4       P                  4       pV P                  We4       \        R4      ;_uu_ 4       p S! \*        P,                  4       V P                  R4       R R R 4       R\         RV	^,            R\         RV	^,            R\         RV	^,            R\         RV	^,            R2p
R\         RV	^M,            R2pV P                  W,           P                  4       4      pVP                  4       P                  4       pV P                  We4       \        R4      ;_uu_ 4       p S! \*        P,                  ^,           4       V P                  R4       R R R 4       R\         RV	^,            R\         RV	^,            R\         RV	^,            R\         RV	^,            R2p
R\         RV	^m,            R2pV P                  W,           P                  4       4      pVP                  4       P                  4       pV P                  We4       R #   \         d    T! 4         ELki ; i  + '       g   i     ELx; i  \(         d    T! 4         ELi ; i  + '       g   i     EL; i  \(         d    T! 4         EL(i ; i  + '       g   i     EL5; i  \(         d    T! 4         ELOi ; i  + '       g   i     EL\; i  \(         d    T! 4         ELi ; i  + '       g   i     EL; i)Nc                     < S ! 4        R # r9   r   r<  s   r!   r   BTracebackFormatMixin._check_recursive_traceback_display.<locals>.f  s    Cr#   r   zno recursion occurredr  r  z@, in _check_recursive_traceback_display
    f()
    ~^^
  File "z, in f
    f()
    ~^^
  File "zv, in f
    f()
    ~^^
  \[Previous line repeated (\d+) more times\]
RecursionError: maximum recursion depth exceeded
z\d+c                 L   < V '       d   S! V ^,
          4      ^,           # \         hr  r  )rm   r   s   &r!   r   BTracebackFormatMixin._check_recursive_traceback_display.<locals>.g  s    qzA~%r#   zno value error was raisedr  z?, in g
    return g(count-1) + 1
           ~^^^^^^^^^
  File "zg, in g
    return g(count-1) + 1
           ~^^^^^^^^^
  [Previous line repeated 7 more times]
  File "z', in g
    raise ValueError
ValueError
z8, in _check_recursive_traceback_display
    g()
    ~^^
c                 D   < V '       d   S! V ^,
          4      # S! 4        R# r   r   )rm   r   hs   &r!   r  BTracebackFormatMixin._check_recursive_traceback_display.<locals>.h  s    qz!Cr#   z@, in _check_recursive_traceback_display
    h()
    ~^^
  File "z%, in h
    return h(count-1)
  File "zM, in h
    return h(count-1)
  [Previous line repeated 7 more times]
  File "z, in h
    g()
    ~^^
zno error raisedzn, in _check_recursive_traceback_display
    g(traceback._RECURSIVE_CUTOFF)
    ~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
zf, in g
    return g(count-1) + 1
           ~^^^^^^^^^
  [Previous line repeated 1 more time]
  File "zv, in _check_recursive_traceback_display
    g(traceback._RECURSIVE_CUTOFF + 1)
    ~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
rY  r  )
   )maxDiffr   rw  RecursionErrorr~  r  r  rT  r   rM  rh   assertRegexrk   r8  getrecursionlimitr  researchgroupranger=   r>   _RECURSIVE_CUTOFF)r5   
render_excstderr_fr  result_frC  r  	rec_limitstderr_glineno_gresult_gtb_linestderr_hlineno_hresult_hr   r   r  s   &&             @@@r!   "_check_recursive_traceback_display7TracebackFormatMixin._check_recursive_traceback_display  s9    	 X&&(3 		12 ' ::,,j! 5  j! 5  j! 5  j! 5AA 	, 2283F3F3HI""$//1 	hsm4Xb\2hrlF2J/ ))+	c"))FF2J7==?@%	RTV_B`a	
 X&&(7 		56 ' ::,,xj! 5  j! 5  j! 5  j! 5 	 j! 5 	 22G4F3R3R3TU""$//1*	 	
 X&&(7 		56 ' ::,,j! 5  j! 5j! 5j! 5  j! 5 	  22H4G3S3S3UV""$//1* X&&(-)--. 		+, ' xj! 5  j! 5  j! 5  j! 5 	j" 633 	 22G4F3R3R3TU""$//1* X&&(-)--12 		+, ' xj! 5  j! 5  j! 5  j! 5 	 j# 777 	 22G4F3R3R3TU""$//1*i "  '&&l   '&&V   '&&B   '&&F   '&&s   V-VV->W WWXW.
X8X4:XX4+Y!-Y
Y!V*&V-)V**V--V>	WWWWW+	.X XXXX	X1-X40X11X44Y	YY!YY!!Y2	c                   a V P                   '       d"   V P                  \        P                  4       R# ^ RIHo V3R lpV P                  V4       R# )r   r  c                  >   < S ! \         P                  ! 4       4       R # r9   )r8  	exceptionr  s   r!   r  ATracebackFormatMixin.test_recursive_traceback.<locals>.render_excN  s    0r#   N)rS  r  r>   re  r  r  )r5   r  r  s   & @r!   test_recursive_traceback-TracebackFormatMixin.test_recursive_tracebackH  s9    33I4G4GH1133J?r#   c                    R  pV! 4       pVP                   P                  pV P                  VRR R\        V^,           3,          R\        V^,           3,          .4       R# )c                  ,    \         P                  ! 4       # r9   )r>   rz  r   r#   r!   fmt3TracebackFormatMixin.test_format_stack.<locals>.fmtS  s    ))++r#   Nz>  File "%s", line %d, in test_format_stack
    result = fmt()
zA  File "%s", line %d, in fmt
    return traceback.format_stack()
rY  )r~  r  rh   r  )r5   r  resultr  s   &   r!   test_format_stack&TracebackFormatMixin.test_format_stackR  se    	,,,#&.q%9:47?6JK'
 	r#   c                X   ^ RI Hp  ! R R\        4      pV! R4      pV! R4      p WCh  T d     Th  T d   pTp Rp? MRp?ii ; ii ; i\        R4      ;_uu_ 4       pT! T4       RRR4       M  + '       g   i     M; iXP	                  4       P                  4       P                  4       pT P                  ^\        T4      4       T P                  \        P                  4       T^,          4       T P                  RT^,          4       T P                  R	T^
,          4       R# )
r   r  c                   &   a  ] tR tRt o R tRtV tR# )ATracebackFormatMixin.test_unhashable.<locals>.UnhashableExceptionib  c                    R # Tr   r5   others   &&r!   __eq__HTracebackFormatMixin.test_unhashable.<locals>.UnhashableException.__eq__c      r#   r   Nr   r   r   r   r  r   r   r   s   @r!   UnhashableExceptionr  b        r#   r  ex1ex2Nr   zUnhashableException: ex2zUnhashableException: ex1)r  r  r   r   rM  rj   r   rh   ri   context_messagerk   )	r5   r  r  r  r  r   exc_valr  r%   s	   &        r!   test_unhashable$TracebackFormatMixin.test_unhashable^  s    -	) 	 "%(!%(	" 		& 	 X&&(G$ '&&&  &&(335SW%..0"Q%80"Q%80"R&9s4   ) A3AAAAA!	A33B	c                Z    \        ^4      p\        R4       F  p\        RV.4      pK  	  V# )r     r   )r   r  r   )r5   r   r$  s   &  r!   deep_egTracebackFormatMixin.deep_egy  s,    aLtAtaS)A r#   c           	        ^ RI Hp ^KpV P                  4       p\        R4      ;_uu_ 4       p\        P
                  ! VR7      ;_uu_ 4        V! V4       RRR4       RRR4       XP                  4       pV P                  RV4       V P                  VP                  R4      V4       R#   + '       g   i     L]; i  + '       g   i     Lh; i)r   r  r   	max_depthNr   )
r  r  r  r   r   infinite_recursionrM  rk   assertLessEqualrm   )r5   r  LIMITr   r  r/  s   &     r!   (test_exception_group_deep_recursion_capi=TracebackFormatMixin.test_exception_group_deep_recursion_capi  s     	.\\^X&&(++e<<# = ' ""$&/V\\*:;UC	 =< '&s#    B=	B*	B=*B:5B==C	c           	        ^KpV P                  4       p\        R4      ;_uu_ 4       p\        P                  ! VR7      ;_uu_ 4        \        P
                  ! \        V4      W"P                  4       RRR4       RRR4       XP                  4       pV P                  RV4       V P                  VP                  R4      V4       R#   + '       g   i     L]; i  + '       g   i     Lh; i)K   r   r  Nr   )r  r   r   r  r>   rL  typer^  rM  rk   r  rm   )r5   r  r   r  r/  s   &    r!   -test_exception_group_deep_recursion_tracebackBTracebackFormatMixin.test_exception_group_deep_recursion_traceback  s    \\^X&&(++e<<))$r(B8H8HI = ' ""$&/V\\*:;UC	 =< '&s#    C+C	1CCCC)	c           	     2   ^ RI Hp \        R4      ;_uu_ 4       p\        P                  ! 4       ;_uu_ 4        V! ^*4       RRR4       RRR4       V P                  XP                  4       R4       R#   + '       g   i     L:; i  + '       g   i     LE; i)r   r  r   NzFTypeError: print_exception(): Exception expected for value, int found
)r  r  r   r   catch_unraisable_exceptionrh   rM  )r5   r  r   s   &  r!   "test_print_exception_bad_type_capi7TracebackFormatMixin.test_print_exception_bad_type_capi  sd    -X&&&3355# 6 ' 	OO9	
 65 '&s"   B	A3	B3B>BB	c                    R pV P                  \        V4      ;_uu_ 4        \        P                  ! ^*4       RRR4       R#   + '       g   i     R# ; i)z'Exception expected for value, int foundN)r]  r   r>   rL  )r5   msgs   & r!   $test_print_exception_bad_type_python9TracebackFormatMixin.test_print_exception_bad_type_python  s7    7##Is33%%b) 4333s   AA	)r  r9   )r   r   r   r   rS  rK  rP  rT  r   ri  rm  ru  r~  r  r  r
   r  r  r  r  r   skip_emscripten_stack_overflowr  r  r  r  r   r   r   s   @r!   rG  rG  !  s     LQ
 /8 /8b&0>A+F @ @
 : :4 ++-	D . 	D ++-D .D 	
 	
* *r#   rG  zG
The above exception was the direct cause of the following exception:

zF
During handling of the above exception, another exception occurred:

rf   |r   c                       ] tR tRtRtR# )TestTracebackFormati  r   Nr  r   r#   r!   r  r    s    r#   r  c                   Z   a a ] tR tRt oRtV3R lV 3R lltV3R lV 3R lltRtVtV ;t	# )TestFallbackTracebackFormati  Fc                   < V ^8  d   QhRR/# r  r  Nr   )r#  r   s   "r!   r  (TestFallbackTracebackFormat.__annotate__  s      t r#   c                   < \         P                  V n        R  \         n        \        P                  V n        R \        n        \        SV `  4       # )c                      R # r9   r   r   s   *r!   r"   3TestFallbackTracebackFormat.setUp.<locals>.<lambda>  s    4r#   c                      ^^ ,          # r  r   r   s   *r!   r"   r    s    1r#   )r8  unraisablehookoriginal_unraisable_hookr>   _print_exception_bltinoriginal_hookr/   r0   r4   s   &r!   r0   !TestFallbackTracebackFormat.setUp  s;    (+(:(:%/&==+<	(w}r#   c                   < V ^8  d   QhRR/# r  r   )r#  r   s   "r!   r  r    s     " "$ "r#   c                t   < V P                   \        n        V P                  \        n        \        SV `  4       # r9   )r  r>   r  r  r8  r  r/   r:   r4   s   &r!   r:   $TestFallbackTracebackFormat.tearDown  s-    +/+=+=	(!::w!!r#   )r  r  )
r   r   r   r   rS  r0   r:   r   r   rq  rr  s   @@r!   r  r    s%      L " " "r#   r  c                     a  ] tR tRt o R t]P
                  P                  ^,           tR tR t	R t
R tR tR tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R t#R t$R  t%R!t&V t'R"# )#BaseExceptionReportingTestsi  c                z    \        V\        4      '       d   V#  V! 4        R #   \         d   pTu R p?# R p?ii ; ir9   )
isinstancer   r   )r5   exception_or_callabler   s   && r!   r{  )BaseExceptionReportingTests.get_exception  s6    +];;((	!# 	H	s   # :5::c                    ^^ ,           R# r   r   rJ   s   &r!   zero_div$BaseExceptionReportingTests.zero_div  s    	!r#   c                B   VP                  4       p\        4       '       d4   V P                  VR,          R4       V P                  RVR,          4       M2V P                  VR,          R4       V P                  RVR,          4       V P                  VR,          R4       R# )	r  r  z1/0 # In zero_divr   NrY  r  r  )r   r   r]  rk   )r5   r  r   s   && r!   check_zero_div*BaseExceptionReportingTests.check_zero_div  sz       !!%)X6MM-uRy9!!%)X6MM-uRy9eBi)<=r#   c                    ^^ ,           V P                  X4      P                  4       p\        4       '       d6   V P	                  \        V4      ^4       V P                  V^,          R4       M4V P	                  \        V4      ^4       V P                  V^,          R4       V P                  V^ ,          R4       V P                  V^,          R4       V P                  RV^,          4       R#   \          d   pTp Rp?LRp?ii ; i)r   Nr   rX  r  z1/0 # Marker)r   
get_reportr   r   rh   ri   r]  rk   r5   r    r   r   s   &   r!   test_simple'BaseExceptionReportingTests.test_simple  s    	aC "--/  SZ+!!%(,?@SZ+!!%(,?@eAh4eAh1neAh/ ! 	A	s   	C0 0D;DDc                <  a a V 3R  loV3R lp\         P                  S P                  V4      4      pS P                  \	        V4      ^4       S P                  V^,          \
        4       S P                  V^ ,          4       S P                  RV^,          4       R# )c                  ^   <  SP                  4        R #   \         d   p \        T hR p ? ii ; ir9   r  r   rJ  )r   r5   s    r!   inner_raise;BaseExceptionReportingTests.test_cause.<locals>.inner_raise  s)    &$ &A%&s    ,',c                     < S ! 4        R # r9   r   r	  s   r!   outer_raise;BaseExceptionReportingTests.test_cause.<locals>.outer_raise      Mr#   inner_raise() # MarkerN
boundariessplitr  rh   ri   cause_messager  rk   r5   r  blocksr	  s   f  @r!   
test_cause&BaseExceptionReportingTests.test_cause  ss    	&
	!!$//+">?Va(M2F1I&.q	:r#   c                <  a a V 3R  loV3R lp\         P                  S P                  V4      4      pS P                  \	        V4      ^4       S P                  V^,          \
        4       S P                  V^ ,          4       S P                  RV^,          4       R# )c                  T   <  S P                  4        R #   \         d    \        hi ; ir9   r  rJ   s   r!   r	  =BaseExceptionReportingTests.test_context.<locals>.inner_raise 	  s%    $ s    'c                     < S ! 4        R # r9   r   r  s   r!   r  =BaseExceptionReportingTests.test_context.<locals>.outer_raise	  r  r#   r  N)r  r  r  rh   ri   r  r  rk   r  s   f  @r!   test_context(BaseExceptionReportingTests.test_context  ss    	
	!!$//+">?Va(O4F1I&.q	:r#   c                     \         h  \          d	    \        R hi ; i  \         d   pTp R p?MR p?ii ; iT P                  T4      P                  4       pT P	                  \        T4      ^4       T P                  T^,          R4       T P                  T^ ,          R4       T P                  T^,          R4       T P                  RT^,          4       R # )Nr   rX  r  zZeroDivisionError from None)r   r   r  r   rh   ri   r]  rk   r  s   &   r!   test_context_suppression4BaseExceptionReportingTests.test_context_suppression	  s    	2 2'T12  	A	"--/UQ'eAh(;<eAh4eAh13U1X>s   	  616c                <  a a V 3R  loV3R lp\         P                  S P                  V4      4      pS P                  \	        V4      ^4       S P                  V^,          \
        4       S P                  V^ ,          4       S P                  RV^,          4       R# )c                     <  SP                  4         \         R #   \         d   p T p R p ? LR p ? ii ; i  \         d	    \        Xhi ; ir9   )r  r   xyzzy	NameErrorrJ  )_er   r5   s     r!   r	  GBaseExceptionReportingTests.test_cause_and_context.<locals>.inner_raise	  sH    & %   &A%&s    6 3.3A	c                     < S ! 4        R # r9   r   r  s   r!   r  GBaseExceptionReportingTests.test_cause_and_context.<locals>.outer_raise(	  r  r#   r  Nr  r  s   f  @r!   test_cause_and_context2BaseExceptionReportingTests.test_cause_and_context	  ss    	&	!!$//+">?Va(M2F1I&.q	:r#   c                  a a V 3R  loV3R lp\         P                  S P                  V4      4      pS P                  \	        V4      ^4       S P                  V^,          \
        4       S P                  RV^ ,          4       S P                  RV^ ,          4       S P                  RV^,          4       S P                  V^,          4       R# )c                     <   SP                  4        R #   \         d   p T p\        T hR p ? ii ; i  \         d	   p XT hR p ? ii ; ir9   r  )r   r'   r5   s     r!   r	  EBaseExceptionReportingTests.test_cause_recursive.<locals>.inner_raise1	  sK    *MMO( *A")*  Qs$    /	*/2 AA  Ac                     < S ! 4        R # r9   r   r  s   r!   r  EBaseExceptionReportingTests.test_cause_recursive.<locals>.outer_raise:	  r  r#   zraise KeyError from ez1/0r  N)	r  r  r  rh   ri   r  rk   assertNotInr  r  s   f  @r!   test_cause_recursive0BaseExceptionReportingTests.test_cause_recursive0	  s    		!!$//+">?Va(M2-vay9q	* 	.q	:F1I&r#   c                    R  pV P                  V4      P                  4       pV P                  VR,          R4       R pV P                  V4      P                  4       pV P                  VR,          R4       R# )c                      \        R R4      h)r   )r   r   r  hello)rg   r   r#   r!   r   FBaseExceptionReportingTests.test_syntax_error_offset_at_eol.<locals>.eI	  s    b"566r#   z	        ^c                      \        R 4       R# )zx = 5 | 4 |N)rG   r   r#   r!   r   r8  M	  s
    r#   z               ^NrY  )r  r   rh   r5   r   r  s   &  r!   test_syntax_error_offset_at_eol;BaseExceptionReportingTests.test_syntax_error_offset_at_eolG	  sc    	7ooa ++-R+.	 ooa ++-R"45r#   c                   \        R 4      pV P                  V4      P                  4       pV P                  VR.4       ^dVn        V P                  V4      P                  4       pV P                  VRR.4       \        R 4      pRVn        V P                  V4      P                  4       pV P                  VR.4       ^dVn        V P                  V4      P                  4       pV P                  VRR.4       R# )rt   zSyntaxError: bad syntaxz  File "<string>", line 100z	myfile.pyz#SyntaxError: bad syntax (myfile.py)z  File "myfile.py", line 100N)rg   r  r   rh   r  r(   r:  s   &  r!   test_syntax_error_no_lineno7BaseExceptionReportingTests.test_syntax_error_no_linenoR	  s     %ooa ++-&'	)ooa ++-*,EF	H % 
ooa ++-23	5ooa ++-+-FG	Ir#   c                d   V P                  \        R 4      4      pV P                  RV4       V P                  \        R4      4      pV P                  RV4       V P                  \        4       4      pV P                  RV4       V P                  \        R4      4      pV P                  RV4       R # )NzException: None
Nonez
Exception
r   )r  r   rk   rn   s   & r!   test_message_none-BaseExceptionReportingTests.test_message_nonek	  s    ooio.)3/ooi/0)3/ooik*mS)ooim,mS)r#   c                   \        R^
4       EF  pR EF  pRV,          RV,          ,           pR.pV^8  d(   VP                  RVP                  4       ,          4       MV^8:  d   VP                  RVP                  4       ,          4       \        ^\	        VP                  4       4      V,
          ^,           4      pVP                  RRV^,
          ,          : RV,          : 24       Mo\        ^\	        VP                  4       4      ^,
          4      pVP                  RVP                  4       ,          4       VP                  RR: RV,          : 24       VP                  R4       VP                  R4       V P                  \        R	R
^W,           V34      4      pRP                  V4      pV P                  Wv4       EK  	  EK  	  R# )r  rg  ztext%dz  File "file.py", line 1z    %s    ra   zSyntaxError: msgr   r  zfile.pyrc   N)r   r  z     )	r  appendrx  maxri   r  rg   r   rh   )r5   offsetaddr?  rC  caret_lengthro   exps   &       r!   !test_syntax_error_various_offsets=BaseExceptionReportingTests.test_syntax_error_various_offsetsv	  sR   BmFSy8f#4467A:OOHt{{}$<=q[OOHt{{}$<=#&q#dkkm*<v*E*I#JLOO#!2DcLFX$YZ#&q#dkkm*<q*@#ALOOHt{{}$<=OO'3;M$NO 23#ook%)QVZ9[&\]ii)  *%  $r#   c                   \        ^{4      pV P                  V4      pVP                  R4       V P                  V P                  V4      VR,           4       V=VP                  R4       V P                  V P                  V4      VR,           4       V=VP                  R4       V P                  V P                  V4      VR,           4       V=V P                  V P                  V4      V4       R# ){   zMy NotezMy Note
r   rc   z	Your Notez
Your Note
N)r=   r  r   rh   	__notes__r5   r   vanillas   &  r!   test_exception_with_note4BaseExceptionReportingTests.test_exception_with_note	  s    sO//!$	

9+W{-BCK	

2+Wt^<K	

;+W}-DEK+W5r#   c                   \        ^{4      pV P                  V4      p ! R R4      p ! R R4      pV! 4       Vn        RpV P                  V P                  V4      W%,           R,           4       V! 4       Vn        RpV P                  V P                  V4      W&,           R,           4       V! 4       R.Vn        R	pV P                  V P                  V4      W',           R
,           4       V! 4       R.Vn        RpV P                  V P                  V4      W&,           R
,           4       RVn        RpV P                  V P                  V4      W&,           R,           4       RVn        RpV P                  V P                  V4      W&,           R,           4        ! R R\        4      pV! ^{4      pV P                  V4      pRVn        V P                  V P                  V4      VR,           4       R# )rP  c                   ,   a  ] tR tRt o R tR tRtV tR# )OBaseExceptionReportingTests.test_exception_with_invalid_notes.<locals>.BadThingi	  c                    R # )bad strr   rJ   s   &r!   r   WBaseExceptionReportingTests.test_exception_with_invalid_notes.<locals>.BadThing.__str__	  s     r#   c                    R # )bad reprr   rJ   s   &r!   __repr__XBaseExceptionReportingTests.test_exception_with_invalid_notes.<locals>.BadThing.__repr__	  s    !r#   r   N)r   r   r   r   r   r^  r   r   r   s   @r!   BadThingrX  	  s     !" "r#   r`  c                   &   a  ] tR tRt o R tRtV tR# )RBaseExceptionReportingTests.test_exception_with_invalid_notes.<locals>.Unprintablei	  c                    \        R 4      h	bad valuer  rJ   s   &r!   r^  [BaseExceptionReportingTests.test_exception_with_invalid_notes.<locals>.Unprintable.__repr__	  s     --r#   r   Nr   r   r   r   r^  r   r   r   s   @r!   Unprintablerb  	  s     . .r#   rh  r]  rc   z<__notes__ repr() failed>z
Final NoterZ  z
Final Note
z<note str() failed>zplease do not explode mez'please do not explode me's    please do not show me as numbersz#b'please do not show me as numbers'c                   *   a  ] tR tRt o RtR tRtV tR# )VBaseExceptionReportingTests.test_exception_with_invalid_notes.<locals>.BrokenExceptioni	  Fc                F    V P                   '       d   \        R V 24      hR# )zno N)brokenr=   r5   names   &&r!   __getattr__bBaseExceptionReportingTests.test_exception_with_invalid_notes.<locals>.BrokenException.__getattr__	  s!    ;;;$s4&\22 r#   r   N)r   r   r   r   rl  ro  r   r   r   s   @r!   BrokenExceptionrj  	  s     F3 3r#   rq  Tz<Ignored error getting __notes__: ValueError('no __notes__')
N)r=   r  rQ  rh   r   rl  )	r5   r   rS  r`  rh  
notes_reprr4  bad_noterq  s	   &        r!   !test_exception_with_invalid_notes=BaseExceptionReportingTests.test_exception_with_invalid_notes	  s   sO//!$	" 	"	. 	. j
+W-AD-HI!m-+W->-EF !
L1+W-?BR-RS $|4'+W->AQ-QR1.+W->-EF:7+W->-EF	3i 	3 C //!$OOAUU	Wr#   c                t   \        ^*4      \        R4      3 EF  pV P                  VR7      ;_uu_ 4        V P                  V4      pVP	                  R4       VP	                  R4       VP	                  R4       V P                  V P                  V4      VR,           R,           R,           4       V=VP	                  R	4       V=VP	                  R
4       VP	                  R4       V P                  V P                  V4      VR,           R,           4       RRR4       EK
  	  R#   + '       g   i     EK   ; i)*   rt   r   zNote 1zNote 2zNote 3zNote 1
zNote 2
zNote 3
zNote 4zNote 5zNote 6zNote 5
zNote 6
N)r=   rg   r  r  r   rh   rQ  rR  s   &  r!   "test_exception_with_multiple_notes>BaseExceptionReportingTests.test_exception_with_multiple_notes	  s    R.+l";<A""//!,

8$

8$

8$  OOA&j(:5
BD K

8$K

8$

8$  OOA&j(:57# #" ="""s   C!D%%D7c                \    ! R  R4      pV P                  VP                  P                  4       4      pRpRP                  VP                  P                  P                  VP                  P                  P
                  .4      pV: RV: R2pV P                  V\        V,           4       R# )c                   *    ] tR tRt ! R R4      tRtR# )>BaseExceptionReportingTests.test_exception_qualname.<locals>.Ai	  c                   ,    ] tR tRt ! R R]4      tRtR# )@BaseExceptionReportingTests.test_exception_qualname.<locals>.A.Bi	  c                   &   a  ] tR tRt o R tRtV tR# )BBaseExceptionReportingTests.test_exception_qualname.<locals>.A.B.Xi	  c                    R # I am Xr   rJ   s   &r!   r   JBaseExceptionReportingTests.test_exception_qualname.<locals>.A.B.X.__str__	  s    'r#   r   Nr   r   s   @r!   r   r  	  s     ( (r#   r   r   N)r   r   r   r   r   r   r   r   r#   r!   r   r~  	  s    (	 ( (r#   r   r   N)r   r   r   r   r   r   r   r#   r!   r   r|  	  s    ( (r#   r   r  r   r   rc   N)r  r   r   r   r   r   rh   MODULE_PREFIX)r5   r   ro   r   r   rL  s   &     r!   test_exception_qualname3BaseExceptionReportingTests.test_exception_qualname	  sy    	( 	( ooacceeg&	88QSSUU--qssuu/A/ABC$i0mc12r#   c                    ! R  R\         4      pR F  pW!n        V P                  VR7      ;_uu_ 4        V P                  V! 4       4      pRpVR	9   d   VP                  pM'RP                  VP                  VP                  .4      pV: RV: R2pV P                  Wc4       RRR4       K  	  R#   + '       g   i     K  ; i)
c                   &   a  ] tR tRt o R tRtV tR# )@BaseExceptionReportingTests.test_exception_modulename.<locals>.Xi	  c                    R # r  r   rJ   s   &r!   r   HBaseExceptionReportingTests.test_exception_modulename.<locals>.X.__str__	      r#   r   Nr   r   s   @r!   r   r  	          r#   r   )
modulenamer  r   r   rc   N)r   r   some_module)r   r   )r   r   r  r  r   r   rh   )r5   r   r  ro   r   r   rL  s   &      r!   test_exception_modulename5BaseExceptionReportingTests.test_exception_modulename	  s    	 	 	  @J%L44ooac*$	!99 ~~H"xxq~~(FGH$,i8  * 54 @444s   A/B22Cc                    \         P                  ! R 4      p\        VRR4      p/ / rC\        W#V4       V P	                  VR,          4      pRpV P                  We4       R# )z~
            try:
                raise ValueError(42)
            except Exception as e:
                exc = e
            z<does not exist>rG   rA   z>  File "<does not exist>", line 3, in <module>
ValueError: 42
N)r   r   rI   rG   r  rk   )r5   srcr   r   lro   rL  s   &      r!   'test_exception_angle_bracketed_filenameCBaseExceptionReportingTests.test_exception_angle_bracketed_filename
  sZ    oo   s.721Taooah'Pcr#   c                     ! R  R\         4      p^*Vn        V P                  V! 4       4      pRVP                   R2pV P	                  W24       R# )c                   &   a  ] tR tRt o R tRtV tR# )LBaseExceptionReportingTests.test_exception_modulename_not_unicode.<locals>.Xi
  c                    R # r  r   rJ   s   &r!   r   TBaseExceptionReportingTests.test_exception_modulename_not_unicode.<locals>.X.__str__
  r  r#   r   Nr   r   s   @r!   r   r  
  r  r#   r   z
<unknown>.z	: I am X
N)r   r   r  r   rh   )r5   r   ro   rL  s   &   r!   %test_exception_modulename_not_unicodeABaseExceptionReportingTests.test_exception_modulename_not_unicode
  sH    	 	 	  ooac"1>>**5"r#   c                     ! R  R\         4      pV P                  V! 4       4      pRpRP                  VP                  VP                  .4      pV P                  \        V,           V RV R24       R# )c                   &   a  ] tR tRt o R tRtV tR# )@BaseExceptionReportingTests.test_exception_bad__str__.<locals>.Xi'
  c                    ^^ ,           R# r   r   rJ   s   &r!   r   HBaseExceptionReportingTests.test_exception_bad__str__.<locals>.X.__str__(
  r   r#   r   Nr   r   s   @r!   r   r  '
  r   r#   r   r   r   r   rc   N)r   r  r   r   r   rh   r  r   s   &    r!   test_exception_bad__str__5BaseExceptionReportingTests.test_exception_bad__str__&
  sb    		 	 ooac".	88Q\\1>>:;,
"YKr.JKr#   c           	         R  pR\          RV P                   R\          RVP                  P                  ^,            R2	pV P	                  V4      pV P                  W24       R# )c                  B    \        R \        ^4      \        ^4      .4      h)r   rr  r   r#   r!   rA   CBaseExceptionReportingTests.test_exception_group_basic.<locals>.exc3
  s     
1y|'DEEr#   rt  r  _, in get_exception
  |     exception_or_callable()
  |     ~~~~~~~~~~~~~~~~~~~~~^^
  |   File "a  , in exc
  |     raise ExceptionGroup("eg", [ValueError(1), TypeError(2)])
  | ExceptionGroup: eg (2 sub-exceptions)
  +-+---------------- 1 ----------------
    | ValueError: 1
    +---------------- 2 ----------------
    | TypeError: 2
    +------------------------------------
Nr  r  r~  r  r  rh   r5   rA   rC  reports   &   r!   test_exception_group_basic6BaseExceptionReportingTests.test_exception_group_basic2
  sp    	F$:Xd.@.@-A B %:Xcll.I.IA.M-N O;	< 	 %*r#   c                   R  pR\          RVP                  P                  ^,            R\          RV P                   R\          RVP                  P                  ^,            R2pV P	                  V4      pV P                  W24       R# )c                      \         p  V ! R \        ^4      \        ^4      .4      h  \         d$   pT ! R\        ^4      \        ^4      .4      ThRp?ii ; i)eg1eg2Nr   r=   r   r   )EGr   s     r!   rA   CBaseExceptionReportingTests.test_exception_group_cause.<locals>.excH
  sU    BFA	! =>> FA	! =>AEFs   % AAArt  r  a  , in exc
  |     raise EG("eg1", [ValueError(1), TypeError(2)])
  | ExceptionGroup: eg1 (2 sub-exceptions)
  +-+---------------- 1 ----------------
    | ValueError: 1
    +---------------- 2 ----------------
    | TypeError: 2
    +------------------------------------

The above exception was the direct cause of the following exception:

  + Exception Group Traceback (most recent call last):
  |   File "r  a  , in exc
  |     raise EG("eg2", [ValueError(3), TypeError(4)]) from e
  | ExceptionGroup: eg2 (2 sub-exceptions)
  +-+---------------- 1 ----------------
    | ValueError: 3
    +---------------- 2 ----------------
    | TypeError: 4
    +------------------------------------
Nr  r~  r  r  r  rh   r  s   &   r!   test_exception_group_cause6BaseExceptionReportingTests.test_exception_group_causeG
  s    	F##+*HS\\5P5PST5T4U V# $,*HT5G5G4H I# $,*HS\\5P5PST5T4U VB!C2 %*r#   c                \   R  pR\          RVP                  P                  ^,            R\          RVP                  P                  ^,            R\          RV P                   R\          RVP                  P                  ^,            R2pV P	                  V4      pV P                  W24       R# )c                      \         p   V ! R \        ^4      \        ^4      .4      h  T  d    T ! R\        ^4      \        ^4      .4      hi ; i  T  d    \        ^4      hi ; i)r  r  )r   r=   r   ImportError)r  s    r!   rA   RBaseExceptionReportingTests.test_exception_group_context_with_context.<locals>.excl
  so    B%CUZ]IaL$ABB CUZ]IaL$ABBC %!!n$%s   & %AA A!rt  r  a  , in exc
  |     raise EG("eg1", [ValueError(1), TypeError(2)])
  | ExceptionGroup: eg1 (2 sub-exceptions)
  +-+---------------- 1 ----------------
    | ValueError: 1
    +---------------- 2 ----------------
    | TypeError: 2
    +------------------------------------

During handling of the above exception, another exception occurred:

  + Exception Group Traceback (most recent call last):
  |   File "a  , in exc
  |     raise EG("eg2", [ValueError(3), TypeError(4)])
  | ExceptionGroup: eg2 (2 sub-exceptions)
  +-+---------------- 1 ----------------
    | ValueError: 3
    +---------------- 2 ----------------
    | TypeError: 4
    +------------------------------------

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "zS, in get_exception
    exception_or_callable()
    ~~~~~~~~~~~~~~~~~~~~~^^
  File "z1, in exc
    raise ImportError(5)
ImportError: 5
Nr  r  s   &   r!   )test_exception_group_context_with_contextEBaseExceptionReportingTests.test_exception_group_context_with_contextk
  s    	%$:Xcll.I.IA.M-N O %:Xcll.I.IA.M-N O !z$*<*<)= > !z#,,*E*E*I)J K 9! 	B %*r#   c                \   R  pR\          RVP                  P                  ^	,            R\          RVP                  P                  ^,            R\          RV P                   R\          RVP                  P                  ^,            R2pV P	                  V4      pV P                  W24       R# )c                      \         p \        p\        p  V ! R V! ^4      V! ^4      .4      h  \         d   pTp Rp?MRp?ii ; iT ! RT! ^4      YA! ^4      .4      h  T  d    T ! RT! ^4      .4      hi ; i)nestedNr   topr  )r  VETEr   rA   s        r!   rA   DBaseExceptionReportingTests.test_exception_group_nested.<locals>.exc
  s    BBB)X1r!u~66  C1sBqE233 )A(()s#   , A>A AA A5rt  r  a  , in exc
  |     raise EG("eg", [VE(1), exc, VE(4)])
  | ExceptionGroup: eg (3 sub-exceptions)
  +-+---------------- 1 ----------------
    | ValueError: 1
    +---------------- 2 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "a  , in exc
    |     raise EG("nested", [TE(2), TE(3)])
    | ExceptionGroup: nested (2 sub-exceptions)
    +-+---------------- 1 ----------------
      | TypeError: 2
      +---------------- 2 ----------------
      | TypeError: 3
      +------------------------------------
    +---------------- 3 ----------------
    | ValueError: 4
    +------------------------------------

During handling of the above exception, another exception occurred:

  + Exception Group Traceback (most recent call last):
  |   File "r  z, in exc
  |     raise EG("top", [VE(5)])
  | ExceptionGroup: top (1 sub-exception)
  +-+---------------- 1 ----------------
    | ValueError: 5
    +------------------------------------
Nr  r  s   &   r!   test_exception_group_nested7BaseExceptionReportingTests.test_exception_group_nested
  s    	)##+*HS\\5P5PST5T4U V% &.Jhs||7R7RUV7V6W X# $,*HT5G5G4H I# $,*HS\\5P5PSU5U4V WB5CB %*r#   c                    . p\        R 4       F  pVP                  \        V4      4       K  	  \        RV4      pRpV P	                  V4      pV P                  WT4       R# )  r   a>    | ExceptionGroup: eg (1000 sub-exceptions)
  +-+---------------- 1 ----------------
    | ValueError: 0
    +---------------- 2 ----------------
    | ValueError: 1
    +---------------- 3 ----------------
    | ValueError: 2
    +---------------- 4 ----------------
    | ValueError: 3
    +---------------- 5 ----------------
    | ValueError: 4
    +---------------- 6 ----------------
    | ValueError: 5
    +---------------- 7 ----------------
    | ValueError: 6
    +---------------- 8 ----------------
    | ValueError: 7
    +---------------- 9 ----------------
    | ValueError: 8
    +---------------- 10 ----------------
    | ValueError: 9
    +---------------- 11 ----------------
    | ValueError: 10
    +---------------- 12 ----------------
    | ValueError: 11
    +---------------- 13 ----------------
    | ValueError: 12
    +---------------- 14 ----------------
    | ValueError: 13
    +---------------- 15 ----------------
    | ValueError: 14
    +---------------- ... ----------------
    | and 985 more exceptions
    +------------------------------------
N)r  rG  r=   r   r  rh   )r5   excsr$  r   rC  r  s   &     r!    test_exception_group_width_limit<BaseExceptionReportingTests.test_exception_group_width_limit
  sX    tAKK
1& D$'!BF $*r#   c           	         \        R 4      p\        R4       F(  p\        RV 2\        V4      V\        V) 4      .4      pK*  	  RpV P	                  V4      pV P                  WC4       R# )bad typer  r   a    | ExceptionGroup: eg999 (3 sub-exceptions)
  +-+---------------- 1 ----------------
    | ValueError: 999
    +---------------- 2 ----------------
    | ExceptionGroup: eg998 (3 sub-exceptions)
    +-+---------------- 1 ----------------
      | ValueError: 998
      +---------------- 2 ----------------
      | ExceptionGroup: eg997 (3 sub-exceptions)
      +-+---------------- 1 ----------------
        | ValueError: 997
        +---------------- 2 ----------------
        | ExceptionGroup: eg996 (3 sub-exceptions)
        +-+---------------- 1 ----------------
          | ValueError: 996
          +---------------- 2 ----------------
          | ExceptionGroup: eg995 (3 sub-exceptions)
          +-+---------------- 1 ----------------
            | ValueError: 995
            +---------------- 2 ----------------
            | ExceptionGroup: eg994 (3 sub-exceptions)
            +-+---------------- 1 ----------------
              | ValueError: 994
              +---------------- 2 ----------------
              | ExceptionGroup: eg993 (3 sub-exceptions)
              +-+---------------- 1 ----------------
                | ValueError: 993
                +---------------- 2 ----------------
                | ExceptionGroup: eg992 (3 sub-exceptions)
                +-+---------------- 1 ----------------
                  | ValueError: 992
                  +---------------- 2 ----------------
                  | ExceptionGroup: eg991 (3 sub-exceptions)
                  +-+---------------- 1 ----------------
                    | ValueError: 991
                    +---------------- 2 ----------------
                    | ExceptionGroup: eg990 (3 sub-exceptions)
                    +-+---------------- 1 ----------------
                      | ValueError: 990
                      +---------------- 2 ----------------
                      | ... (max_group_depth is 10)
                      +---------------- 3 ----------------
                      | ValueError: -990
                      +------------------------------------
                    +---------------- 3 ----------------
                    | ValueError: -991
                    +------------------------------------
                  +---------------- 3 ----------------
                  | ValueError: -992
                  +------------------------------------
                +---------------- 3 ----------------
                | ValueError: -993
                +------------------------------------
              +---------------- 3 ----------------
              | ValueError: -994
              +------------------------------------
            +---------------- 3 ----------------
            | ValueError: -995
            +------------------------------------
          +---------------- 3 ----------------
          | ValueError: -996
          +------------------------------------
        +---------------- 3 ----------------
        | ValueError: -997
        +------------------------------------
      +---------------- 3 ----------------
      | ValueError: -998
      +------------------------------------
    +---------------- 3 ----------------
    | ValueError: -999
    +------------------------------------
N)r   r  r   r=   r  rh   )r5   rA   r$  rC  r  s   &    r!    test_exception_group_depth_limit<BaseExceptionReportingTests.test_exception_group_depth_limit
  si    
#tA QCAZ^46C 
FBP %*r#   c                \   R  pR\          RV P                   R\          RVP                  P                  ^	,            R\          RVP                  P                  ^,            R\          RVP                  P                  ^,            R2pV P	                  V4      pV P                  W24       R# )c                      . p R F  p \        V4      h	  \        RV 4      h  \          d1   pTP                  RT 24       T P                  T4        Rp?KS  Rp?ii ; i  \         d   pTP                  R4       h Rp?ii ; i)re  the Nr  t>> Multi line note
>> Because I am such
>> an important exception.
>> empty lines work too

(that was an empty line)re  zterrible valuer=   r   rG  r   r  r  r   s      r!   rA   HBaseExceptionReportingTests.test_exception_group_with_notes.<locals>.excK  s    :C'(o- ; %Xt44 & '

T#<0A' " 

 7 9 s<   A! #A! A%AA! AA! !B,A>>Brt  r  r  aQ  , in exc
  |     raise ExceptionGroup("nested", excs)
  | ExceptionGroup: nested (2 sub-exceptions)
  | >> Multi line note
  | >> Because I am such
  | >> an important exception.
  | >> empty lines work too
  | 
  | (that was an empty line)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "z, in exc
    |     raise ValueError(msg)
    | ValueError: bad value
    | the bad value
    +---------------- 2 ----------------
    | Traceback (most recent call last):
    |   File "z, in exc
    |     raise ValueError(msg)
    | ValueError: terrible value
    | the terrible value
    +------------------------------------
Nr  r  s   &   r!   test_exception_group_with_notes;BaseExceptionReportingTests.test_exception_group_with_notesJ  s    	&##+*HT5G5G4H I# $,*HS\\5P5PST5T4U V% &.Jhs||7R7RUV7V6W X% &.Jhs||7R7RUV7V6W XB+C6 %*r#   c                \   R  pR\          RV P                   R\          RVP                  P                  ^
,            R\          RVP                  P                  ^,            R\          RVP                  P                  ^,            R2pV P	                  V4      pV P                  W24       R# )c                  V    . p R F  p \        V4      h	  \        RV 4      h  \          dE   pTP                  RT 24       TP                  RT 24       T P                  T4        Rp?Kg  Rp?ii ; i  \         d)   pTP                  R4       TP                  R4       h Rp?ii ; i)re  r  zGoodbye Nr  r  zGoodbye!r  r  r  s      r!   rA   QBaseExceptionReportingTests.test_exception_group_with_multiple_notes.<locals>.exc}  s    :C'(o- ; %Xt44	 & '

T#<0

XcU#34A'
 " 

 7 9 

:&s<   A5 #A5 A29A-'A5 -A22A5 5B( #B##B(rt  r  r  a^  , in exc
  |     raise ExceptionGroup("nested", excs)
  | ExceptionGroup: nested (2 sub-exceptions)
  | >> Multi line note
  | >> Because I am such
  | >> an important exception.
  | >> empty lines work too
  | 
  | (that was an empty line)
  | Goodbye!
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "z, in exc
    |     raise ValueError(msg)
    | ValueError: bad value
    | the bad value
    | Goodbye bad value
    +---------------- 2 ----------------
    | Traceback (most recent call last):
    |   File "z, in exc
    |     raise ValueError(msg)
    | ValueError: terrible value
    | the terrible value
    | Goodbye terrible value
    +------------------------------------
Nr  r  s   &   r!   (test_exception_group_with_multiple_notesDBaseExceptionReportingTests.test_exception_group_with_multiple_notes|  s    	*##+*HT5G5G4H I# $,*HS\\5P5PSU5U4V W% &.Jhs||7R7RUV7V6W X% &.Jhs||7R7RUV7V6W XB/C< %*r#   c                   R  pR\          RV P                   R\          RVP                  P                  ^,            R\          RVP                  P                  ^,            R2pV P	                  V4      pV P                  W24       R# )c                  h     \        ^*4      h  . ;\          ;e
   p h Rp ? N NM N6;f     R# u i ; i)rw  Nr   r   s    r!   rA   KBaseExceptionReportingTests.test_exception_group_wrapped_naked.<locals>.exc  s)    m#I s    1	11rt  r  r  z, in exc
  |     except* Exception as e:
  |         raise
  | ExceptionGroup:  (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "ze, in exc
    |     raise Exception(42)
    | Exception: 42
    +------------------------------------
Nr  r  s   &   r!   "test_exception_group_wrapped_naked>BaseExceptionReportingTests.test_exception_group_wrapped_naked  s    	##+*HT5G5G4H I# $,*HS\\5P5PST5T4U V% &.Jhs||7R7RUV7V6W XBC %*r#   c                ~   R  pRpV! 4       p^ pVP                   P                  p\        P                  ! W#WE4      p\	        4       pWgn        R\         RV R2pV P                  V4      p	RP                  V	P                  R4       U
u. uF  qP                  4       NK  	  up
4      p	V P                  W4       R# u up
i )c                  ,    \         P                  ! 4       # r9   r8  ry  r   r#   r!   r   TBaseExceptionReportingTests.test_KeyboardInterrupt_at_first_line_of_frame.<locals>.f  s    ==?"r#   Nr  r  z', in f
    def f():

KeyboardInterrupt
rc   )r~  r  typesTracebackTyper   r^  r  r  r   r  rstriprh   )r5   r   rZ  r$   lastir  r%   rA   rC  r  r  s   &          r!   -test_KeyboardInterrupt_at_first_line_of_frameIBaseExceptionReportingTests.test_KeyboardInterrupt_at_first_line_of_frame  s    	# **  ?!'j 9*+ %T0BC0B1HHJ0BCD* Ds   B:r   N)(r   r   r   r   r{  r~  r  r  r  r  r  r  r  r!  r+  r3  r;  r>  rB  rM  rT  rt  rx  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r   r   s   @r!   r  r    s      "**99A=M>0 ;;?;('.	6I2	*+,6$7Wr7.3+" 	#L+*"+H-+^0+d*+XP+d0+d5+n+6+ +r#   r  c                   &   a  ] tR tRt o R tRtV tR# )PyExcReportingTestsi  c                   V P                  V4      pR P                  \        P                  ! \	        V4      WP
                  4      4      p\        R4      ;_uu_ 4       p\        P                  ! \	        V4      WP
                  4       RRR4       V P                  XP                  4       V4       V#   + '       g   i     L2; i)r   r   N)
r{  r   r>   r\  r  r^  r   rL  rh   rM  )r5   r   ssios   &&  r!   r  PyExcReportingTests.get_report  s    q!GG&&tAw??CEX&&#%%d1gq//B '+ '&s   +B33C	r   N)r   r   r   r   r  r   r   r   s   @r!   r  r    s      r#   r  c                   0   a  ] tR tRt o ]R 4       tRtV tR# )CExcReportingTestsi  c                    ^ RI Hp V P                  V4      p\        R4      ;_uu_ 4       pV! V4       RRR4       VP	                  4       #   + '       g   i     XP	                  4       # ; i)r   r  r   N)r  r  r{  r   rM  )r5   r   r  r  s   &&  r!   r  CExcReportingTests.get_report  sP    -q!X&&!A 'zz| '&zz|s   	AA+	r   N)r   r   r   r   r   r  r   r   r   s   @r!   r  r    s       r#   r  c                   n   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tRtV tR# )
LimitTestsi  c                    \        R 4      h)zLast raisedr  rJ   s   &r!   last_raises1LimitTests.last_raises1  s    &&r#   c                &    V P                  4        R # r9   )r  rJ   s   &r!   last_raises2LimitTests.last_raises2      r#   c                &    V P                  4        R # r9   )r   rJ   s   &r!   last_raises3LimitTests.last_raises3  r  r#   c                &    V P                  4        R # r9   )r  rJ   s   &r!   last_raises4LimitTests.last_raises4  r  r#   c                &    V P                  4        R # r9   )r  rJ   s   &r!   last_raises5LimitTests.last_raises5  r  r#   c                ,    \         P                  ! 4       # r9   r  rJ   s   &r!   last_returns_frame1LimitTests.last_returns_frame1  s    }}r#   c                "    V P                  4       # r9   )r  rJ   s   &r!   last_returns_frame2LimitTests.last_returns_frame2      ''))r#   c                "    V P                  4       # r9   )r  rJ   s   &r!   last_returns_frame3LimitTests.last_returns_frame3"  r  r#   c                "    V P                  4       # r9   )r  rJ   s   &r!   last_returns_frame4LimitTests.last_returns_frame4%  r  r#   c                "    V P                  4       # r9   )r  rJ   s   &r!   last_returns_frame5LimitTests.last_returns_frame5(  r  r#   c           	       a a S P                  4       oV3R  lpV 3R lp\        P                  ! \        RR4      ;_uu_ 4        V! 4       pS P	                  \        V4      ^4       S P                  V! ^R7      VR	R 4       V! V! ^dR7      VR
R R4       S P                  V! R	R7      VR,          4       V! V! R
R7      VR,          \        V4      ^,
          ^,
          4       S P                  V! ^ R7      . 4       \        =V! V! 4       VR4       ^\        n        S P                  V! 4       VR	R 4       S P                  V! ^R7      VRR 4       S P                  V! RR7      VR,          4       ^ \        n        S P                  V! 4       . 4       R\        n        S P                  V! 4       . 4       RRR4       R#   + '       g   i     R# ; i)c                  2   < \         P                  ! S3/ V B # r9   r>   extract_stack)kwargsr$   s   ,r!   extract.LimitTests.test_extract_stack.<locals>.extract-  s    **5;F;;r#   c                    < SP                  V R V VR V 4       SP                  W^,           R  W^,           R  4       SP                  \        V 4      \        V4      4       R # r9   )rh   ri   )r  rC  ignorer5   s   &&&r!   assertEqualExcept8LimitTests.test_extract_stack.<locals>.assertEqualExcept/  sZ    VGV_hw.?@V1HI.0CDS[#h-8r#   tracebacklimitr  limitNNr  N:Nd   NNr  NrY  iir  r  )r  r   rV  r8  assertGreaterri   rh   r'  )r5   r!  r%  nolimr$   s   f   @r!   test_extract_stackLimitTests.test_extract_stack+  sz   ((*	<	9
 s$4d;;IEs5z1-W1-uRSz:gC0%,EW2.b	:gD15;E
1QOW1-r2"gi5!"CWYbc
3W1-uRSz:W2.b	:!"CWY+!#CWY+# <;;;s   E5GG	c                  a  V P                  4        V3R lp\        P                  ! \
        RR4      ;_uu_ 4        V! 4       pV P                  \        V4      ^4       V P                  V! ^R7      VR,          4       V P                  V! ^
R7      V4       V P                  V! RR7      VRR  4       V P                  V! RR7      V4       V P                  V! ^ R7      . 4       \
        =V P                  V! 4       V4       ^\
        n        V P                  V! 4       VR,          4       V P                  V! ^R7      VR,          4       V P                  V! R	R7      VR	R  4       ^ \
        n        V P                  V! 4       . 4       R
\
        n        V P                  V! 4       . 4       R R R 4       R #   \         d   pTP                  o R p?ELR p?ii ; i  + '       g   i     R # ; i)Nc                  2   < \         P                  ! S3/ V B # r9   )r>   
extract_tb)r   r%   s   ,r!   r!  +LimitTests.test_extract_tb.<locals>.extractL  s    ''5f55r#   r'  r  r(  r*  r,  rY  r  r  )	r
  r   r^  r   rV  r8  rh   ri   r'  )r5   r   r!  r.  r%   s   &   @r!   test_extract_tbLimitTests.test_extract_tbG  s   	!	6 s$4d;;IESZ-W1-uRy9W2.6W2.bc
;W3/7W1-r2"WY.!"CWYb	2W1-uRy9W2.bc
;!"CWY+!#CWY+# <;  	!B	!
 <;;s#   F7 E0G7GGGG-	c                  a  V P                  4        V3R lp\        P                  ! \        RR4      ;_uu_ 4        V! 4       pV P                  \        V4      ^4       V P                  V! ^R7      VR,          4       V P                  V! ^
R7      V4       V P                  V! RR7      VRR  4       V P                  V! RR7      V4       V P                  V! ^ R7      . 4       \        =V P                  V! 4       V4       ^\        n        V P                  V! 4       VR,          4       V P                  V! ^R7      VR,          4       V P                  V! R	R7      VR	R  4       ^ \        n        V P                  V! 4       . 4       R
\        n        V P                  V! 4       . 4       R R R 4       R #   \         d   pTo R p?ELR p?ii ; i  + '       g   i     R # ; i)Nc                  8   < \         P                  ! S3/ V B ^R # )r   r  )r>   r\  )r   rA   s   ,r!   r!  1LimitTests.test_format_exception.<locals>.extracti  s     --c<V<QrBBr#   r'  r  r(  r*  r,  rY  r5  r  r  )r
  r   r   rV  r8  rh   ri   r'  )r5   r   r!  r.  rA   s   &   @r!   test_format_exception LimitTests.test_format_exceptionb  s   	
	C s$4d;;IESZ-W1-uRy9W2.6W2.bc
;W3/7W1-r2"WY.!"CWYb	2W1-uRy9W2.bc
;!"CWY+!#CWY+# <;  	C	 <;;s#   F7 E0G7GG

GG#	r   N)r   r   r   r   r  r   r  r  r
  r  r  r  r  r  r/  r6  r;  r   r   r   s   @r!   r  r    sK     
'****,8,6, ,r#   r  c                   ,   a  ] tR tRt o R tR tRtV tR# )MiscTracebackCasesi  c                  aa V3R  lpV3R loR o V! 4        XP                  P                  P                  P                  pV P	                  \        VP                  4      ^4       \        P                  ! V4       V P	                  \        VP                  4      ^ 4       R#   \          d   pTP                  p Rp?LRp?ii ; i)c                     < S ! 4        R # r9   r   )middles   r!   outer,MiscTracebackCases.test_clear.<locals>.outer  s    Hr#   c                     < S ! 4        R # r9   r   )inners   r!   rA  -MiscTracebackCases.test_clear.<locals>.middle  s    Gr#   c                      ^p ^^ ,           R# r   r   )r$  s    r!   rE  ,MiscTracebackCases.test_clear.<locals>.inner  s    AaCCr#   N)	r   r^  rZ  rq  rh   ri   f_localsr>   clear_frames)r5   rB  r   r%   inner_framerE  rA  s   &    @@r!   
test_clearMiscTracebackCases.test_clear  s    				!G
 jj((0099[112A6 	r" 	[112A6  	!B	!s   B& &C1CCc                    R  pV! 4       pVP                   P                  pV P                  VRR \        V^,           RR3\        V^,           RR3.4       V P                  \	        V^ ,          4      ^4       R# )c                  ,    \         P                  ! 4       # r9   r  r   r#   r!   r!  6MiscTracebackCases.test_extract_stack.<locals>.extract  s    **,,r#   Nr/  zresult = extract()r!  z return traceback.extract_stack()rY  )r~  r  rh   r  ri   )r5   r!  r  r  s   &   r!   r/  %MiscTracebackCases.test_extract_stack  sw    	-!!00vax!57KLvax,NO' 	 	VAY+r#   r   N)r   r   r   r   rL  r/  r   r   r   s   @r!   r>  r>    s     
70	, 	,r#   r>  c                   >   a  ] tR tRt o R tR tR tR tR tRt	V t
R# )		TestFramei  c                J   \         P                  ! 4        \         P                  ! R \        4       4       \        P
                  ! R ^R4      pV P                  VR4       V P                  \        V4      R4       V P                  V\        P
                  ! R ^R4      4       V P                  V\        V4      4       V P                  \        V4      V4       V P                  VP                  4       V P                  V\        4       4       V P                  V\        4       R# )r   dummyN)r   r   rU  %"""Test cases for traceback module""")	linecache
clearcache	lazycacheglobalsr>   FrameSummaryrh   tupleassertIsNonelocalsassertNotEqualobjectr	   r5   r   s   & r!   test_basicsTestFrame.test_basics  s    C+""373F	HqF	HI2237CDE!H% 	q1%!((#Avx(I&r#   c                   \         P                  ! 4        \        P                  ! R ^RRR7      pV P	                  RVP
                  4       \         P                  ! R \        4       4       V P	                  RVP                  4       R# )r   rU  F)lookup_lineNrV  )	rW  rX  r>   r[  rh   _linesrY  rZ  rO  ra  s   & r!   test_lazy_linesTestFrame.test_lazy_lines  sb    ""37Fqxx(C+3FF	r#   c                n    \         P                  ! R RR4      pV P                  VP                  R4       R# )r   NrU  r>   r[  rh   rO  ra  s   & r!   test_no_lineTestFrame.test_no_line  s*    ""3g6&r#   c                r    \         P                  ! R ^RRR7      pV P                  RVP                  4       R# r   rU  rO  )rO  Nrj  ra  s   & r!   test_explicit_lineTestFrame.test_explicit_line  s,    ""37@(r#   c                p    \         P                  ! R ^RRR7      pV P                  \        V4      ^4       R# rn  )r>   r[  rh   ri   ra  s   & r!   test_lenTestFrame.test_len  s,    ""37@Q#r#   r   N)r   r   r   r   rb  rg  rk  ro  rr  r   r   r   s   @r!   rS  rS    s#     '"')$ $r#   rS  c                      a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tRtV tR# )	TestStacki  c                    R  p\        \        P                  ! R4      4      V! 4       r2V P                  \	        V4      \	        V4      ,
          ^4       V P                  VR,          V4       R# )c                  @    \        \        P                  ! R 4      4      # r9   listr>   
walk_stackr   r#   r!   deeper)TestStack.test_walk_stack.<locals>.deeper      	,,T233r#   N:r   NN)ry  r>   rz  rh   ri   )r5   r{  s1s2s   &   r!   test_walk_stackTestStack.test_walk_stack  sQ    	4i**40168BR3r7*A.B$r#   c                |    R  pV! 4       pV^ ,          w  r4V P                  VP                  P                  R4       R# )c                  @    \        \        P                  ! R 4      4      # r9   rx  r   r#   r!   rE  2TestStack.test_walk_innermost_frame.<locals>.inner  r}  r#   rE  N)rh   f_coder   )r5   rE  framesinnermost_framer    s   &    r!   test_walk_innermost_frame#TestStack.test_walk_innermost_frame  s6    	4#AY//77Ar#   c                     ^^ ,           \        \        P                  ! X4      4      pV P                  \        V4      ^4       R#   \          d   pTP                  p Rp?LXRp?ii ; ir   )r   r^  ry  r>   walk_tbrh   ri   )r5   r   r%   r  s   &   r!   test_walk_tbTestStack.test_walk_tb  sT    	!aC ""2&'Q#  	!B	!s   	A A(A##A(c                    \         P                  P                  \         P                  ! R 4      4      pV P	                  V\         P                  4       R # r9   )r>   StackSummaryr!  rz  assertIsInstancer5   r  s   & r!   r/  TestStack.test_extract_stack  s9    ""**9+?+?+EFa!7!78r#   c                    \         P                  P                  \         P                  ! R 4      ^R7      pV P	                  \        V4      ^4       R # Nr(  )r>   r  r!  rz  rh   ri   r  s   & r!   test_extract_stack_limit"TestStack.test_extract_stack_limit  s<    ""**9+?+?+EQ*OQ#r#   c                j   \         P                  ! 4        \         P                  ! R \        4       4       \	        R R4      p\        VRR4      p\        P                  P                  \        V^3.4      RR7      p\         P                  ! 4        V P                  V^ ,          P                  R4       R# )/foo.pyr  NTlookup_lines
import sys)rW  rX  updatecacherZ  	test_code
test_framer>   r  r!  r   rh   rO  r5   r  r   r  s   &   r!   test_extract_stack_lookup_lines)TestStack.test_extract_stack_lookup_lines  s    i3i*q$%""**4!Q>*M1L1r#   c                   \         P                  ! 4        \        R R4      p\        VRR4      p\        P
                  P                  \        V^3.4      RR7      pV P                  / \         P                  4       \         P                  ! R \        4       4       V P                  V^ ,          P                  R4       R# )r  r  NFr  r  )rW  rX  r  r  r>   r  r!  r   rh   cacher  rZ  rO  r  s   &   r!   *test_extract_stackup_deferred_lookup_lines4TestStack.test_extract_stackup_deferred_lookup_lines  s    i*q$%""**4!Q>*NY__-i31L1r#   c                    \         P                  P                  R.4      pV P                  R.VP	                  4       4       R# foo.pyz*  File "foo.py", line 1, in fred
    line
Nr  r   fredrO  r>   r  	from_listrh   r#  r  s   & r!   test_from_listTestStack.test_from_list  s9    "",,.K-LM;<HHJ	r#   c                    \         P                  P                  R.4      pRV^ &   \         P                  P                  V4      pV P                  R.VP	                  4       4       R# )r  z*  File "foo.py", line 2, in fred
    line
Nr  )r  r  r  rO  r  )r5   r  r  s   &  r!   test_from_list_edited_stack%TestStack.test_from_list_edited_stack
  sX    "",,.K-LM,!##--a0;<IIK	r#   c                    \         P                  P                  R.4      pV P                  R.VP	                  4       4       R# r  r  r  s   & r!   test_format_smokeTestStack.test_format_smoke  s;     "",,.K-LM;<HHJ	r#   c                .   \         P                  ! R \        4       4       \        R R4      p\	        V\        4       R^/4      p\
        P                  P                  \        V^3.4      RR7      pV P                  V^ ,          P                  RR/4       R# )r  r  	somethingTcapture_locals1NrW  r  rZ  r  r  r>   r  r!  r   rh   r^  r  s   &   r!   test_localsTestStack.test_locals  sw    i3i*q')k1%56""**4!Q>$*O1{C&89r#   c                &   \         P                  ! R \        4       4       \        R R4      p\	        V\        4       R^/4      p\
        P                  P                  \        V^3.4      4      pV P                  V^ ,          P                  R4       R# )r  r  r  Nr  r  s   &   r!   test_no_localsTestStack.test_no_locals!  sm    i3i*q')k1%56""**4!Q>:1d+r#   c                    R  pV! ^^4      pV P                  R\        VP                  P                  ^,           3,          .VP	                  4       4       R# )c                 v    ^p^p\         P                  P                  \         P                  ! R4      R^R7      # )r   NT)r  r)  )r>   r  r!  rz  )kvr  r  s   &&  r!   
some_inner0TestStack.test_format_locals.<locals>.some_inner)  s>    AA))11$$T*4q 2 J Jr#   zw  File "%s", line %d, in some_inner
    return traceback.StackSummary.extract(
    a = 1
    b = 2
    k = 3
    v = 4
N)rh   r  r~  r  r#  )r5   r  r  s   &  r!   test_format_localsTestStack.test_format_locals(  sZ    	J
 q!
 '
(;(;(J(JQ(NOP  xxz	r#   c                   a  ! R  R\         P                  4      oV3R lpV! 4       pV P                  VP                  4       \         RVP
                  P                  ^,            2.4       R# )c                   *   a  ] tR tRt o RR ltRtV tR# )>TestStack.test_custom_format_frame.<locals>.CustomStackSummaryi9  c                8    VP                    R VP                   2# ):)r(   r  )r5   frame_summaryr3   s   &&&r!   format_frame_summarySTestStack.test_custom_format_frame.<locals>.CustomStackSummary.format_frame_summary:  s!    '001=3G3G2HIIr#   r   NF)r   r   r   r   r  r   r   r   s   @r!   CustomStackSummaryr  9  s     J Jr#   r  c                  R   < S P                  \        P                  ! R 4      ^R7      # r  )r!  r>   rz  )r  s   r!   r  6TestStack.test_custom_format_frame.<locals>.some_inner=  s+    %--$$T*! . 5 5r#   r  N)r>   r  rh   r#  r  r~  r  )r5   r  r  r  s   &  @r!   test_custom_format_frame"TestStack.test_custom_format_frame8  s`    	J!7!7 	J	5 LHHJz:..==ABCD	Fr#   c                x  a R  oV3R lpV! 4       p ! R R\         P                  4      pVP                  \         P                  ! V4      4      P	                  4       pV P                  \        V4      ^4       SP                  P                  ^,           pV P                  V^ ,          R\         RV R24       R# )c                      ^^ ,           R# r   r   r   r#   r!   r   )TestStack.test_dropping_frames.<locals>.fG  r  r#   c                  `   <  S! 4        R #   \          d   p T P                  u R p ? # R p ? ii ; ir9   )r   r^  )r   r   s    r!   r   )TestStack.test_dropping_frames.<locals>.gJ  s'    ' '&'s    -(--c                   6   a a ] tR tRt oRV 3R lltRtVtV ;t# ).TestStack.test_dropping_frames.<locals>.Skip_GiR  c                H   < VP                   R 8X  d   R# \        SV `	  V4      # r   )rn  r/   r  )r5   r  r3   r6   s   &&&r!   r  CTestStack.test_dropping_frames.<locals>.Skip_G.format_frame_summaryS  s$     %%,w3MBBr#   r   r  )r   r   r   r   r  r   r   rq  rr  s   @@r!   Skip_Gr  R  s     C Cr#   r  r  r  z, in f
    1/0
N)
r>   r  r!  r  r#  rh   ri   r~  r  r  )r5   r   r%   r  stacklnor   s   &     @r!   test_dropping_framesTestStack.test_dropping_framesF  s    		' S	CY++ 	C b!##)68 	 	UQ'jj''!+!Hxj->?	
r#   c           	        R pVP                  R4      pV\        R4      ,           pRpV P                  \        \        4       \        \        R4      ;_uu_ 4       pVP                  V4       RRR4       \        P                  ! \        / 4        \        \        V\        R4      4       R#   + '       g   i     LH; i  \         Ed&   p\        P                  P                  T4      P                  pT P!                  T\        P"                  4       \$        P&                  P(                  P+                  TRTP,                  R7      ;_uu_ 4       pT P/                  \        T4      ^4       T P1                  TP3                  T^,          4      P5                  4       R\         R	2R
T 2.4       TP7                  Y#T.R4       RRR4        Rp?R#   + '       g   i      Rp?R# ; iRp?ii ; i)zabcdef = 1 / 0 and 2.0z1 / 0z)# this line will be used during renderingr{   NrG   _should_show_carets)wrapsr  z", line 1, in <module>rE  )indexri   rb  r   r   r   r   rW  r  rG   rI   r   r>   TracebackExceptionfrom_exceptionr  r  r  unittestmockpatchr`  r  rh   assertListEqualr  r   assert_called_with)	r5   	statementcolno	end_colnocached_linerI  rA   r  ffs	   &        r!   test_summary_should_show_carets)TestStack.test_summary_should_show_caretsb  s    -	(CL(	 B'&#$JJ{# fb)	MFF34  ! 	M ,,;;C@FFA!!!Y%;%;<$$++A/D232G2G , I ILN  Q+$$**1Q40;;="6(*@A{m, %%etLI I I I I	MsD   B,B? ,B<	?G0BG+A3GG+G(G+(G++G0r   N)r   r   r   r   r  r  r  r/  r  r  r  r  r  r  r  r  r  r  r  r  r   r   r   s   @r!   ru  ru    s^     %B$9$22:, F
8!M !Mr#   ru  c                   2   a  ] tR tRt o V 3R lR ltRtV tR# )Unrepresentablei  c                    < V ^8  d   QhRS[ /# )r  r  )r>  )r#  r   s   "r!   r  Unrepresentable.__annotate__  s     + +# +r#   c                    \        R 4      h)r  r  rJ   s   &r!   r^  Unrepresentable.__repr__  s    )**r#   r   Nrg  r   s   @r!   r  r    s     + +r#   r  c                   &   a  ] tR tRt o R tRtV tR# )FalseyExceptioni  c                    R # r  r   rJ   s   &r!   __bool__FalseyException.__bool__      r#   r   Nr   r   r   r   r  r   r   r   s   @r!   r  r          r#   r  c                   &   a  ] tR tRt o R tRtV tR# )FalseyExceptionGroupi  c                    R # r  r   rJ   s   &r!   r  FalseyExceptionGroup.__bool__  r  r#   r   Nr  r   s   @r!   r  r    r  r#   r  c                      a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tR tR tR tR tR tR tR tR tR tR t]! 4       R 4       tR tRtV tR# )TestTracebackExceptioni  c                    Vh  \          di   pTp\        P                  P                  T4      p\        P                  P                  \        P                  ! TP                  4      4      p R p?MR p?ii ; iT P                  R TP                  4       T P                  R TP                  4       T P                  RTP                  4       T P                  YQP                  4       T P                  \        4      ;_uu_ 4        T P                  \        T4      TP                   4       R R R 4       M  + '       g   i     M; iT P                  Y!P"                  4       T P                  \%        T4      \%        T4      4       R # )NF)r   r>   r  r  r  r!  r  r^  rh   	__cause____context____suppress_context__r  assertWarnsDeprecationWarningr  exc_typeexc_type_strr>  )r5   rA   expected_type_strr   exc_objexpected_stacks   &&&   r!   do_test_smoke$TestTracebackException.do_test_smoke  s   	4I 	4G..==a@C&33;;!!!//24N	4
 	s}}-s/ 8 893011T']CLL9 2111*,<,<=Ws3x0s!    A7AA22A7&D55E	c                <    V P                  \        ^*4      R4       R# )rw  r=   N)r  r=   rJ   s   &r!   test_smoke_builtin)TestTracebackException.test_smoke_builtin  s    :b><8r#   c                t     ! R  R\         4      p\        R8X  d   RpMRpV P                  V! R4      V4       R# )c                       ] tR tRtRtR# )ETestTracebackException.test_smoke_user_exception.<locals>.MyExceptioni  r   Nr  r   r#   r!   MyExceptionr        r#   r  r   r  zYtest.test_traceback.TestTracebackException.test_smoke_user_exception.<locals>.MyExceptionzbad things happenedN)r   r   r  )r5   r  rC  s   &  r!   test_smoke_user_exception0TestTracebackException.test_smoke_user_exception  s>    	) 	 z!IHIH;'<=xHr#   c                   R  p V! 4        V P                  pV P                  pV P                  RVP                  4       V P                  RVP                  4       V P                  RVP                  4       V P                  WVP                  4       V P                  \         4      ;_uu_ 4        V P                  \#        X4      VP$                  4       RRR4       V P                  \#        X4      P&                  VP(                  4       V P                  \+        V4      \+        V4      4       R#   \          d~   pTpTP                  p\        P                  P	                  \        P
                  ! T4      ^RRR7      T n        \        P                  P                  T^RRR7      T n	         Rp?ELRp?ii ; i  + '       g   i     L; i)c                      ^^ ,           R# r   r   r   r#   r!   r;  7TestTracebackException.test_from_exception.<locals>.foo  r  r#   FT)r)  r  r  N)r   r^  r>   r  r!  r  r  r  r  rA   rh   r  r  r  r  r  r  r  r  r   r  r>  )r5   r;  r   r  r%   r  rA   s   &      r!   test_from_exception*TestTracebackException.test_from_exception  sj   			EE ,,hhs}}-s/ 8 893011T']CLL9 2g//1A1ABWs3x0#  	EGB"+"8"8"@"@!!"%QU# #A #%D !33BBt C EDHH	E 21s$   D3 0&F>3F;>A2F66F;>G	c                     ^^ ,           \         P                  ! 4       p\        P                  P	                  V4      p\        R4      p\        R4      Vh  \         P                  ! 4       p\        P                  P	                  T4      p\        R4      p\        R4      Th; i  \
         di   pTp\        P                  P	                  T4      p\        P                  P                  \        P                  ! TP                  4      4      p Rp?MRp?ii ; i\        P                  ! \
        XR4      pT P                  YqP                  4       T P                  XTP                  4       T P                  RTP                  4       T P                  YaP                  4       T P                  \         4      ;_uu_ 4        T P                  \#        T4      TP$                  4       RRR4       M  + '       g   i     M; iT P                  \#        T4      P&                  TP(                  4       T P                  \+        T4      \+        T4      4       R# )r   causeuh ohNTr8  r  r>   r  r  r   r  r!  r  r^  rh   r  r  r  r  r  r  r  r  r   r  r>  )r5   rA   exc_contextr'  r   r  r  	exc_causes   &       r!   r  !TestTracebackException.test_cause  s   	44!mmo'::II#N!'*(e3 mmo'::II#N!'*(e3 	4G..==a@C&33;;!!!//24N	4
 00E4H	MM2coo6s7783011T']CLL9 2111g//1A1ABWs3x0s7   	A AB& AB##B& &D1ADD&G22H	c                N     ^^ ,           \         P                  ! 4       p\        P                  P	                  V4      p\        R4      h  \         P                  ! 4       p\        P                  P	                  T4      p\        R4      h; i  \
         di   pTp\        P                  P	                  T4      p\        P                  P                  \        P                  ! TP                  4      4      p Rp?MRp?ii ; iT P                  RTP                  4       T P                  XTP                  4       T P                  RTP                  4       T P                  YQP                  4       T P                  \         4      ;_uu_ 4        T P                  \#        T4      TP$                  4       RRR4       M  + '       g   i     M; iT P                  \#        T4      P&                  TP(                  4       T P                  \+        T4      \+        T4      4       R# )r   r(  NFr)  r5   rA   r*  r   r  r  s   &     r!   r  #TestTracebackException.test_context  s   	4)!mmo'::II#N(( mmo'::II#N(( 	4G..==a@C&33;;!!!//24N	4
 	s}}-coo6 8 893011T']CLL9 2111g//1A1ABWs3x0s6   	A ?B A BB DAC<<D&F??G	c           	       a V3R  lo S! 4        V P                  R4       \        P                  P	                  X4      p\        VP                  4       4      pV P                  \        V4      \        P                  ! 4       4       T P                  \        V Uu. uF  pRV9   g   K  VNK  	  up4      \        P                  ! 4       R,          4       V P                  RVR,          4       R#   \         d   pTp Rp?LRp?ii ; iu upi )c                  N   <  ^^ ,           R#   \          d    S ! 4         R# i ; ir   r   r<  s   r!   r   9TestTracebackException.test_long_context_chain.<locals>.f  s%    !$ s   	 $$zException not raisedNzZeroDivisionError:g      ?z0RecursionError: maximum recursion depth exceededr  )rw  r  r>   r  r  ry  r#  r-  ri   r8  r  rk   )r5   r   r  teresr  r   s   &     @r!   test_long_context_chain.TestTracebackException.test_long_context_chain  s    		.C II,-))88A299; 	3s8S%:%:%<=C=Cq#71#<C=>!!#c)	+ 	>B	I  	G	 >s#   C0 	D
)D
0D;DDc                     ^^ ,           \        R4      p\        R4      Vh  \        R4      p\        R4      Th; i  \          dk   pTp\        P                  P                  TRR7      p\        P                  P                  \        P                  ! TP                  4      4      p Rp?MRp?ii ; i\        P                  ! \         XR4      pT P                  YdP                  4       T P                  RTP                  4       T P                  RTP                  4       T P                  YTP                  4       T P                  \        4      ;_uu_ 4        T P                  \        T4      TP                   4       RRR4       M  + '       g   i     M; iT P                  \        T4      P"                  TP$                  4       T P                  \'        T4      \'        T4      4       R# )r   r'  r(  TcompactN)r   r>   r  r  r  r!  r  r^  rh   r  r  r  r  r  r  r  r  r   r  r>  )r5   r'  r   r  rA   r  r+  s   &      r!   test_compact_with_cause.TestTracebackException.test_compact_with_cause  ss   
	:4!!'*(e3 "'*(e3 	:G..==gt=TC&33;;!!'"7"78:N	:
 00E4H	MM2s/s7783011T']CLL9 2111g//1A1ABWs3x0s.   	# > ;> B3	A B..B3&FF	c                R     ^^ ,           \         P                  ! 4       p\        P                  P	                  V4      p\        R4      h  \         P                  ! 4       p\        P                  P	                  T4      p\        R4      h; i  \
         dk   pTp\        P                  P	                  TRR7      p\        P                  P                  \        P                  ! TP                  4      4      p Rp?MRp?ii ; iT P                  RTP                  4       T P                  XTP                  4       T P                  RTP                  4       T P                  YQP                  4       T P                  \         4      ;_uu_ 4        T P                  \#        T4      TP$                  4       RRR4       M  + '       g   i     M; iT P                  \#        T4      P&                  TP(                  4       T P                  \+        T4      \+        T4      4       R# )r   r(  Tr8  NFr)  r.  s   &     r!   test_compact_no_cause,TestTracebackException.test_compact_no_cause-  s   	:)!mmo'::II#N(( mmo'::II#N(( 	:G..==a=NC&33;;!!'"7"78:N	:
 	s}}-coo6 8 893011T']CLL9 2111g//1A1ABWs3x0s6   	A ?B A BB DA C>>D&GG	c                :    ^^ ,           \        P                  P                  XRR7      pV P	                  \
        4      ;_uu_ 4        V P                  VP                  4       RRR4       R#   \          d   pTp Rp?LvRp?ii ; i  + '       g   i     R# ; i)r   NF)save_exc_type)r   r>   r  r  r  r  r]  r  )r5   r   rA   r3  s   &   r!   test_no_save_exc_type,TestTracebackException.test_no_save_exc_typeC  s    	aC ))88E 9 +011bkk* 21  	C	
 211s#   	A/ 	B	/B:BB	B	c                   R p ^^ ,           \        P                  ! V4      p\        P                  ! VP                  4      p\        P
                  P                  V4      pV P                  \        P                  ! V4      V4       V P                  \        P                  ! VP                  4      V4       R #   \          d   pTp R p?LR p?ii ; ir9   )r   r8  getrefcountr^  r>   r  r  rh   )r5   r  r   refcnt1refcnt2rA   s   &     r!   /test_no_refs_to_exception_and_traceback_objectsFTestTracebackException.test_no_refs_to_exception_and_traceback_objectsN  s    	aC //'*//'"7"78**99'B17;)>)>?I  	G	s   	B: :CCCc                p    ^^ ,           V P	                  XX4       V P                  W44       V P                  V\        4       4       V P                  V\        4       R#   \          dK   pTp\        P                  P                  T4      p\        P                  P                  T4      p Rp?LRp?ii ; ir   )	r   r>   r  r  assertIsNotrh   r_  r`  r	   )r5   r   r  rA   exc2s   &    r!   test_comparison_basic,TestTracebackException.test_comparison_basic[  s    	HaC
 	d##C*i(  	HG..==gFC//>>wGD	Hs   	A   B5+A B00B5c                  a R  oV3R lp V! 4        \        P                  P                  X4      p\        P                  P                  V^
R7      p\        P                  P                  V^R7      pV P	                  WE4       V P                  WF4       \        P                  P                  VRR7      pV P                  WG4       \        P                  P                  VRR7      p\        P                  P                  VRRR7      p	V P	                  W4       \        P                  P                  VRR7      p
\        P                  P                  VRRR7      pV P                  W4       R#   \          d   pTp Rp?ELrRp?ii ; i)	c                  :     \        R 4      h  \          d    h i ; ird  r  r   r#   r!   	raise_excKTestTracebackException.test_comparison_params_variations.<locals>.raise_exch  s$     -- s    c                     < ^^rS! 4        R# r   r   )r  re   rP  s     r!   raise_with_localsSTestTracebackException.test_comparison_params_variations.<locals>.raise_with_localsn  s    aqKr#   Nr(  Tr  )r)  r  r  rY  )r   r>   r  r  rh   r_  )r5   rS  r   r  rA   exc1rK  exc3exc4exc5exc6exc7rP  s   &           @r!   !test_comparison_params_variations8TestTracebackException.test_comparison_params_variationsg  sW   			 **99'B++::7":M++::7!:L#C& ++::7SW:XC& ++::7":M++::7"]a:b$ ++::7":M++::7"]a:bD'-  	G	s   E2 2F
=FF
c                   . p\        ^4       F  p ^^ ,           K  	  V P                  V^ ,          V^,          4       V P                  \        V^ ,          P                  4       4      \        V^,          P                  4       4      4       R#   \         d:   pTP                  \        P                  P                  T4      4        Rp?K  Rp?ii ; i)r  N)	r  r   rG  r>   r  r  rh   ry  r#  )r5   r  r    r   s   &   r!   /test_comparison_equivalent_exceptions_are_equalFTestTracebackException.test_comparison_equivalent_exceptions_are_equal  s    qAL! 
 	a$q'*d1gnn./d1gnn6F1GH  LI88GGJKKLs   	BC.CCc                h    ! R  R\         4      pV! R4      pV! R4      p W2h  T d     Th  T d   pTp Rp? MRp?ii ; ii ; i\        P                  P                  T4      p\	        TP                  4       4      pT P                  RT^,          4       T P                  RT^,          4       R# )c                   &   a  ] tR tRt o R tRtV tR# )CTestTracebackException.test_unhashable.<locals>.UnhashableExceptioni  c                    R # r  r   r  s   &&r!   r  JTestTracebackException.test_unhashable.<locals>.UnhashableException.__eq__  r  r#   r   Nr  r   s   @r!   r  rb    r  r#   r  r  r  NzUnhashableException: ex2
zUnhashableException: ex1
)r   r>   r  r  ry  r#  rk   )r5   r  r  r  r   r  rA   	formatteds   &       r!   r  &TestTracebackException.test_unhashable  s    	) 	 "%(!%(	" 		& 	
 **99'B&	2IaLA2IaLAs&   # A-A<AAAc                N  a V3R  lo S! ^
4       V P                  XXP                  4       R#   \          dk   p\        P                  P                  T^R7      p\        P                  P                  \        P                  ! TP                  4      ^R7      p Rp?LRp?ii ; i)c                 L   < V '       d   S! V ^,
          4       R# ^^ ,           R# r   r   )nrecurses   &r!   rj  2TestTracebackException.test_limit.<locals>.recurse  s    !!r#   r(  N)
r   r>   r  r  r  r!  r  r^  rh   r  )r5   r   rA   r  rj  s   &   @r!   
test_limit!TestTracebackException.test_limit  s    	
	=BK
 	3	  	=..==aq=IC&33;;!!!//2! < =N	=s   / B$A BB$c                   \         P                  ! 4        \        R 4      p\        RR4      p\	        VRR4      p\        V^R^ 4      p\        P                  ! \        WRR7      pV P                  \         P                  / 4       \         P                  ! R\        4       4       V P                  VP                  ^ ,          P                  R4       R# )r(  r  r  NFr  r  )rW  rX  r   r  r  test_tbr>   r  rh   r  r  rZ  r  rO  r5   r   r  r   r%   rA   s   &     r!   test_lookup_lines(TestTracebackException.test_lookup_lines  s    gi*q$%Q4#**9a%P"-i31**L9r#   c                t   \         P                  ! R \        4       4       \        R4      p\	        R R4      p\        V\        4       R^RRR\        4       /4      p\        V^R^ 4      p\        P                  ! \        WRR	7      pV P                  VP                  ^ ,          P                  RR
RRRR/4       R# )r  r(  r  r  r  stringunrepresentableNTr  r  z'string'z<local repr() failed>)rW  r  rZ  r   r  r  r  ro  r>   r  rh   r  r^  rp  s   &     r!   r  "TestTracebackException.test_locals  s    i3gi*q')k1gxIZ\k\m%noQ4#**qT3IIaL#w
4EG^_	ar#   c                L   \         P                  ! R \        4       4       \        R4      p\	        R R4      p\        V\        4       R^/4      p\        V^R^ 4      p\        P                  ! \        W4      pV P                  VP                  ^ ,          P                  R4       R# )r  r(  r  r  N)rW  r  rZ  r   r  r  ro  r>   r  rh   r  r^  rp  s   &     r!   r  %TestTracebackException.test_no_locals  s    i3gi*q')k1%56Q4#**9a<1,,d3r#   c                    \         P                  ! \        \        R 4      R4      pV P                  \	        VP                  4       4      R.4       R# )havenNzException: haven
)r>   r  r   rh   ry  r#  )r5   rA   s   & r!   test_traceback_header,TestTracebackException.test_traceback_header  s<     **9i6H$Ocjjl+.B-CDr#   c                    R  p\         P                  P                  V! 4       RR7      p\        4       pVP	                  VR7       V P                  VP                  4       P                  R4      RR . RO4       R# )c                  R    ^p  V ^ ,           R#   \          d   pTu Rp?# Rp?ii ; i)   Nr  )r  r   s     r!   r   ,TestTracebackException.test_print.<locals>.f  s*    A! s   	 &!&&Tr  rH  rc   NrF  )z    x/0r  z
    x = 12z#ZeroDivisionError: division by zeror   )r>   r  r  r   r  rh   rM  r  )r5   r   rA   r/  s   &   r!   
test_print!TestTracebackException.test_print  sj    	 **99!#d9S		v	OO##D)"#.	r#   c                h    \         \        h  \          d5   pT P                  \        \        P
                  ! T4      4        R p?MR p?ii ; i  ^^ ,           R #   \         d    \         hi ; i  \          d6   pT P                  \        \        P
                  ! T4      4        R p?R # R p?ii ; ir9   )r  rJ  rk   r  r>   r\  r   r  )r5   r   s   & r!   6test_dont_swallow_cause_or_context_of_falsey_exceptionMTestTracebackException.test_dont_swallow_cause_or_context_of_falsey_exception  s    
	H!x/ 	HMM-)C)CA)FGG	H	J&!$ &%%& 	JMM/9+E+Ea+HII	Js8    A*AA	A A..A1 1B1<*B,,B1)rA   r  N)r   r   r   r   r  r  r  r$  r  r  r5  r:  r=  rA  rG  rL  r[  r^  r  rl  rq  r  r  r{  r
   r  r  r   r   r   s   @r!   r	  r	    s     1"9
I12101,I21,1,	+J
)#(JIB&4	:
a4E  $J Jr#   r	  c                   h   a a ] tR tRt oV 3R ltR tR tR tR tR t	R t
R	 tR
 tR tRtVtV ;t# )&TestTracebackException_ExceptionGroupsi  c                N   < \         SV `  4        V P                  4       V n        R # r9   )r/   r0   _get_exception_groupr   r4   s   &r!   r0   ,TestTracebackException_ExceptionGroups.setUp  s    ++-r#   c                   R  pR pVP                   P                  V n        VP                   P                  V n           V! 4         V! ^*4       \        RXX.4      h  \         d   pTp Rp?L)Rp?ii ; i  \         d   pTp Rp?L:Rp?ii ; i  \
         d   pTp Rp?MRp?ii ; i T! ^4       M  \         d   pTp Rp?MRp?ii ; i\        RTX.4      h  \
         d   pTu Rp?# Rp?ii ; i)c                      ^^ ,           R# r   r   r   r#   r!   r   FTestTracebackException_ExceptionGroups._get_exception_group.<locals>.f	  r  r#   c                     \        V 4      hr9   r  r  s   &r!   r   FTestTracebackException_ExceptionGroups._get_exception_group.<locals>.g  s    Q-r#   Nr  r  )r~  r  lno_flno_gr   r   rw  )	r5   r   r   r   rU  rK  rV  rW  r   s	   &        r!   r  ;TestTracebackException_ExceptionGroups._get_exception_group  s    		  ZZ..
ZZ..
	CbE %UT4L99 ! D ! D " "  t55 	I	s    A A8 B A5)A0+B 0A55B 8BB
B 
BB B)B$C $B))C -B6 5C 6CCC CC C5)C0*C50C5c                    V P                   p\        P                  ! \        V4      WP                  4      p\        P                  P                  V4      pV P                  W#4       V P                  W#4       R # r9   )r   r>   r  r  r^  r  rJ  rh   )r5   r   teg1teg2s   &   r!   !test_exception_group_constructionHTestTracebackException_ExceptionGroups.test_exception_group_construction(  sY    WW++DHb:J:JK++::2>$$r#   c                    \         P                  P                  V P                  4      pR P	                  VP                  4       4      P                  R4      pRP                  R4      pV P                  W#4       R# )r   rc   z'ExceptionGroup: eg2 (2 sub-exceptions)
Nr>   r  r  r   r   r?   r  rh   r5   tegre  rC  s   &   r!   *test_exception_group_format_exception_onlyQTestTracebackException_ExceptionGroups.test_exception_group_format_exception_only/  s\    **99$''BGGC5578>>tD	=CCDI-r#   c                    \         P                  P                  V P                  4      pR P	                  VP                  RR7      4      P                  R4      p. ROpV P                  W#4       R# )r   Tr   rc   N)z&ExceptionGroup: eg2 (2 sub-exceptions)z)   ExceptionGroup: eg1 (2 sub-exceptions)z)      ZeroDivisionError: division by zeroz      ValueError: 42z   ValueError: 24r   r  r  s   &   r!   5test_exception_group_format_exception_onlyi_recursive\TestTracebackException_ExceptionGroups.test_exception_group_format_exception_onlyi_recursive6  sZ    **99$''BGGC555FGMMdS	 	-r#   c                   \         P                  P                  V P                  4      pR P	                  VP                  4       4      P                  R4      pV P                  pV P                  p. RNR\         RV^,            R2NRNRNRNR	NR
\         RV^,            R2NRNRNRNRNR\         RV^	,            R2NRNRNR\         RV^,            R2NRNRNRNRNRNR\         RV^,            R2NRNRNR\         RV^,            R2NRNRNRNRNRNR
\         RV^,            R2NRNR NR
\         RV^,            R2NR!NR"NR#NR NpV P                  W%4       R$# )%r   rc   6  + Exception Group Traceback (most recent call last):z  |   File "r  z, in _get_exception_groupz1  |     raise ExceptionGroup("eg2", [exc3, exc4])z*  | ExceptionGroup: eg2 (2 sub-exceptions)(  +-+---------------- 1 ----------------z8    | Exception Group Traceback (most recent call last):z    |   File "z3    |     raise ExceptionGroup("eg1", [exc1, exc2])z,    | ExceptionGroup: eg1 (2 sub-exceptions)*    +-+---------------- 1 ----------------z*      | Traceback (most recent call last):z      |   File "z      |     f()z      |     ~^^r  z      |     1/0z      |     ~^~z+      | ZeroDivisionError: division by zero*      +---------------- 2 ----------------z      |     g(42)z      |     ~^^^^r  z      |     raise ValueError(v)z      | ValueError: 42+      +------------------------------------(    +---------------- 2 ----------------(    | Traceback (most recent call last):z    |     g(24)z    |     ~^^^^z    |     raise ValueError(v)z    | ValueError: 24)    +------------------------------------N)r>   r  r  r   r   r#  r  r  r  r  rh   )r5   r  re  r  r  rC  s   &     r!   test_exception_group_formatBTestTracebackException_ExceptionGroups.test_exception_group_formatD  s   **99$''BGGCJJL)//5	



%L%"8*HU2XJ>WX% H% A	%
 ?% O% %XJhuRxj@YZ% J% C% A% A% 'xjq	AZ[% &% &% 'xjq	H%  &!%" &#%$ B%%& A'%( A)%* 'xjr
B[\+%, (-%. (/%0 'xjq	H1%2 63%4 -5%6 B7%8 ?9%: ?;%< %XJhuRxj@YZ=%> &?%@ &A%B %XJhuQwivFC%D 4E%F +G%H @I%J K%N 	-r#   c                   . p. p\        ^4       F  pVP                  \        V4      4       K  	  \        ^
4       F  pVP                  \        V4      4       K  	  \        pV! RV! RV4      V! RV4      .4      p\
        P                  P                  V^R7      pRP                  VP                  4       4      P                  R4      p. ROpV P                  Wx4       R# )	r  r   r  r  )max_group_widthr   rc   N)z)  | ExceptionGroup: eg (2 sub-exceptions)r  z,    | ExceptionGroup: eg1 (3 sub-exceptions)r  z      | ValueError: 0r        | ValueError: 1,      +---------------- ... ----------------z      | and 1 more exceptionr  r  z-    | ExceptionGroup: eg2 (10 sub-exceptions)r  z      | TypeError: 0r  z      | TypeError: 1r  z      | and 8 more exceptionsr  r   )r  rG  r=   r   r   r>   r  r  r   r#  r  rh   )	r5   excs1excs2r$  r  r   r  re  rC  s	   &        r!   test_max_group_width;TestTracebackException_ExceptionGroups.test_max_group_widtht  s    qALLA' rALL1&  r%'E5)9:;**99"a9PGGCJJL)//5	, 	-r#   c           	     L   \        R 4      p\        ^4       F%  p\        R\        V) 4      V\        V4      .4      pK'  	  \        P
                  P                  V^R7      pRP                  VP                  4       4      P                  R4      p. ROpV P                  WE4       R# )r  rA   )max_group_depthr   rc   N)z*  | ExceptionGroup: exc (3 sub-exceptions)r  z    | ValueError: -2r  z,    | ExceptionGroup: exc (3 sub-exceptions)r  z      | ValueError: -1r  z"      | ... (max_group_depth is 2)z*      +---------------- 3 ----------------r  r  z(    +---------------- 3 ----------------z    | ValueError: 2r  r   )r   r  r   r=   r>   r  r  r   r#  r  rh   )r5   rA   r$  r  re  rC  s   &     r!   test_max_group_depth;TestTracebackException_ExceptionGroups.test_max_group_depth  s    
#qA QBjm(LMC  **99#q9QGGCJJL)//5	$ 	-r#   c                    V P                   h  \         d   pTp R p?MR p?ii ; i\        ^4       F  p Th  \         d   pTp R p?K  R p?ii ; i	  \        P
                  P                  X4      p\        P
                  P                  T4      p\        P
                  P                  TRR7      p\        P
                  P                  T^R7      pT P                  Y%4       T P                  Y%4       T P                  Y&4       T P                  Y'4       T P                  T\        4       4       T P                  T\        4       R # )Ni,  r(  )r   r   r  r   r>   r  r  rJ  rh   r_  r`  r	   )r5   r   rA   r    r  rK  rV  nes   &       r!   test_comparison6TestTracebackException_ExceptionGroups.test_comparison  s   	''M 	C	qA	  
 **99'B++::7C++::7#:N))888J###C$C*i(s%    % %9AAAc                    \        R \        4       \        4       34      h  \         dT   pRP	                  \
        P                  ! T4      4      pT P                  RT4       T P                  RT4        Rp?MRp?ii ; iRp \        R\        4       \        T4      34      h  \         dN   p\
        P                  ! T4      pT P                  \        P                   RT 2TR,          4        Rp?R# Rp?ii ; i)	Gihr   z$+---------------- 1 ----------------z$+---------------- 2 ----------------NboolGahr   rY  )
r  rJ  r&  r   r   r>   r\  rk   r  r   )r5   eestr_excr  s   &   r!   8test_dont_swallow_subexceptions_of_falsey_exceptiongroup_TestTracebackException_ExceptionGroups.test_dont_swallow_subexceptions_of_falsey_exceptiongroup  s    
	K&uxz9;.GHH 	Kggi88<=GMM@'JMM@'JJ	K 	M&uxz?3;O.PQQ 	M004GMM_556b>LL	Ms.     A>A	A99A>B# #C;.AC66C;)r   r  r  )r   r   r   r   r0   r  r  r  r  r  r  r  r  r  r   r   rq  rr  s   @@r!   r  r    sA     .*@%....`$.L.8)*M Mr#   r  c                     a  ] tR tRt o R)R ltR tR tR tR tR t	R	 t
R
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R  t!R! t"R" t#R# t$R$ t%R% t&R& t'R' t(R(t)V t*R# )*SuggestionFormattingTestBasei  Nc                \   aa Se	   VV3R lpMSpV P                  VRR R7      pV^ ,          # )Nc                      < \        SS 4       R # r9   getattr)	attr_nameobjs   r!   rx  =SuggestionFormattingTestBase.get_suggestion.<locals>.callable  s    Y'r#   ry  rz  r  )r{  )r5   r  r  rx  r  s   &ff  r!   get_suggestion+SuggestionFormattingTestBase.get_suggestion  s=     ( H))" * 
 Ar#   c           	     (    ! R  R4      p ! R R4      p ! R R4      p ! R R4      p ! R R	4      p ! R
 R4      p ! R R4      pVR3VR3VR3VR3VR3VR3VR3VR33 F-  w  rV P                  V! 4       R4      p
V P                  W4       K/  	  R# )c                   *    ] tR tRtR;t;t;ttRtRt	R# )KSuggestionFormattingTestBase.test_getattr_suggestions.<locals>.Substitutioni  Nr   )
r   r   r   r   noise
more_noiser  bcblechr   r   r#   r!   Substitutionr    s    *..E.J.REr#   r  c                   *    ] tR tRtR;t;t;ttRtRt	R# )JSuggestionFormattingTestBase.test_getattr_suggestions.<locals>.Eliminationi  Nr   )
r   r   r   r   r  r  r  r  blchr   r   r#   r!   Eliminationr    s    *..E.J.RDr#   r  c                   *    ] tR tRtR;t;t;ttRtRt	R# )GSuggestionFormattingTestBase.test_getattr_suggestions.<locals>.Additioni  Nr   )
r   r   r   r   r  r  r  r  bluchinr   r   r#   r!   Additionr    s    *..E.J.RGr#   r  c                       ] tR tRtRtRtRtR# )ZSuggestionFormattingTestBase.test_getattr_suggestions.<locals>.SubstitutionOverEliminationi  Nr   )r   r   r   r   blachblucr   r   r#   r!   SubstitutionOverEliminationr    s    EDr#   r  c                       ] tR tRtRtRtRtR# )WSuggestionFormattingTestBase.test_getattr_suggestions.<locals>.SubstitutionOverAdditioni  Nr   )r   r   r   r   r  bluchir   r   r#   r!   SubstitutionOverAdditionr    s    EFr#   r  c                       ] tR tRtRtRtRtR# )VSuggestionFormattingTestBase.test_getattr_suggestions.<locals>.EliminationOverAdditioni  Nr   )r   r   r   r   bluchar  r   r   r#   r!   EliminationOverAdditionr    s    FDr#   r  c                   "    ] tR tRtRtRtRtRtR# )YSuggestionFormattingTestBase.test_getattr_suggestions.<locals>.CaseChangeOverSubstitutioni	  Nr   )r   r   r   r   LuchfluchBLuchr   r   r#   r!   CaseChangeOverSubstitutionr  	  s    DEEr#   r  
'bluchin'?'blech'?'blch'?'blach'?'bluc'?'BLuch'?bluchNr  rk   )r5   r  r  r  r  r  r  r  cls
suggestionr  s   &          r!   test_getattr_suggestions5SuggestionFormattingTestBase.test_getattr_suggestions  s    	 		 		 		 		 		 		 	 |$:&)$|$(*5%z2$i0'4	 
OC ((8FMM*-	 
r#   c           	     ^    ! R  R4      pV P                  RV P                  V! 4       R4      4       V P                  RV P                  V! 4       R4      4       V P                  RV P                  V! 4       R4      4        ! R R4      pV P                  RV P                  V! 4       R	4      4       V P                  RV P                  V! 4       R4      4       V P                  RV P                  V! 4       R
4      4       V P                  RV P                  \        V! 4       P                  R	4      4      4       V P                  RV P                  \        V! 4       P                  R4      4      4       V P                  RV P                  \        V! 4       P                  R
4      4      4       R# )c                       ] tR tRtRtRtR# )LSuggestionFormattingTestBase.test_getattr_suggestions_underscored.<locals>.Ai  Nr   r   r   r   r   r  r   r   r#   r!   r   r        Er#   r   'bluch'r  _luch_bluchc                   *   a  ] tR tRt o RtR tRtV tR# )LSuggestionFormattingTestBase.test_getattr_suggestions_underscored.<locals>.Bi#  Nc                    \        W4       R # r9   r  rm  s   &&r!   r  SSuggestionFormattingTestBase.test_getattr_suggestions_underscored.<locals>.B.method%  s
    #r#   r   )r   r   r   r   r  r  r   r   r   s   @r!   r   r	  #  s     F$ $r#   r   '_bluch'_blachr  N)rk   r  r2  r   r  )r5   r   r   s   &  r!   $test_getattr_suggestions_underscoredASuggestionFormattingTestBase.test_getattr_suggestions_underscored  s<   	 	 	i!4!4QS'!BCi!4!4QS'!BCi!4!4QS(!CD	$ 	$
 	j$"5"5ac8"DEj$"5"5ac7"CDT%8%8g%FGj$"5"5gacjj(6S"TUj$"5"5gacjj'6R"STj$"5"5gacjj'6R"STr#   c                l     ! R  R4      pV P                  V! 4       R4      pV P                  RV4       R# )c                       ] tR tRtRtRtR# )cSuggestionFormattingTestBase.test_getattr_suggestions_do_not_trigger_for_long_attributes.<locals>.Ai1  Nr   r   r   r   r   r  r   r   r#   r!   r   r  1  r  r#   r   somethingverywrongr  Nr  r2  r5   r   r  s   &  r!   ;test_getattr_suggestions_do_not_trigger_for_long_attributesXSuggestionFormattingTestBase.test_getattr_suggestions_do_not_trigger_for_long_attributes0  s3    	 	 $$QS*>?&)r#   c                    ! R  R4      pR
 F  pV P                  VR7      ;_uu_ 4        V P                  W4      pV P                  RV4       V P                  RV4       V P                  RV4       V P                  RV4       V P                  RV4       V P                  RV4       R	R	R	4       K  	  R	#   + '       g   i     K  ; i)c                   *    ] tR tRtR;t;t;t;ttRt	R# )oSuggestionFormattingTestBase.test_getattr_error_bad_suggestions_do_not_trigger_for_small_names.<locals>.MyClassi8  Nr   )
r   r   r   r   vvvmomr{   idpythor   r   r#   r!   MyClassr  8  s    )--C-#--Br#   r   rn  Did you meanz'vvv'mom''id''w''pytho'Nr  r  mpyr  r  r2  )r5   r   rn  r  s   &   r!   Atest_getattr_error_bad_suggestions_do_not_trigger_for_small_names^SuggestionFormattingTestBase.test_getattr_error_bad_suggestions_do_not_trigger_for_small_names7  s    	. 	. *D4((,,W;  8  0  &1  0  /  F3 )( *(((s   A>B66Cc                     ! R  R4      p\        R4       F  p\        VRV 2R4       K  	  V P                  V! 4       R4      pV P                  RV4       R# )c                       ] tR tRtRtRtR# )]SuggestionFormattingTestBase.test_getattr_suggestions_do_not_trigger_for_big_dicts.<locals>.AiF  Nr   r  r   r#   r!   r   r/  F  r  r#   r   r  index_Nr  r  )r  setattrr  r2  )r5   r   r  r  s   &   r!   5test_getattr_suggestions_do_not_trigger_for_big_dictsRSuggestionFormattingTestBase.test_getattr_suggestions_do_not_trigger_for_big_dictsE  sU    	 	 4[EAw'. ! $$QS'2&)r#   c                     ! R  R4      pV P                  V! 4       R4      pV P                  RV4        ! R R4      pV P                  V! 4       R4      pV P                  RV4       R# )c                   *   a  ] tR tRt o RtR tRtV tR# )HSuggestionFormattingTestBase.test_getattr_suggestions_no_args.<locals>.AiQ  Nc                    \        4       hr9   AttributeErrorr5   attrs   &&r!   ro  TSuggestionFormattingTestBase.test_getattr_suggestions_no_args.<locals>.A.__getattr__S  s    $&&r#   r   r   r   r   r   r  ro  r   r   r   s   @r!   r   r6  Q  s     E' 'r#   r   r  r  c                   *   a  ] tR tRt o RtR tRtV tR# )r6  iY  Nc                    \         hr9   r8  r:  s   &&r!   ro  r<  [  s    $$r#   r   r=  r   s   @r!   r   r6  Y  s     E% %r#   Nr  r  s   &  r!    test_getattr_suggestions_no_args=SuggestionFormattingTestBase.test_getattr_suggestions_no_argsP  s^    	' 	'
 $$QS'2gv&	% 	%
 $$QS'2gv&r#   c                   a  ! R  R4      o ! V3R lR4      p ! R R4      p ! R R4      pWV3 F,  pV P                  V! 4       R4      pV P                  R	V4       K.  	  R
# )c                       ] tR tRtRtRtRtR# )]SuggestionFormattingTestBase.test_getattr_suggestions_invalid_args.<locals>.NonStringifyClassib  Nr   )r   r   r   r   r   r^  r   r   r#   r!   NonStringifyClassrD  b  s    GHr#   rE  c                   2   <a  ] tR tRt o RtV3R ltRtV tR# )MSuggestionFormattingTestBase.test_getattr_suggestions_invalid_args.<locals>.Aif  Nc                $   < \        S! 4       4      hr9   r8  )r5   r;  rE  s   &&r!   ro  YSuggestionFormattingTestBase.test_getattr_suggestions_invalid_args.<locals>.A.__getattr__h  s    $%6%899r#   r   r=  )r   rE  s   @r!   r   rG  f  s     E: :r#   r   c                   *   a  ] tR tRt o RtR tRtV tR# )MSuggestionFormattingTestBase.test_getattr_suggestions_invalid_args.<locals>.Bik  Nc                    \        R ^4      h)r   r8  r:  s   &&r!   ro  YSuggestionFormattingTestBase.test_getattr_suggestions_invalid_args.<locals>.B.__getattr__m  s    $Wb11r#   r   r=  r   s   @r!   r   rK  k  s     E2 2r#   r   c                   *   a  ] tR tRt o RtR tRtV tR# )MSuggestionFormattingTestBase.test_getattr_suggestions_invalid_args.<locals>.Cip  Nc                    \        ^4      h)rv   r8  r:  s   &&r!   ro  YSuggestionFormattingTestBase.test_getattr_suggestions_invalid_args.<locals>.C.__getattr__r  s    $R((r#   r   r=  r   s   @r!   r   rO  p  s     E) )r#   r   r  r  Nr  )r5   r   r   r   r  r  rE  s   &     @r!   %test_getattr_suggestions_invalid_argsBSuggestionFormattingTestBase.test_getattr_suggestions_invalid_argsa  s]    	 		: 	:
	2 	2
	) 	)
 !9C((8FMM'6* r#   c                l     ! R  R4      pV P                  V! 4       R4      pV P                  RV4       R# )c                   &   a  ] tR tRt o R tRtV tR# )NSuggestionFormattingTestBase.test_getattr_suggestions_for_same_name.<locals>.Aiz  c                    R .# r  r   rJ   s   &r!   __dir__VSuggestionFormattingTestBase.test_getattr_suggestions_for_same_name.<locals>.A.__dir__{  s
    y r#   r   N)r   r   r   r   rY  r   r   r   s   @r!   r   rV  z  s     ! !r#   r   r  r"  Nr  r  s   &  r!   &test_getattr_suggestions_for_same_nameCSuggestionFormattingTestBase.test_getattr_suggestions_for_same_namey  s2    	! 	! $$QS'20r#   c                     ! R  R4      pV P                  V! 4       R4      pV P                  RV4       V P                  RV4       R# )c                   *   a  ] tR tRt o ^tR tRtV tR# )NSuggestionFormattingTestBase.test_attribute_error_with_failing_dict.<locals>.Ti  c                    \        R 4      h)oh no!r8  rJ   s   &r!   rY  VSuggestionFormattingTestBase.test_attribute_error_with_failing_dict.<locals>.T.__dir__  s    $X..r#   r   N)r   r   r   r   r  rY  r   r   r   s   @r!   Tr_    s     E/ /r#   rc  blichr  ra  Nr  )r5   rc  r  s   &  r!   &test_attribute_error_with_failing_dictCSuggestionFormattingTestBase.test_attribute_error_with_failing_dict  sB    	/ 	/
 $$QS'2&)6*r#   c                     ! R  R4      pV! 4       p^VP                   ^ &   V P                  VR4      pV P                  RV4       R# )c                       ] tR tRt^tRtR# )WSuggestionFormattingTestBase.test_attribute_error_with_non_string_candidates.<locals>.Ti  r   Nr  r   r#   r!   rc  ri        Er#   rc  rd  r  N)__dict__r  rk   )r5   rc  instancer  s   &   r!   /test_attribute_error_with_non_string_candidatesLSuggestionFormattingTestBase.test_attribute_error_with_non_string_candidates  sE    	 	 3 !$$Xw7gv&r#   c                f    R  pV P                  VRRR7      pV P                  RVR,          4       R# )c                      \        ^^R7      h)r  )rn  r  r8  r   r#   r!   #raise_attribute_error_with_bad_namelSuggestionFormattingTestBase.test_attribute_error_with_bad_name.<locals>.raise_attribute_error_with_bad_name  s     bb11r#   Nr  rF   r  r{  r2  r5   rq  r  s   &  r!   "test_attribute_error_with_bad_name?SuggestionFormattingTestBase.test_attribute_error_with_bad_name  s<    	2 ))/R4 * 
 	l2./r#   c                   a  ! R  R4      o ! V3R lR4      pV P                  V! 4       R4      pV P                  RV4       V P                  RV4       R# )c                       ] tR tRt^tRtR# )RSuggestionFormattingTestBase.test_attribute_error_inside_nested_getattr.<locals>.Ai  r   Nr  r   r#   r!   r   ry    rj  r#   r   c                   .   <a  ] tR tRt o V3R ltRtV tR# )RSuggestionFormattingTestBase.test_attribute_error_inside_nested_getattr.<locals>.Bi  c                *   < S! 4       pVP                   # r9   )rd  )r5   r;  r  r   s   && r!   __getattribute__cSuggestionFormattingTestBase.test_attribute_error_inside_nested_getattr.<locals>.B.__getattribute__  s    Cwwr#   r   N)r   r   r   r   r}  r   r   )r   r   s   @r!   r   r{    s      r#   r   r  r"  r  Nr  )r5   r   r  r   s   &  @r!   *test_attribute_error_inside_nested_getattrGSuggestionFormattingTestBase.test_attribute_error_inside_nested_getattr  sI    	 		 	
 $$QS+6nf-gv&r#   c                   \        \        P                  ! 4       4      pV P                  \        P
                  V4       \        P                  P                  \        V4      4       V P                  \        P                  P                  4       R P                  \        P                  ! \        P                  ^R7      4      pW#R,           ,          pVP!                  V4       V# )r   )r  z.py)r   r  mkdtemprb  shutilrmtreer8  pathrG  r>  popr   randomchoicesrt  ascii_letters
write_text)r5   r   tmpdirmod_namemodules   &&   r!   make_module(SuggestionFormattingTestBase.make_module  s    h&&()v.F$%776>>&*>*>"EFe+,$r#   c                   a aa S P                  V4      oVVV 3R  lpS P                  \        S4       S P                  VRRR7      pV^ ,          # )c                     <  \        R S RS 24       R#   \         d	   p T RhRp ? i\         d)   p SP                  R\	        T 4       24        Rp ? R# Rp ? ii ; i)zfrom z import NzExpected ImportError but got )rG   r  r   rw  r  )r   modnamern  r5   s    r!   rx  ISuggestionFormattingTestBase.get_import_from_suggestion.<locals>.callable  s\    EuWIXdV45 "T! E		9$q'CDDEs"    A$AAAANr  r  )r  rb  r   r{  )r5   r   rn  rx  r  r  s   f&f  @r!   get_import_from_suggestion7SuggestionFormattingTestBase.get_import_from_suggestion  sQ    ""4(	E 	())" * 
 Ar#   c           	        \         P                  ! R 4      p\         P                  ! R4      p\         P                  ! R4      p\         P                  ! R4      p\         P                  ! R4      p\         P                  ! R4      p\         P                  ! R4      pVR3VR3VR	3VR3VR
3VR
3VR3VR33 F(  w  rV P                  VR4      p
V P                  W4       K*  	  R# )zP            noise = more_noise = a = bc = None
            blech = None
        zP
            noise = more_noise = a = bc = None
            blch = None
        zS
            noise = more_noise = a = bc = None
            bluchin = None
        z:
            blach = None
            bluc = None
        z<
            blach = None
            bluchi = None
        z;
            blucha = None
            bluc = None
        zS
            Luch = None
            fluch = None
            BLuch = None
        r  r  r  r  r  r  r  N)r   r   r  rk   )r5   substitutioneliminationadditionsubstitutionOverEliminationsubstitutionOverAdditioneliminationOverAdditioncaseChangeOverSubstitutionr   r  r  s   &          r!   test_import_from_suggestions9SuggestionFormattingTestBase.test_import_from_suggestions  s    ( 
 oo ' 
 ?? $ 
 '/oo 7 '#
 $,?? 4 $ 
 #+// 3 #
 &.__ 6 &" |$:&)$|$(*5%z2$i0'4	!
D 44T7CFMM*-	!
r#   c                   R pV P                  RV P                  VR4      4       V P                  RV P                  VR4      4       V P                  RV P                  VR4      4       RpV P                  RV P                  VR4      4       V P                  RV P                  VR4      4       V P                  RV P                  VR4      4       R	# )
zbluch = Noner  r  r  r  z_bluch = Noner  r  r  N)rk   r  r2  )r5   r   s   & r!   (test_import_from_suggestions_underscoredESuggestionFormattingTestBase.test_import_from_suggestions_underscored  s    i!@!@w!OPi!@!@w!OPi!@!@x!PQj$"A"A$"QRj$"A"A$"PQT%D%DT7%STr#   c                v    \         P                  ! R 4      pV P                  RV P                  VR4      4       R# )z;            globals()[0] = 1
            bluch = 1
        r  r  N)r   r   rk   r  )r5   modWithNonStringAttrs   & r!   'test_import_from_suggestions_non_stringDSuggestionFormattingTestBase.test_import_from_suggestions_non_string  s5    ' 0   	i!@!@AUW^!_`r#   c                R    R pV P                  VR4      pV P                  RV4       R# )zblech = Noner  r  Nr  )r5   r   r  s   &  r!   ?test_import_from_suggestions_do_not_trigger_for_long_attributes\SuggestionFormattingTestBase.test_import_from_suggestions_do_not_trigger_for_long_attributes  s*    $$T+?@&)r#   c                   R pR	 F  pV P                  VR7      ;_uu_ 4        V P                  W4      pV P                  RV4       V P                  RV4       V P                  RV4       V P                  RV4       V P                  RV4       V P                  RV4       RRR4       K  	  R#   + '       g   i     K  ; i)
z!vvv = mom = w = id = pytho = Noner!  r"  z'vvv'r#  r$  r%  r&  Nr'  )r  r  r2  )r5   r   rn  r  s   &   r!   Etest_import_from_error_bad_suggestions_do_not_trigger_for_small_namesbSuggestionFormattingTestBase.test_import_from_error_bad_suggestions_do_not_trigger_for_small_names  s    2)D4((88D  8  &1  &1  0  /  F3 )( *(((s   A>B..B?c                    \        ^4       Uu. uF	  pRV R2NK  	  ppVP                  R4       RP                  V4      pV P                  VR4      pV P	                  RV4       R# u upi )   r0  z = z Nonerg  r  r  N)r  rG  r   r  r2  )r5   r  chunksr   r  s   &    r!   >test_import_from_suggestions_do_not_trigger_for_big_namespaces[SuggestionFormattingTestBase.test_import_from_suggestions_do_not_trigger_for_big_namespaces  sd    38:>:%F5'%:>gxx00w?&)	 ?s   A'c                f    R  pV P                  VRRR7      pV P                  RVR,          4       R# )c                      \        ^^^R7      h)r  )rn  r  	name_from)r  r   r#   r!   rq  nSuggestionFormattingTestBase.test_import_from_error_with_bad_name.<locals>.raise_attribute_error_with_bad_name'  s    22<<r#   Nr  rF   r  rs  rt  s   &  r!   $test_import_from_error_with_bad_nameASuggestionFormattingTestBase.test_import_from_error_with_bad_name&  s<    	= ))/R4 * 
 	l2./r#   c                    R  pR pR pR pR pR pVR3VR3VR3VR	3VR
3VR
33 F'  w  rxV P                  V4      p	V P                  W4       K)  	  R# )c                  6    R ;p ;p;r#R p\        \        4       R # r9   r  r  )r  r  r  r  r  s        r!   r  NSuggestionFormattingTestBase.test_name_error_suggestions.<locals>.Substitution0  s     *..E.J.E%Lr#   c                  6    R ;p ;p;r#R p\        \        4       R # r9   r  )r  r  r  r  r  s        r!   r  MSuggestionFormattingTestBase.test_name_error_suggestions.<locals>.Elimination5  s     *..E.J.D%Lr#   c                  6    R ;p ;p;r#R p\        \        4       R # r9   r  )r  r  r  r  r  s        r!   r  JSuggestionFormattingTestBase.test_name_error_suggestions.<locals>.Addition:  s     *..E.J.G%Lr#   c                  ,    R p R p\        \        4       R # r9   r  )r  r  s     r!   r  ]SuggestionFormattingTestBase.test_name_error_suggestions.<locals>.SubstitutionOverElimination?  s    ED%Lr#   c                  ,    R p R p\        \        4       R # r9   r  )r  r  s     r!   r  ZSuggestionFormattingTestBase.test_name_error_suggestions.<locals>.SubstitutionOverAdditionD  s    EF%Lr#   c                  ,    R p R p\        \        4       R # r9   r  )r  r  s     r!   r  YSuggestionFormattingTestBase.test_name_error_suggestions.<locals>.EliminationOverAdditionI  s    FD%Lr#   r  r  r  z	'blucha'?r  Nr  )
r5   r  r  r  r  r  r  r@   r  r  s
   &         r!   test_name_error_suggestions8SuggestionFormattingTestBase.test_name_error_suggestions/  s    	
	
	
	
	
	
 #/
!;!,i 8!)< 8!8+ F!<j I!9: F!HD ((.FMM*-!Hr#   c                R    R  pV P                  V4      pV P                  RV4       R# )c                  $    \        \        4       R # r9   )r  global_for_suggestior   r#   r!   r@   SSuggestionFormattingTestBase.test_name_error_suggestions_from_globals.<locals>.funcX  s    &'r#   z'global_for_suggestions'?Nr  r5   r@   r  s   &  r!   (test_name_error_suggestions_from_globalsESuggestionFormattingTestBase.test_name_error_suggestions_from_globalsW  s&    	($$T*16:r#   c                R    R  pV P                  V4      pV P                  RV4       R# )c                  $    \        \        4       R # r9   )r  ZeroDivisionErrrrrr   r#   r!   r@   TSuggestionFormattingTestBase.test_name_error_suggestions_from_builtins.<locals>.func^  s    $%r#   'ZeroDivisionError'?Nr  r  s   &  r!   )test_name_error_suggestions_from_builtinsFSuggestionFormattingTestBase.test_name_error_suggestions_from_builtins]  s&    	&$$T*,f5r#   c                R    R  pV P                  V4      pV P                  RV4       R# )c                  r    \        4       P                  4       p \        V R &   \        \	        RV 4      4       R# )__builtins__r  N)rZ  copyr   r  eval)custom_globalss    r!   r@   lSuggestionFormattingTestBase.test_name_error_suggestions_from_builtins_when_builtins_is_module.<locals>.funcd  s*    $Y^^-N-5N>*$+^<=r#   r  Nr  r  s   &  r!   Atest_name_error_suggestions_from_builtins_when_builtins_is_module^SuggestionFormattingTestBase.test_name_error_suggestions_from_builtins_when_builtins_is_modulec  s(    	> $$T*,f5r#   c                R    R  pV P                  V4      pV P                  RV4       R# )c                      ^p \        4       P                  4       p^V^ &   \        \        RV\	        4       4      4       R# )r   abvN)rZ  r  r  r  r^  )abcr  s     r!   r@   aSuggestionFormattingTestBase.test_name_error_suggestions_with_non_string_candidates.<locals>.funcl  s2    C$Y^^-N !N1$unfh78r#   r  Nr  r  s   &  r!   6test_name_error_suggestions_with_non_string_candidatesSSuggestionFormattingTestBase.test_name_error_suggestions_with_non_string_candidatesk  s'    	9
 $$T*eV$r#   c                R    R  pV P                  V4      pV P                  RV4       R# )c                  (    R p \        \        4       R # r9   )r  somethingverywronghe)somethingverywronghehehehehehes    r!   r@   dSuggestionFormattingTestBase.test_name_error_suggestions_do_not_trigger_for_long_names.<locals>.funcu  s    -1*&'r#   somethingverywrongheheNr  r  s   &  r!   9test_name_error_suggestions_do_not_trigger_for_long_namesVSuggestionFormattingTestBase.test_name_error_suggestions_do_not_trigger_for_long_namest  s*    	( $$T*16:r#   c                   R  pR pR pR pRV3RV3RV3RV33 F  w  rVV P                  VR7      ;_uu_ 4        V P                  V4      pV P                  R	V4       V P                  R
V4       V P                  RV4       V P                  RV4       V P                  RV4       V P                  RV4       RRR4       K  	  R#   + '       g   i     K  ; i)c                  $    R ;p ;p;p;r4\          R # r9   r   r  r  r{   r  r  s        r!   f_bhSuggestionFormattingTestBase.test_name_error_bad_suggestions_do_not_trigger_for_small_names.<locals>.f_b}      )--C-#--Br#   c                  $    R ;p ;p;p;r4\          R # r9   r  r  s        r!   f_vhSuggestionFormattingTestBase.test_name_error_bad_suggestions_do_not_trigger_for_small_names.<locals>.f_v  r  r#   c                  $    R ;p ;p;p;r4\          R # r9   )r(  r  s        r!   f_mhSuggestionFormattingTestBase.test_name_error_bad_suggestions_do_not_trigger_for_small_names.<locals>.f_m  r  r#   c                  $    R ;p ;p;p;r4\          R # r9   )r)  r  s        r!   f_pyiSuggestionFormattingTestBase.test_name_error_bad_suggestions_do_not_trigger_for_small_names.<locals>.f_py  s    )--C-#--Br#   r  r  r(  r)  r!  zyou meanr  r  r$  r%  r&  Nr*  )r5   r  r  r  r  rn  r@   r  s   &       r!   >test_name_error_bad_suggestions_do_not_trigger_for_small_names[SuggestionFormattingTestBase.test_name_error_bad_suggestions_do_not_trigger_for_small_names{  s    				  :SzC:d|LJD4((,,T2  V4  /  /  0  /  F3 )( M(((s   A>CCc                R    R  pV P                  V4      pV P                  VR4       R# )c                     R ;p ;p;p;p;p;p;p;p;p;p	;p
;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p ;p!;p";p#;p$;p%;p&;p';p(;p);p*;p+;p,;p-;p.;p/;p0;p1;p2;p3;p4;p5;p6;p7;p8;p9;p:;p;;p<;p=;p>;p?;p@;pA;pB;pC;pD;pE;pF;pG;pH;pI;pJ;pK;pL;pM;pN;pO;pP;pQ;pR;pS;pT;pU;pV;pW;pX;pY;pZ;p[;p\;p];p^;p_;p`;pa;pb;pc;pd;pe;pf;pg;ph;pi;pj;pk;pl;pm;pn;po;pp;pq;pr;ps;pt;pu;pv;pw;px;py;pz;p{;p|;p};p~;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;p;Ep ;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep	;Ep
;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep ;Ep!;Ep";Ep#;Ep$;Ep%;Ep&;Ep';Ep(;Ep);Ep*;Ep+;Ep,;Ep-;Ep.;Ep/;Ep0;Ep1;Ep2;Ep3;Ep4;Ep5;Ep6;Ep7;Ep8;Ep9;Ep:;Ep;;Ep<;Ep=;Ep>;Ep?;Ep@;EpA;EpB;EpC;EpD;EpE;EpF;EpG;EpH;EpI;EpJ;EpK;EpL;EpM;EpN;EpO;EpP;EpQ;EpR;EpS;EpT;EpU;EpV;EpW;EpX;EpY;EpZ;Ep[;Ep\;Ep];Ep^;Ep_;Ep`;Epa;Epb;Epc;Epd;Epe;Epf;Epg;Eph;Epi;Epj;Epk;Epl;Epm;Epn;Epo;Epp;Epq;Epr;Eps;Ept;Epu;Epv;Epw;Epx;Epy;Epz;Ep{;Ep|;Ep};Ep~;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep ;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep	;Ep
;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep ;Ep!;Ep";Ep#;Ep$;Ep%;Ep&;Ep';Ep(;Ep);Ep*;Ep+;Ep,;Ep-;Ep.;Ep/;Ep0;Ep1;Ep2;Ep3;Ep4;Ep5;Ep6;Ep7;Ep8;Ep9;Ep:;Ep;;Ep<;Ep=;Ep>;Ep?;Ep@;EpA;EpB;EpC;EpD;EpE;EpF;EpG;EpH;EpI;EpJ;EpK;EpL;EpM;EpN;EpO;EpP;EpQ;EpR;EpS;EpT;EpU;EpV;EpW;EpX;EpY;EpZ;Ep[;Ep\;Ep];Ep^;Ep_;Ep`;Epa;Epb;Epc;Epd;Epe;Epf;Epg;Eph;Epi;Epj;Epk;Epl;Epm;Epn;Epo;Epp;Epq;Epr;Eps;Ept;Epu;Epv;Epw;Epx;Epy;Epz;Ep{;Ep|;Ep};Ep~;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep ;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep	;Ep
;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;Ep;EpEp\        \        4       R # r9   )r  a0(   a1a2a3a4a5a6a7a8a9a10a11a12a13a14a15a16a17a18a19a20a21a22a23a24a25a26a27a28a29a30a31a32a33a34a35a36a37a38a39a40a41a42a43a44a45a46a47a48a49a50a51a52a53a54a55a56a57a58a59a60a61a62a63a64a65a66a67a68a69a70a71a72a73a74a75a76a77a78a79a80a81a82a83a84a85a86a87a88a89a90a91a92a93a94a95a96a97a98a99a100a101a102a103a104a105a106a107a108a109a110a111a112a113a114a115a116a117a118a119a120a121a122a123a124a125a126a127a128a129a130a131a132a133a134a135a136a137a138a139a140a141a142a143a144a145a146a147a148a149a150a151a152a153a154a155a156a157a158a159a160a161a162a163a164a165a166a167a168a169a170a171a172a173a174a175a176a177a178a179a180a181a182a183a184a185a186a187a188a189a190a191a192a193a194a195a196a197a198a199a200a201a202a203a204a205a206a207a208a209a210a211a212a213a214a215a216a217a218a219a220a221a222a223a224a225a226a227a228a229a230a231a232a233a234a235a236a237a238a239a240a241a242a243a244a245a246a247a248a249a250a251a252a253a254a255a256a257a258a259a260a261a262a263a264a265a266a267a268a269a270a271a272a273a274a275a276a277a278a279a280a281a282a283a284a285a286a287a288a289a290a291a292a293a294a295a296a297a298a299a300a301a302a303a304a305a306a307a308a309a310a311a312a313a314a315a316a317a318a319a320a321a322a323a324a325a326a327a328a329a330a331a332a333a334a335a336a337a338a339a340a341a342a343a344a345a346a347a348a349a350a351a352a353a354a355a356a357a358a359a360a361a362a363a364a365a366a367a368a369a370a371a372a373a374a375a376a377a378a379a380a381a382a383a384a385a386a387a388a389a390a391a392a393a394a395a396a397a398a399a400a401a402a403a404a405a406a407a408a409a410a411a412a413a414a415a416a417a418a419a420a421a422a423a424a425a426a427a428a429a430a431a432a433a434a435a436a437a438a439a440a441a442a443a444a445a446a447a448a449a450a451a452a453a454a455a456a457a458a459a460a461a462a463a464a465a466a467a468a469a470a471a472a473a474a475a476a477a478a479a480a481a482a483a484a485a486a487a488a489a490a491a492a493a494a495a496a497a498a499a500a501a502a503a504a505a506a507a508a509a510a511a512a513a514a515a516a517a518a519a520a521a522a523a524a525a526a527a528a529a530a531a532a533a534a535a536a537a538a539a540a541a542a543a544a545a546a547a548a549a550a551a552a553a554a555a556a557a558a559a560a561a562a563a564a565a566a567a568a569a570a571a572a573a574a575a576a577a578a579a580a581a582a583a584a585a586a587a588a589a590a591a592a593a594a595a596a597a598a599a600a601a602a603a604a605a606a607a608a609a610a611a612a613a614a615a616a617a618a619a620a621a622a623a624a625a626a627a628a629a630a631a632a633a634a635a636a637a638a639a640a641a642a643a644a645a646a647a648a649a650a651a652a653a654a655a656a657a658a659a660a661a662a663a664a665a666a667a668a669a670a671a672a673a674a675a676a677a678a679a680a681a682a683a684a685a686a687a688a689a690a691a692a693a694a695a696a697a698a699a700a701a702a703a704a705a706a707a708a709a710a711a712a713a714a715a716a717a718a719a720a721a722a723a724a725a726a727a728a729a730a731a732a733a734a735a736a737a738a739a740a741a742a743a744a745a746a747a748a749a750a751a752a753a754a755a756a757a758a759a760a761a762a763a764a765a766a767a768a769a770a771a772a773a774a775a776a777a778a779a780a781a782a783a784a785a786a787a788a789a790a791a792a793a794a795a796a797a798a799a800s                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   r!   r@   iSuggestionFormattingTestBase.test_name_error_suggestions_do_not_trigger_for_too_many_locals.<locals>.func  sO'   d aPB P Pb P2 P PR P" Pr PB P PPPP!P$'P*-P03P69P<?PBEPPPP!P$'P*-P03P69P<?PBEP P P P "P %(P +.P 14P 7:P =@P CFP 	P 	P 	P "	P %(	P +.	P 14	P 7:	P =@	P CF	P
 P
 P
 P
 "P
 %(P
 +.P
 14P
 7:P
 =@P
 CFP P P P "P %(P +.P 14P 7:P =@P CFP P P P "P %(P +.P 14P 7:P =@P CFP P P P "P %(P +.P 14P 7:P =@P CFP P P P "P %(P +.P 14P 7:P =@P CGP P P P "&P )-P 04P 7;P >BP EIP LPP P P P "&P )-P 04P 7;P >BP EIP LPP P P P "&P )-P 04P 7;P >BP EIP LPP P P P "&P )-P 04P 7;P >BP EIP LPP P P P "&P )-P 04P 7;P >BP EIP LPP P P P "&P )-P 04P 7;P >BP EIP LPP  !P  !P  !P  "&!P  )-!P  04!P  7;!P  >B!P  EI!P  LP!P" #P" #P" #P" "&#P" )-#P" 04#P" 7;#P" >B#P" EI#P" LP#P$ %P$ %P$ %P$ "&%P$ )-%P$ 04%P$ 7;%P$ >B%P$ EI%P$ LP%P& 'P& 'P& 'P& "&'P& )-'P& 04'P& 7;'P& >B'P& EI'P& LP'P( )P( )P( )P( "&)P( )-)P( 04)P( 7;)P( >B)P( EI)P( LP)P* +P* +P* +P* "&+P* )-+P* 04+P* 7;+P* >B+P* EI+P* LP+P, -P, -P, -P, "&-P, )--P, 04-P, 7;-P, >B-P, EI-P, LP-P. /P. /P. /P. "&/P. )-/P. 04/P. 7;/P. >B/P. EI/P. LP/P0 1P0 1P0 1P0 "&1P0 )-1P0 041P0 7;1P0 >B1P0 EI1P0 LP1P2 3P2 3P2 3P2 "&3P2 )-3P2 043P2 7;3P2 >B3P2 EI3P2 LP3P4 5P4 5P4 5P4 "&5P4 )-5P4 045P4 7;5P4 >B5P4 EI5P4 LP5P6 7P6 7P6 7P6 "&7P6 )-7P6 047P6 7;7P6 >B7P6 EI7P6 LP7P8 9P8 9P8 9P8 "&9P8 )-9P8 049P8 7;9P8 >B9P8 EI9P8 LP9P: ;P: ;P: ;P: "&;P: )-;P: 04;P: 7;;P: >B;P: EI;P: LP;P< =P< =P< =P< "&=P< )-=P< 04=P< 7;=P< >B=P< EI=P< LP=P> ?P> ?P> ?P> "&?P> )-?P> 04?P> 7;?P> >B?P> EI?P> LP?P@ AP@ AP@ AP@ "&AP@ )-AP@ 04AP@ 7;AP@ >BAP@ EIAP@ LPAPB CPB CPB CPB "&CPB )-CPB 04CPB 7;CPB >BCPB EICPB LPCPD EPD EPD EPD "&EPD )-EPD 04EPD 7;EPD >BEPD EIEPD LPEPF GPF GPF GPF "&GPF )-GPF 04GPF 7;GPF >BGPF EIGPF LPGPH IPH IPH IPH "&IPH )-IPH 04IPH 7;IPH >BIPH EIIPH LPIPJ KPJ KPJ KPJ "&KPJ )-KPJ 04KPJ 7;KPJ >BKPJ EIKPJ LPKPL MPL MPL MPL "&MPL )-MPL 04MPL 7;MPL >BMPL EIMPL LPMPN OPN OPN OPN "&OPN )-OPN 04OPN 7;OPN >BOPN EIOPN LPOPP QPP QPP QPP "&QPP )-QPP 04QPP 7;QPP >BQPP EIQPP LPQPR SPR SPR SPR "&SPR )-SPR 04SPR 7;SPR >BSPR EISPR LPSPT UPT UPT UPT "&UPT )-UPT 04UPT 7;UPT >BUPT EIUPT LPUPV WPV WPV WPV "&WPV )-WPV 04WPV 7;WPV >BWPV EIWPV LPWPX YPX YPX YPX "&YPX )-YPX 04YPX 7;YPX >BYPX EIYPX LPYPZ [PZ [PZ [PZ "&[PZ )-[PZ 04[PZ 7;[PZ >B[PZ EI[PZ LP[P\ ]P\ ]P\ ]P\ "&]P\ )-]P\ 04]P\ 7;]P\ >B]P\ EI]P\ LP]P^ _P^ _P^ _P^ "&_P^ )-_P^ 04_P^ 7;_P^ >B_P^ EI_P^ LP_P` aP` aP` aP` "&aP` )-aP` 04aP` 7;aP` >BaP` EIaP` LPaPb cPb cPb cPb "&cPb )-cPb 04cPb 7;cPb >BcPb EIcPb LPcPd ePd ePd ePd "&ePd )-ePd 04ePd 7;ePd >BePd EIePd LPePf gPf gPf gPf "&gPf )-gPf 04gPf 7;gPf >BgPf EIgPf LPgPh iPh iPh iPh "&iPh )-iPh 04iPh 7;iPh >BiPh EIiPh LPiPj kPj kPj kPj "&kPj )-kPj 04kPj 7;kPj >BkPj EIkPj LPkPl mPl mPl mPl "&mPl )-mPl 04mPl 7;mPl >BmPl EImPl LPmPn oPn oPn oPn "&oPn )-oPn 04oPn 7;oPn >BoPn EIoPn LPoPp qPp qPp qPp "&qPp )-qPp 04qPp 7;qPp >BqPp EIqPp LPqPr sPr sPr sPr "&sPr )-sPr 04sPr 7;sPr >BsPr EIsPr LPsPt uPt uPt uPt "&uPt )-uPt 04uPt 7;uPt >BuPt EIuPt LPuPv wPv wPv wPv "&wPv )-wPv 04wPv 7;wPv >BwPv EIwPv LPwPx yPx yPx yPx "&yPx )-yPx 04yPx 7;yPx >ByPx EIyPx LPyPz {Pz {Pz {Pz "&{Pz )-{Pz 04{Pz 7;{Pz >B{Pz EI{Pz LP{P| }P| }P| }P| "&}P| )-}P| 04}P| 7;}P| >B}P| EI}P| LP}P~ P~ P~ P~ "&P~ )-P~ 04P~ 7;P~ >BP~ EIP~ LPP@ AP@ AP@ AP@ "&AP@ )-AP@ 04AP@ 7;AP@ >BAP@ EIAP@ LPAPB CPB CPB CPB "&CPB )-CPB 04CPB 7;CPB >BCPB EICPB LPCPD EPD EPD EPD "&EPD )-EPD 04EPD 7;EPD >BEPD EIEPD LPEPF GPF GPF GPF "&GPF )-GPF 04GPF 7;GPF >BGPF EIGPF LPGPH IPH IPH IPH "&IPH )-IPH 04IPH 7;IPH >BIPH EIIPH LPIPJ KPJ KPJ KPJ "&KPJ )-KPJ 04KPJ 7;KPJ >BKPJ EIKPJ LPKPL MPL MPL MPL "&MPL )-MPL 04MPL 7;MPL >BMPL EIMPL LPMPN OPN OPN OPN "&OPN )-OPN 04OPN 7;OPN >BOPN EIOPN LPOPP QPP QPP QPP "&QPP )-QPP 04QPP 7;QPP >BQPP EIQPP LPQPR SPR SPR SPR "&SPR )-SPR 04SPR 7;SPR >BSPR EISPR LPSPT UPT UPT UPT "&UPT )-UPT 04UPT 7;UPT >BUPT EIUPT LPUPV WPV WPV WPV "&WPV )-WPV 04WPV 7;WPV >BWPV EIWPV LPWPX YPX YPX YPX "&YPX )-YPX 04YPX 7;YPX >BYPX EIYPX LPYPZ [PZ [PZ [PZ "&[PZ )-[PZ 04[PZ 7;[PZ >B[PZ EI[PZ LP[P\ ]P\ ]P\ ]P\ "&]P\ )-]P\ 04]P\ 7;]P\ >B]P\ EI]P\ LP]P^ _P^ _P^ _P^ "&_P^ )-_P^ 04_P^ 7;_P^ >B_P^ EI4"Ir#   zNameError.*a1N)r  assertNotRegexr  s   &  r!   >test_name_error_suggestions_do_not_trigger_for_too_many_locals[SuggestionFormattingTestBase.test_name_error_suggestions_do_not_trigger_for_too_many_locals  s,    S	j $$T*F$45r#   c                    R  pV P                  V4      pV P                  RV4       R pV P                  V4      pV P                  RV4       R# )c                      R p \        4       hr9   r&  rX  s    r!   r@   QSuggestionFormattingTestBase.test_name_error_with_custom_exceptions.<locals>.func  s    E+r#   r  c                      R p \         hr9   r(  rX  s    r!   r@   r)    s    EOr#   Nr  r  s   &  r!   &test_name_error_with_custom_exceptionsCSuggestionFormattingTestBase.test_name_error_with_custom_exceptions  sP    	 $$T*&)	 $$T*&)r#   c                     ! R  R4      pV! 4       pV P                  VP                  4      pV P                  RV4       R# )c                   ,   a  ] tR tRt o R tR tRtV tR# )ESuggestionFormattingTestBase.test_name_error_with_instance.<locals>.Ai   c                    R V n         R # r9   rX  rJ   s   &r!   __init__NSuggestionFormattingTestBase.test_name_error_with_instance.<locals>.A.__init__  	    !
r#   c                    ^p\         pR# r   rX  )r5   rd  r  s   &  r!   r;  ISuggestionFormattingTestBase.test_name_error_with_instance.<locals>.A.foo  s    r#   rX  Nr   r   r   r   r1  r;  r   r   r   s   @r!   r   r/     s     " r#   r   
self.blechN)r  r;  rk   r5   r   rl  r  s   &   r!   test_name_error_with_instance:SuggestionFormattingTestBase.test_name_error_with_instance  s7    	 	 3$$X\\2lF+r#   c                     ! R  R4      pV! 4       pV P                  VP                  4      pV P                  RV4       R# )c                   ,   a  ] tR tRt o R tR tRtV tR# )NSuggestionFormattingTestBase.test_unbound_local_error_with_instance.<locals>.Ai  c                    R V n         R # r9   rX  rJ   s   &r!   r1  WSuggestionFormattingTestBase.test_unbound_local_error_with_instance.<locals>.A.__init__  r3  r#   c                    ^pXp^pR# r   r   )r5   rd  r  r  s   &   r!   r;  RSuggestionFormattingTestBase.test_unbound_local_error_with_instance.<locals>.A.foo  s    r#   rX  Nr6  r   s   @r!   r   r=    s     " r#   r   r7  N)r  r;  r2  r8  s   &   r!   &test_unbound_local_error_with_instanceCSuggestionFormattingTestBase.test_unbound_local_error_with_instance  s9    	 	 3$$X\\2v.r#   c                *    ! R  R4      pV P                  V! 4       P                  4      pV P                  RV4       V P                  RV4       V P                  V! 4       P                  4      pV P                  RV4       V P                  RV4       R# )c                   2   a  ] tR tRt o R tR tR tRtV tR# )QSuggestionFormattingTestBase.test_unbound_local_error_with_side_effect.<locals>.Ai  c                N    VR 8X  d   \        R 4      hVR8X  d   \        R4      hR# )r;  spamN)r9  r=   )r5   keys   &&r!   ro  ]SuggestionFormattingTestBase.test_unbound_local_error_with_side_effect.<locals>.A.__getattr__  s+    %<(//&=$V,, !r#   c                    \          R # r9   r  rJ   s   &r!   barUSuggestionFormattingTestBase.test_unbound_local_error_with_side_effect.<locals>.A.bar!  s    r#   c                    \          R # r9   )rH  rJ   s   &r!   bazUSuggestionFormattingTestBase.test_unbound_local_error_with_side_effect.<locals>.A.baz#  s    r#   r   N)	r   r   r   r   ro  rL  rO  r   r   r   s   @r!   r   rF    s     - r#   r   zself.z'foo'z'spam'N)r  rL  r2  rk   rO  )r5   r   r  s   &  r!   )test_unbound_local_error_with_side_effectFSuggestionFormattingTestBase.test_unbound_local_error_with_side_effect  sv    
	 
	 ((1
*-gz*((1
*-h
+r#   c                R    R  pV P                  V4      pV P                  RV4       R# )c                  $    ^p \        X4       ^pR# )r  Nr  )r  	somethongs     r!   r@   RSuggestionFormattingTestBase.test_unbound_local_error_does_not_match.<locals>.func/  s    I)Ir#   r  Nr  r  s   &  r!   'test_unbound_local_error_does_not_matchDSuggestionFormattingTestBase.test_unbound_local_error_does_not_match.  s)    	
 $$T*f-r#   c                R    R  pV P                  V4      pV P                  RV4       R# )c                  .    \         P                  4       p R # r9   )ior   streams    r!   r@   MSuggestionFormattingTestBase.test_name_error_for_stdlib_modules.<locals>.func8  s    [[]Fr#   zforget to import 'io'Nr  r  s   &  r!   "test_name_error_for_stdlib_modules?SuggestionFormattingTestBase.test_name_error_for_stdlib_modules7  s(    	# $$T*-v6r#   c                R    R  pV P                  V4      pV P                  RV4       R# )c                  .    \         P                  4       p R # r9   )_ior   r\  s    r!   r@   USuggestionFormattingTestBase.test_name_error_for_private_stdlib_modules.<locals>.func?  s    \\^Fr#   zforget to import '_io'Nr  r  s   &  r!   *test_name_error_for_private_stdlib_modulesGSuggestionFormattingTestBase.test_name_error_for_private_stdlib_modules>  s(    	$ $$T*.7r#   r   r9   )+r   r   r   r   r  r  r  r  r+  r2  r@  rR  r[  re  rm  ru  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r$  r+  r9  rB  rQ  rW  r_  re  r   r   r   s   @r!   r  r    s     
).VU**4	*'"+01+'0'"0.d	Ua*4*0&.P;66%;48W6r*
,/,,.78 8r#   r  c                       ] tR tRtRtR# )#PurePythonSuggestionFormattingTestsiG  r   Nr  r   r#   r!   rh  rh  G  s    
 	r#   rh  c                       ] tR tRtRtR# ) CPythonSuggestionFormattingTestsiR  r   Nr  r   r#   r!   rj  rj  R  s     	r#   rj  c                   l   a  ] tR tRt o R tR t]P                  ! R4      R 4       t]	R 4       t
RtV tR# )	MiscTesti]  c                "   \        4       p\        \        4       FQ  pVP                  R 4      '       d   K  \	        \        V4      p\	        VRR4      R8X  g   K@  VP                  V4       KS  	  V P                  \        P                  V4       R# )r    r   Nr>   )rN  dirr>   r  r  rJ  assertCountEqual__all__)r5   rC  rn  module_objects   &   r!   test_allMiscTest.test_all_  sj    5	NDs###It4M}lD9[HT" # 	i//:r#   c                  a  V 3R  lpV! RR^ 4       V! RR^4       V! RR^4       V! RR^4       V! RR^4       V! RR	^4       V! R
R^4       V! RR^4       V! RR^4       V! RR^4       V! RR^4       V! RR^4       V! RR^4       V! RR^4       V! RR^4       V! RR^
4       V! RR^4       V! RR^4       V! RR^
4       V! R R!^4       R"# )#c                 X   < \         P                  ! WR 4      pSP                  W24       R# )i  N)r>   _levenshtein_distancerh   )r  r  rC  r  r5   s   &&& r!   CHECK1MiscTest.test_levenshtein_distance.<locals>.CHECKm  s#    44Q4@FV.r#   r   r  r   AppleApleBananazB@n@n@CherryzCherry!z---0---z------r  re   rQ  bbaaaaaAAAAAwxyzwXyZwXyZ123PythonJavazC#AbstractFoobarManagerabstract_foobar_managerCPythonPyPypypyr9  AttributeErropAttributeErrorTestsABAAABNr   )r5   rw  s   f r!   test_levenshtein_distance"MiscTest.test_levenshtein_distancei  s    	/ 	b"ab#qc3gvq!h!$h	1%i1%eS!dD!gw"ffa fi#h#fdA%'@%Hi$i$ 0!4 5r:eUAr#   cpuc           	     |   \         P                  4       '       g   V P                  \          R 24       \         P                  R4      ;_uu_ 4       p\        P
                  ! V4      pRRR4       X F  w  r4p\        P                  ! W4R4      pV P                  WeW43R7       WU^,           V^,           3 F/  p\        P                  ! W4V4      pV P                  WW4V3R7       K1  	  \        V4       F/  p\        P                  ! W4V4      p	V P                  WW4V3R7       K1  	  K  	  R#   + '       g   i     L; i)z. is missing. Run `make regen-test-levenshtein`rNr  )r  )LEVENSHTEIN_DATA_FILEis_filerw  r   jsonloadr>   rv  rh   r  r-  )
r5   r   examplesr  r  rC  res1	thresholdres2res3s
   &         r!   'test_levenshtein_distance_short_circuit0MiscTest.test_levenshtein_distance_short_circuit  s   $,,..II() *5 6
 #'',,yy|H -&NA(221>DT!8&1hlC	 66qYG  aI5F G D
 #8_	 !66qYG""4y8I"J	 - ' -,s   D++D;	c                \   ^ RI pV P                  VP                  RR.R4      R4       V P                  VP                  R.R4      R4        ! R R\        4      pV P	                  \
        4      ;_uu_ 4        VP                  V! 4       R	4       RRR4       R#   + '       g   i     R# ; i)
r   Nr7  worldhell
hovercrafteelsc                       ] tR tRtRtR# )3MiscTest.test_suggestions_extension.<locals>.MyListi  r   Nr  r   r#   r!   MyListr    r  r#   r  r   )_suggestionsrh   _generate_suggestionsry  assertRaisesr   )r5   r  r  s   &  r!   test_suggestions_extension#MiscTest.test_suggestions_extension  s     	..'" 	
 	.. 	
	T 	 y))..vx< *)))s   8BB+	r   N)r   r   r   r   rr  r  r   requires_resourcer  r   r  r   r   r   s   @r!   rl  rl  ]  sD     ;: u%K &K0 = =r#   rl  c                   <   a  ] tR tRt o RtR tR tR tR tRt	V t
R# )TestColorizedTracebacki  Nc                r  aa	a
 R  o
V
3R lo	V	3R loV3R lp V! 4        RP	                  XP                  RR7      4      p\        R	,          p\        R
,          p\        R,          pV P                  RV,           R,           V,           V,           R,           V,           V4       V P                  RV,           R,           V,           V,           R,           V,           V4       V P                  RV,           R,           V,           V,           R,           V,           R,           V4       V P                  RV4       V P                  RV4       V P                  VR,           V,           V,           R,           V,           V4       R#   \          d-   p\        P                  P                  TRR7      p Rp?ELRp?ii ; i)c                  @    R RR//pVR ,          R,          R,          pR# )r  r  Nr  r   )r  r  re   s   *  r!   r;  <TestColorizedTraceback.test_colorized_traceback.<locals>.foo  s"    c4[!A#sC Ar#   c                  "   < V3R  l! ^^^^4      # )c                     < S! V !  # r9   r   r  r;  s   *r!   r"   OTestColorizedTraceback.test_colorized_traceback.<locals>.baz2.<locals>.<lambda>  s	    #t*r#   r   r  s   *r!   baz2=TestColorizedTraceback.test_colorized_traceback.<locals>.baz2  s    ,a!A66r#   c                     < S! ^^^^4      # r  r   )r  r  s   *r!   baz1=TestColorizedTraceback.test_colorized_traceback.<locals>.baz1  s    !Aa= r#   c                     < S ! ^^^^4      # r  r   )r  s   r!   rL  <TestColorizedTraceback.test_colorized_traceback.<locals>.bar  s    a r#   Tr  Nr   rp  r   r+   r'   zy = zx['a']['b']z['c']zreturn z(lambda *args: foo(*args))z	(1,2,3,4)zreturn (lambda *args: r;  z(*args)z
)(1,2,3,4)zreturn baz2(1,2,3,4)z.return baz1(1,
            2,3
            ,4)rL  ())r   r>   r  r  r   r#  colorsrk   )r5   rL  r   rA   r   redboldrr&   r  r  r;  s   &       @@@r!   test_colorized_traceback/TestColorizedTraceback.test_colorized_traceback  s]   	!	7	!		E
 

D
12Skssfsl]2U:UBWLuTV[\i#o(DDuLuTWbbejjlqr.4u<uDuLyX[``cooqvw,e4H%PcEkE)E1D85@%H  	..==$ > C	s   E? ?F6
!F11F6c                    \        R RR4       RP                  XP                  RR7      4      pR pV P                  V! R	/ \        B V4       R#   \         d,   p\        P                  P	                  TRR7      p Rp?LsRp?ii ; i)
za $ bz<string>rG   Tr  Nr   rp  c                 z    R P                  RV RV RV RV R2	RV RV R2R	V R
V R2V  RV RV RV R2.4      # )r     File z
"<string>", line r  rc   z    a $z b
z      ra   rg   r   zinvalid syntax)r   )tr(  r)   r  r   r+   r   r'   s   &&&&&&&&r!   rC  DTestColorizedTraceback.test_colorized_syntax_error.<locals>.expected  sv    77bTA3gaS!B?QCq4(QCq2&cQCr!N1#R@	 r#   r   )	rI   rg   r>   r  r  r   r#  rk   r  )r5   r   rA   r  rC  s   &    r!   test_colorized_syntax_error2TestColorizedTraceback.test_colorized_syntax_error  s}    	GZ0
 T23	 	h((&1  	..==$ > C	s   A B!BBc           
     $  a R  p^ RI Hp  V! 4        V P                  R4       VP                  P                  oV3R lpV P                  XV! R	/ \        B 4       R#   \         d   p\	        R4      ;_uu_ 4       p\
        P                  P                  RRR7      ;_uu_ 4        T! T4       RRR4       M  + '       g   i     M; iRRR4       M  + '       g   i     M; iXP                  4       P                  4       p Rp?LRp?ii ; i)
c                      ^^ ,           R# r   r   r   r#   r!   r;  KTestColorizedTraceback.test_colorized_traceback_is_the_default.<locals>.foo  r  r#   r  rv  r   z_colorize.can_colorizeT)return_valueNc                   < R RV R\          RV RV S^,            V RV RV 2RV RV V RV 2RV R	V V R
V 2RV R\          RV RV S^,            V RV RV 2RV RV V RV V RV 2
RV RV V RV V RV 2
V  RV RV RV 2.# )r  r  "r  , in 'test_colorized_traceback_is_the_defaultrE  r;  r  ~~~^^r  /0~ra   r   r   division by zero)r  )	r  r(  r)   r  r   r+   r   r'   lno_foos	   &&&&&&&&r!   rC  PTestColorizedTraceback.test_colorized_traceback_is_the_default.<locals>.expected  s    4"Qxj! -s719+aSaS0WXYWZ\qcQCs"QC(qcQCs"QC("Qxj! -s719+aSaSA38qc1#aS!QCq,qc1#aS!QCq,#&qcA3.>qcB r#   r   )r  r  rw  r   r   r  r  r  rM  r   r~  r  rh   r  )r5   r;  r  r   r  r  rC  r  s   &      @r!   r  >TestColorizedTraceback.test_colorized_traceback_is_the_default  s    	 	.	6EII,- ,,--	 	!3F!34)  	6 **h]](()APT(UU#A& VUUU +*** &&(335F		6sG   A D)D
<*C&	B8/	C8CC	D
C$&D

Dc                `  aa R  o S! 4        SP                  P
                  oRP                  XP                  RR7      4      P                  4       pVV3R lpV P                  W4! R/ \        B 4       R#   \          d,   p\        P                  P                  TRR7      p Rp?LRp?ii ; i)c                      . p  ^^ ,           \        RV 4      h  \          d   pT P                  T4        Rp?L-Rp?ii ; i)r   Ntest)r   rG  r   )
exceptions	inner_excs     r!   r;  QTestColorizedTraceback.test_colorized_traceback_from_exception_group.<locals>.foo  sE    J-A !44 % -!!),,-s   	 ?:?Tr  Nr   rp  c                   < R RV R\          RV RV S	^	,            V RV RV 2RV RV V RV 2RV R	V V R
V 2RRS 2R\         R2RV R\          RV RV S	^,            V RV RV 2RRRV  RV RV RV 2RRRV R\          RV RV S	^,            V RV RV 2RV RV V RV V RV 2
RV RV V RV V RV 2
RRV  R V RV R!V 2R".# )#r  z  |   File r  r  r  -test_colorized_traceback_from_exception_groupz  |     r;  r  r  r  zK  |     e = ExceptionGroup('test', [ZeroDivisionError('division by zero')])z  |     foo = z  |     self = <zQ.TestColorizedTraceback testMethod=test_colorized_traceback_from_exception_group>z0  |     raise ExceptionGroup("test", exceptions)z<  |     exceptions = [ZeroDivisionError('division by zero')]z  | r   r   ztest (1 sub-exception)r  r  z    |   File z
    |     z1 r  z 0z~~ra   z>    |     exceptions = [ZeroDivisionError('division by zero')]z    | r   r  r  )r  r   )
r  r(  r)   r  r   r+   r   r'   r;  r  s
   &&&&&&&&r!   rC  VTestColorizedTraceback.test_colorized_traceback_from_exception_group.<locals>.expected#  s   HbT8*AaSs719+aSaSP}~  ~A  B1#SA3b,1#SA3b,] &"8*,}~bT8*AaSs719+aSaSPSTUSVWBNqcs"QC/EaSI::t1XJas'!WQYKs%PQsRUVWUXYQCr!QCqA3b4QCr!QCqA3b4P,QCr!4DQCH;'
 
r#   r   )r   r>   r  r  r~  r  r   r#  r   rh   r  )r5   r   rA   r  rC  r;  r  s   &    @@r!   r  DTestColorizedTraceback.test_colorized_traceback_from_exception_group  s    	5	E ,,--T23>>@	
, 	!3F!34;  	..==$ > C	s   A7 7B-!B((B-r   )r   r   r   r   r  r  r  r  r  r   r   r   s   @r!   r  r    s%     GI@2&5<(5 (5r#   r  )r  	f_globalsrI  )rq  	tb_linenorZ  tb_lasti)ccollectionsr   r[  r   rW  r8  r  rl  r   r  unittest.mockr  r  r  rt  r  r   r  test.supportr   r   r   r	   r
   r   r   test.support.os_helperr   r   test.support.script_helperr   r   r   test.support.import_helperr   r   r   r  r   r>   	functoolsr   pathlibr   r1   r   r  r  co_positionsr  ro  color_overridesdefault_themeitemsgetlowerr  r  parentr  TestCaser-   rt  r  r  r  r  r@  rB  rE  rG  r  r  rI   escaper  r  r  r  r  r  r  r>  rS  ru  r  r   r  r   r  r	  r  global_for_suggestionsr  rh  rj  rl  r  main)r  r  s   00r!   <module>r     sp   #   
      	     / / / 2 [ [ - L      "*j"88*Abvy9:	7	 !DE

TK
LCT3DcJ ''11779
9 Q4::<(!+9
 X--0KK NIX&& NIb	> 	>> >)E  k1 k1 k1Z#*L!2!2 *LX &'     '     &'    E* E*R& 
&  ZZ=)299_+EFH
  	(++-A 	  	 "("3"35I "   "]+ ]+@  5x7H7H      4h6G6G   u,"" u,p&,** &,R&$!! &$RqM!! qMf+ +i 
> 
jJX.. jJZZMX->-> ZMz  `	8 `	8H&     [=x   [=@|5X.. |5| zMMO eX
s   72P