python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_traceback.cpython-312.pyc

Αe-	dZddlmZddlmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlmZddlZddlmZmZmZmZmZmZmZddlmZmZddlmZmZdd	l m!Z!ddl"Z"ddl#Z#ddl$Z$dd
l%m&Z&ddl'm(Z(e)dk(re)d
ndZ*edddgZ+de+_,edgdZ-edgdZ.e(e/j`dzZ1Gdde
jdZ3GddZ4GddZ5Gdde5Z6eGd d!Z7eGd"d#e4e7e
jdZ8eeGd$d%e5e7e
jdZ9eeGd&d'e6e7e
jdZ:Gd(d)e
jdZ;d*Z<d+Z=ej|d,ej~e<d-ej~e=d.Z@Gd/d0ZAGd1d2eAe
jdZBGd3d4eAe
jdZCGd5d6e
jdZDGd7d8e
jdZEGd9d:e
jdZFGd;d<e
jdZGGd=d>ZHGd?d@e
jdZIGdAdBe
jdZJdZKGdCdDZLGdEdFe4eLe
jdZMeGdGdHe5eLe
jdZNGdIdJe
jdZOe)dk(re
jyy)KzTest cases for traceback module)
namedtuple)StringION)support)Errorcaptured_outputcpython_only	ALWAYS_EQrequires_debug_rangeshas_no_debug_rangesrequires_subprocess)TESTFNunlink)assert_python_okassert_python_failure)forget)partial)Path__main__.codeco_filenameco_namectdgS)N)rrr)iter)_s G/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_traceback.py<lambda>r!s
4#7frame)f_code	f_globalsf_localstb)tb_frame	tb_linenotb_nexttb_lastizlevenshtein_examples.jsonceZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZedZdZdZdZdZdZdZdZy)TracebackCasescx	|td#|$r }tj||cYd}~Sd}~wwxYw)Nzcall did not raise exception)
ValueError	tracebackformat_exception_only)selffuncexcvalues    rget_exception_formatz#TracebackCases.get_exception_format-s?	=F;<<	?223>>	?s9499ctdddy)Nzdef fact(x):
	return x!
?execcompiler0s rsyntax_error_with_caretz&TracebackCases.syntax_error_with_caret5s-sF;r ctdddy)Nz1 +
r6r7r8r:s rsyntax_error_with_caret_2z(TracebackCases.syntax_error_with_caret_28sf%r ctdddy)Nzf(x, y for y in range(30), z)r6r7r8r:s rsyntax_error_with_caret_rangez,TracebackCases.syntax_error_with_caret_range;s/f=r ctdddy)Nz def spam():
  print(1)
 print(2)r6r7r8r:s rsyntax_error_bad_indentationz+TracebackCases.syntax_error_bad_indentation>s4c6Br ctdddy)NuPython = "Ṕýţĥòñ" +r6r7r8r:s r!syntax_error_with_caret_non_asciiz0TracebackCases.syntax_error_with_caret_non_asciiAs=sFKr ctdddy)Nz	 print(2)r6r7r8r:s rsyntax_error_bad_indentation2z,TracebackCases.syntax_error_bad_indentation2DsS&)r ctdddy)Nz
blech  (  r6r7r8r:s r tokenizer_error_with_caret_rangez/TracebackCases.tokenizer_error_with_caret_rangeGsc6*r cX|j|jt}|jt	|d|j|dj
dk(|jd|d|j|djd|djd|j|djdd|j|jt}|jd|d|j|djdd|j|djddz|djd|j|djdd|j|jt}|jd|d|j|djdd|j|djddz|djd|j|djdd|j|jt}|jd|d|j|djdd|j|djd	|djd|j|djdt	d
|j|jt}|jd|d|j|djdd|j|djd|djd|j|djddy)Nz	return x!^!
+yzy for y in range(30)()r4r;SyntaxErrorassertEquallen
assertTruestripassertInfindcountr=rCr?rGr0errs  r
test_caretzTracebackCases.test_caretJs''(D(D(35S1%A+56

c3q6"QS)3q6;;s+;<Qc*A.''(F(F(35

c3q6"Qd+Q/QS)A-s1v{{3/?@Qc*A.''(N(N(35

c3q6"Qd+Q/QS)A-s1v{{3/?@Qc*A.''(J(J(35

c3q6"Qd+Q/QS)3q6;;s+;<Qc*C0F,GH''(M(M(35

c3q6"Qd+Q/QS)3q6;;s+;<Qc*A.r ctdd}tjt|}|jt	|d|j|djdy)Nerror)zx.pyN
bad syntaxrJr`)rRr.r/rSrTrV)r0r2r[s   rtest_nocaretzTracebackCases.test_nocaretosO'#CD--k3?S1%Q6r c	ttd5}|jddddtddt\}}}|j	}|jt
|d|j|dd|jd|d	|j|d
d|j|dd
tty#1swYxYw#ttwxYw)Nwz
x = 1 / 0
-Xno_debug_rangesrIr"Traceback (most recent call last):sline 1, in <module>rJrL
    x = 1 / 0ra#ZeroDivisionError: division by zero)	openr
writer
splitlinesrSrTrWr)r0frstderrliness     r'test_no_caret_with_no_debug_ranges_flagz6TracebackCases.test_no_caret_with_no_debug_ranges_flagus	fc"
'a
&
'1'1LAq&%%'ESZ+U1X'LMMM0%(;U1X'78U1X'MN6N
'
'
6Ns"CCBCCCC-c
tjd}	ttd5}|j	|dddtddt\}}}|j
}|jt|d|j|dd|jd|d	|j|d
d|j|dd
tty#1swYxYw#ttwxYw)Nz
            import traceback
            try:
                x = 1 / 0
            except:
                traceback.print_exc()
            rdrerfrIrrgsline 4, in <module>rJrLrhrari)textwrapdedentrjr
rkrrlrSrTrWr)r0rrmrrnros      r8test_no_caret_with_no_debug_ranges_flag_python_tracebackzGTracebackCases.test_no_caret_with_no_debug_ranges_flag_python_tracebacks 	fc"
a

,'1LAq&%%'ESZ+U1X'LMMM0%(;U1X'78U1X'MN6N


6Ns"C1C%BC1%C.*C11Dc,tjd}	ttd5}|j	|dddtt\}}}|j
|dtty#1swY>xYw#ttwxYw)Na>
                import sys
                from weakref import ref

                sys.setrecursionlimit(15)

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

                try:
                    f()
                except RecursionError:
                    pass
        rdr)rrrsrjr
rkrrSr)r0rrmrcrs     r%test_recursion_error_during_tracebackz4TracebackCases.test_recursion_error_during_tracebacksy 
	fc"
a

(/HB1R#6N



6Ns!BA6-B6A?;BBc|j|jt}|jt	|d|j|djd|j
d|d|j|djddz|djd|j|jt}|jt	|d|j|djdy)NrIrJzprint(2)rKrL)ra)	r4rAIndentationErrorrSrTrVrWrXrErZs  rtest_bad_indentationz#TracebackCases.test_bad_indentations''(I(I(8:S1%Q4

c3q6"QS)A-s1v{{3/?@''(J(J(8:S1%Q4r c~t}tj|j|}|j	|dgy)NzKeyboardInterrupt
)KeyboardInterruptr.r/	__class__rS)r0elsts   rtest_base_exceptionz"TracebackCases.test_base_exceptions4--akk1=456r cLGddt}tj||}|jt	|dd}|j
dvr
|j}n'dj|j
|jg}|j|d|d|d	y)
NceZdZdZy)?TracebackCases.test_format_exception_only_bad__str__.<locals>.XcddzyNrJrr:s r__str__zGTracebackCases.test_format_exception_only_bad__str__.<locals>.X.__str__	!r N__name__
__module____qualname__rrr rXr
r rrJ<exception str() failed>)rbuiltinsrr: rN)	Exceptionr.r/rSrTrrjoinr0rr[	str_valuestr_names     r%test_format_exception_only_bad__str__z4TracebackCases.test_format_exception_only_bad__str__s			--a5S1%.	<<33~~Hxxq~~ >?HQx!CDr c	ddl	ddlj	jddgjj
}|j
\}}t|djd	fd}|dddd	d
D]b}|dk(rd}n
|dk(rd}nd
}|dj|||d|dj|||d|dj|||dd|dd
ddy)Nr-cz&import sys; print(sys.stdout.encoding)stdoutrnasciicX	ttd|5}|jdj||dddj	j
tgjj}|j\}}|j
j}tt|j
d}|j
}	dj|	}
dj|	}jd|z|d	d
j|d	|j|dj|
dj|d|
|d
}j||k(dj||y#1swYVxYw#ttwxYw)Nrd)encodingz}{0}if 1:
                        import traceback;
                        raise RuntimeError('{1}')
                        rbackslashreplacezraise RuntimeError('{0}')zRuntimeError: {0}zline %srJz)Invalid line number: {0!r} instead of {1}rLz.Invalid traceback line: {0!r} instead of {1!r}raz-Invalid error message: {0!r} instead of {1!r})rjr
rkformatPopen
executablePIPESTDOUTcommunicatedecoderlrencoderWrUendswith)
firstlinesmessagecharsetlinenooutputprocessrrnencoded_message
message_asciierr_lineerr_msgactual_err_msgoutput_encodingr0
subprocesssyss             rdo_testz1TracebackCases.test_encoded_file.<locals>.do_tests
&#89FLL"#F:w799%**CNNF+C%??:3D3D+F!(!4!4!67BBDv&nn_-?AO,22?CM299-HH)00?GMM9v-q	;BB1Iv'
(
OOF1I..x8@GG1Ix)
*$AYNOONg5?FF"G-
.;99vs"F"FA2FFFF)rfoora)rz
iso-8859-1utf-8GBKru丂儀uhé hoz# coding: {0}
rIz#!shebang
# coding: {0}
z 	
# coding: {0}
zx=0
# coding: GBK
r)
rrrrrrrstrrlr)
r0rrrnrrtextrrrs
`      @@@rtest_encoded_filez TracebackCases.test_encoded_files
	
""CNND$L$N*4//*4*;*;#=!,,.fg.99;A>"	.H	E7A&>	&G'!E!%!%,,W5'1
&077@'1
&,33G<'1
&	&	&
GQ?r ctjd}td|\}}}gd}|j|j	|y)Na
            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)rgs&  File "<string>", line 8, in __init__ri)rrrsrrSrl)r0rrvrrnexpecteds      rtest_print_traceback_at_exitz+TracebackCases.test_print_traceback_at_exit sN 
,.dD9FF<	
**,h7r ct}tjttdd||j	|jdyN	projectorfileException: projector
rr.print_exceptionrrSgetvaluer0rs  rtest_print_exceptionz#TracebackCases.test_print_exception?s?!!y-t&	
	
*,DEr ct}tjtd||j	|jdyrrrs  rtest_print_exception_excz'TracebackCases.test_print_exception_excFs6!!)K"8vF*,DEr c.td}tj|}|j|dg|j	t
d5tj|j|ddd|j	t
d5tj|j|jddd|j	td5tj|dddy#1swYxYw#1swYKxYw#1swYyxYw)NrrzBoth or neitherr%zpositional-only)r2)	rr.format_exceptionrSassertRaisesRegexr-r~
__traceback__	TypeError)r0rrs   rtest_format_exception_excz(TracebackCases.test_format_exception_excKsk"++A.":!;<

#
#J0A
B	7&&q{{A6	7

#
#J0A
B	H&&q{{qG	H

#
#I/@
A	.&&1-	.	.		7	7	H	H	.	.s$
!C3	,C?D3C<?DDcftjtd}|j|dgy)Nrr)r.r/rrSrs  rtest_format_exception_only_excz-TracebackCases.test_format_exception_only_excVs+00;1GH":!;<r cd}t}tjd||j|j	|t}tjddd||j|j	|t}tj
d||j|j	||jtjd||jtjd|g|jtjddd|g|jtjd|g|jtjdd|gy)NzNoneType: None
r)	rr.rrSr	print_exc
format_excrr/)r0NONE_EXC_STRINGexcfiles   rtest_exception_is_Nonez%TracebackCases.test_exception_is_NoneZs@,*!!$W5))+_=*!!$dA))+_=*Dw/))+_=--d3_E33D9O;LM&&tT48?:K	M++D1O3D	F++D$7/9J	Lr cl|jttjtj
d|jttjtjd|jttjtjdy)NzL(exc, /, value=<implicit>, tb=<implicit>, limit=None, file=None, chain=True)zA(exc, /, value=<implicit>, tb=<implicit>, limit=None, chain=True)z(exc, /, value=<implicit>))rSrinspect	signaturer.rrr/r:s rtest_signatureszTracebackCases.test_signaturesqs!!)";";<=2	4
	
!!)"<"<=>	
	
!!)"A"ABC(	*r N)rrrr4r;r=r?rArCrErGr\rbrprtrwr{rrrrrrrrrrrrr rr+r+)s=<&>CL*+#/J7&0257EC@C@J8>FF
	.=L.
*r r+cFeZdZddZejj
dzZy)"PurePythonExceptionFormattingMixinc	||jdy#tjj||cYSxYw)NNo exception thrown.)failr.rrl)r0callableslice_start	slice_ends    r
get_exceptionz0PurePythonExceptionFormattingMixin.get_exceptionsA	NJII,-	N'')446{9MMs	'ArLNr)rrrr__code__co_firstlineno
callable_linerr rrrs N"**99A=Mr rcJeZdZdZddZej
jdzZy)CAPIExceptionFormattingMixinrcddlm}	||jdy#t$r_}t	d5}|||j
dddn#1swYnxYwj
j||cYd}~Sd}~wwxYw)Nrexception_printrrn)	_testcapirrrrLEGACYrrl)r0rrrrrtbstderrs       rrz*CAPIExceptionFormattingMixin.get_exceptions{-	KJII,-	K *
0h4;;/
0
0
0$$&113K	JJ	Ks1!	B	BA		BA	'B>B	B	raNr)rrrrrrrrrr rrrs%
FK"**99A=Mr rceZdZdZy)"CAPIExceptionFormattingLegacyMixinrJN)rrrrrr rrrs
Fr rceZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZy)#TracebackErrorLocationCaretTestBasezF
    Tests for printing code error expressions as part of PEP 657
    c	d}|jj}dtd|jdtd|dzd	}|j	|}|j||j
y)Nctd)Nzbasic caret testsr-rr rrmz?TracebackErrorLocationCaretTestBase.test_basic_caret.<locals>.fs%&9::r +Traceback (most recent call last):
  File "", line *, in get_exception
    callable()
  File "rJzm, in f
    if True: raise ValueError("basic caret tests")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
rr__file__rrrSrl)r0rmlineno_f
expected_fresult_liness     rtest_basic_caretz4TracebackErrorLocationCaretTestBase.test_basic_carets	;::,,
j););(<=j!5C
C	))!,z'<'<'>?r c	d}|jj}dtd|jdtd|dzd	}|j	|}|j||j
y)Nctd)NuĤellö Wörldrrr rf_with_unicodezRTracebackErrorLocationCaretTestBase.test_line_with_unicode.<locals>.f_with_unicodes%&677r rrrrJuq, in f_with_unicode
    if True: raise ValueError("Ĥellö Wörld")
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
r)r0rrrrs     rtest_line_with_unicodez:TracebackErrorLocationCaretTestBase.test_line_with_unicodes	8"**99
j););(<=j!5=
=	)).9z'<'<'>?r c	d}|jj}dtd|jdtd|dzd	}|j	|}|j||j
y)Nc$dtdtfd}y)Nareturncy)Nrr)rs rrzcTracebackErrorLocationCaretTestBase.test_caret_in_type_annotation.<locals>.f_with_type.<locals>.foosr )THIS_DOES_NOT_EXISTint)rs rf_with_typezVTracebackErrorLocationCaretTestBase.test_caret_in_type_annotation.<locals>.f_with_types
*

r rrrrJza, in f_with_type
    def foo(a: THIS_DOES_NOT_EXIST ) -> int:
               ^^^^^^^^^^^^^^^^^^^
r)r0rrrrs     rtest_caret_in_type_annotationzATracebackErrorLocationCaretTestBase.test_caret_in_type_annotations	''66
j););(<=j!53
3	))+6z'<'<'>?r c	d}|jj}dtd|jdtd|dzd	}|j	|}|j||j
y)Nctd)Nzerror over multiple linesrrr rf_with_multilinez]TracebackErrorLocationCaretTestBase.test_caret_multiline_expression.<locals>.f_with_multilines%+r rrrrJzS, in f_with_multiline
    if True: raise ValueError(
             ^^^^^^^^^^^^^^^^^rr0rrrrs     rtest_caret_multiline_expressionzCTracebackErrorLocationCaretTestBase.test_caret_multiline_expressions	
$,,;;
j););(<=j!5-
-	))*:;z'<'<'>?r c	tjdfd}|jj}dtd|j
dtd|dzd	}|j
|}|j||jy)Nz
        def foo(*args, **kwargs):
            pass

        a, b, c = 1, 2, 3

        foo(a, z
                for z in
                    range(10), b, c)
        ctddS)Nr6r7r8)rsrrzjTracebackErrorLocationCaretTestBase.test_caret_multiline_expression_syntax_error.<locals>.f_with_multilines4f--r rrrrLz, in f_with_multiline
    return compile(code, "?", "exec")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "?", line 7
    foo(a, z
           ^)	rrrsrrrrrrSrl)r0rrrrrs     @r,test_caret_multiline_expression_syntax_errorzPTracebackErrorLocationCaretTestBase.test_caret_multiline_expression_syntax_errors	 	
	.$,,;;
j););(<=j!5
	))*:;z'<'<'>?r c	d}|jj}dtd|jdtd|dzd	}|j	|}|j||j
y)NcdddzzSNrLrJrrrr rrzdTracebackErrorLocationCaretTestBase.test_caret_multiline_expression_bin_op.<locals>.f_with_multilinesA
r rrrrLz-, in f_with_multiline
    2 + 1 /
        ^^^rrs     r&test_caret_multiline_expression_bin_opzJTracebackErrorLocationCaretTestBase.test_caret_multiline_expression_bin_ops	$,,;;
j););(<=j!5
	))*:;z'<'<'>?r c	d}|jj}dtd|jdtd|dzd	}|j	|}|j||j
y)Ncd}d|dzzdzSN
rrdivisors rf_with_binary_operatorzcTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators.<locals>.f_with_binary_operator%sG!#b((r rrrrLzY, in f_with_binary_operator
    return 10 + divisor / 0 + 30
                ~~~~~~~~^~~
rr0r*rexpected_errorrs     rtest_caret_for_binary_operatorszCTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators$s	)*22AA
j););(<=j!5,
,	))*@A~'@'@'BCr c	d}|jj}dtd|jdtd|dzd	}|j	|}|j||j
y)Ncd}d|dzzdzSr$r)áóís rr*zpTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators_with_unicode.<locals>.f_with_binary_operator6sF
?R''r rrrrLuT, in f_with_binary_operator
    return 10 + áóí / 0 + 30
                ~~~~^~~
rr+s     r,test_caret_for_binary_operators_with_unicodezPTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators_with_unicode5s	(*22AA
j););(<=j!5(
(	))*@A~'@'@'BCr c	d}|jj}dtd|jdtd|dzd	}|j	|}|j||j
y)Ncd}d|dzzdzSr$rr(s rr*zlTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators_two_char.<locals>.f_with_binary_operatorGsG1$r))r rrrrLz[, in f_with_binary_operator
    return 10 + divisor // 0 + 30
                ~~~~~~~~^^~~
rr+s     r(test_caret_for_binary_operators_two_charzLTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators_two_charFs	**22AA
j););(<=j!5-
-	))*@A~'@'@'BCr c	d}|jj}dtd|jdtd|dzd	}|j	|}|j||j
y)Ncd}d}||zS)NrJrr)rbs  rr*zTracebackErrorLocationCaretTestBase.test_caret_for_binary_operators_with_spaces_and_parenthesis.<locals>.f_with_binary_operatorXsAAq= r rrrrazN, in f_with_binary_operator
    return ( a   )   + b
           ~~~~~~~~~~^~~
rr+s     r;test_caret_for_binary_operators_with_spaces_and_parenthesisz_TracebackErrorLocationCaretTestBase.test_caret_for_binary_operators_with_spaces_and_parenthesisWs	!
*22AA
j););(<=j!5)
)	))*@A~'@'@'BCr c	d}|jj}dtd|jdtd|dzd	}|j	|}|j||j
y)Nc$dddii}|dddSNxrPzr	some_dicts rf_with_subscriptzVTracebackErrorLocationCaretTestBase.test_caret_for_subscript.<locals>.f_with_subscriptjs$sDk*IS>#&s++r rrrrLz^, in f_with_subscript
    return some_dict['x']['y']['z']
           ~~~~~~~~~~~~~~~~~~~^^^^^
rr0r@rr,rs     rtest_caret_for_subscriptz<TracebackErrorLocationCaretTestBase.test_caret_for_subscriptis	,$,,;;
j););(<=j!54
4	))*:;~'@'@'BCr c	d}|jj}dtd|jdtd|dzd	}|j	|}|j||j
y)Nc2dddddiiii}|ddddS)NóáíthetarJbetarr>s rr@z^TracebackErrorLocationCaretTestBase.test_caret_for_subscript_unicode.<locals>.f_with_subscript{s3tgq\&:;<IT?4(.v66r rrrrLuq, in f_with_subscript
    return some_dict['ó']['á']['í']['beta']
           ~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
rrAs     r test_caret_for_subscript_unicodezDTracebackErrorLocationCaretTestBase.test_caret_for_subscript_unicodezs	7$,,;;
j););(<=j!5<
<	))*:;~'@'@'BCr c	d}|jj}dtd|jdtd|dzd	}|j	|}|j||j
y)Ncg}dx}}|||zSNrJr)rr7cs   rr*zxTracebackErrorLocationCaretTestBase.test_caret_for_subscript_with_spaces_and_parenthesis.<locals>.f_with_binary_operatorsAIAa?Q&&r rrrrazV, in f_with_binary_operator
    return b     [    a  ] + c
           ~~~~~~^^^^^^^^^
rr+s     r4test_caret_for_subscript_with_spaces_and_parenthesiszXTracebackErrorLocationCaretTestBase.test_caret_for_subscript_with_spaces_and_parenthesiss	'
*22AA
j););(<=j!5+
+	))*@A~'@'@'BCr c	tdtd}ttd5}|jdddd|j	t
tt
t|}|j|}|j}dtd|jdtd|d	}|j||jy#1swYxYw)	Nz1 / 0 / 1 / 2
r7rdz1 $ 0 / 1 / 2
rrrz*, in <module>
    1 $ 0 / 1 / 2
    ^^^^^
)r9r
rjrk
addCleanuprrr7rrrrrSrl)r0bytecoderr1rrr,s       r/test_traceback_specialization_with_syntax_errorzSTracebackErrorLocationCaretTestBase.test_traceback_specialization_with_syntax_errors,ff=
&#
	*$JJ()	*	
'tX&))$/**
j););(<=hhxj1
		
~'@'@'BC#	*	*sCCcd}t|td}ttd5}|j|ddd|j	t
tt
t|}|j|}|j}dtd|jdtd|d|dd	td
zdzd
}|j||jy#1swYxYw)
Na	if True: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar7rdrrrz, in <module>
    z
     z	if True: a^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^rN)r9r
rjrkrQrrr7rrrrrTrSrl)r0sourcerRrr1rrr,s        rtest_traceback_very_long_linezATracebackErrorLocationCaretTestBase.test_traceback_very_long_lines(6662
&#
	$JJv	'tX&))$/**
j););(<=hhxj1(s;'''12"
6		
~'@'@'BC!		sCC%c	d}|jj}dtd|jdtd|dzd	}|j	|}|j||j
y)Nc&dddii}|dddyr;rr>s rr@z]TracebackErrorLocationCaretTestBase.test_secondary_caret_not_elided.<locals>.f_with_subscripts!sDk*IcN3$r rrrrLzP, in f_with_subscript
    some_dict['x']['y']['z']
    ~~~~~~~~~~~~~~~~~~~^^^^^
rrAs     rtest_secondary_caret_not_elidedzCTracebackErrorLocationCaretTestBase.test_secondary_caret_not_elideds	%$,,;;
j););(<=j!5-
-	))*:;~'@'@'BCr c	d}dtd|jdtd|jjdzd	}|j	|}|j||j
y)NcBtdtdtdgNegrJrLExceptionGroupr-rrr rr2zKTracebackErrorLocationCaretTestBase.test_caret_exception_group.<locals>.excs)$A	!0MNNr C  + Exception Group Traceback (most recent call last):
  |   File "rz2, in get_exception
  |     callable()
  |   File "rJaB, in exc
  |     if True: raise ExceptionGroup("eg", [ValueError(1), TypeError(2)])
  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  | ExceptionGroup: eg (2 sub-exceptions)
  +-+---------------- 1 ----------------
    | ValueError: 1
    +---------------- 2 ----------------
    | TypeError: 2
)rrrrrrSrl)r0r2r,rs    rtest_caret_exception_groupz>TracebackErrorLocationCaretTestBase.test_caret_exception_groups{
	O$:Xd.@.@-AB$:Xcll.I.IA.M-NO$
%	))#.~'@'@'BCr cp|j|}|d}|j|j|y)Nr)rrSlstrip)r0r1expected_specializationrspecialization_lines     rassertSpecializedz5TracebackErrorLocationCaretTestBase.assertSpecializeds8))$/*2.,3357NOr c>|jdd|jdd|jdd|jdd|jdd|jd	d|jd
d|jdd|jd
d|jdd|jdd|jdd|jdd|jdd|jddy)NcddzSrrrr rrzTTracebackErrorLocationCaretTestBase.test_specialization_variations.<locals>.<lambda>s
qsr z~^~cddzdzSNrJrrarrr rrzTTracebackErrorLocationCaretTestBase.test_specialization_variations.<locals>.<lambda>sqs1ur cddzSrrrr rrzTTracebackErrorLocationCaretTestBase.test_specialization_variations.<locals>.<lambda>
q1ur z~~^~~cddzdzSrkrrr rrzTTracebackErrorLocationCaretTestBase.test_specialization_variations.<locals>.<lambda>sq1uqyr cddzSrrrr rrzTTracebackErrorLocationCaretTestBase.test_specialization_variations.<locals>.<lambda>
q!tr z~^~~cddzdzSrkrrr rrzTTracebackErrorLocationCaretTestBase.test_specialization_variations.<locals>.<lambda>sq!tAvr cddzSrrrr rrzTTracebackErrorLocationCaretTestBase.test_specialization_variations.<locals>.<lambda>s
qqyr z	~~~~~^~~~cddzdzS)NrJrrrrr rrzTTracebackErrorLocationCaretTestBase.test_specialization_variations.<locals>.<lambda>sqqyQr cddzSrrrr rrzTTracebackErrorLocationCaretTestBase.test_specialization_variations.<locals>.<lambda>	rpr z~~^~cddzSrrrr rrzTTracebackErrorLocationCaretTestBase.test_specialization_variations.<locals>.<lambda>rpr z~^^~cddzdzSNrJrrIrrr rrzTTracebackErrorLocationCaretTestBase.test_specialization_variations.<locals>.<lambda>
sq!tQwr cddzSrrrr rrzTTracebackErrorLocationCaretTestBase.test_specialization_variations.<locals>.<lambda>s
qAvr z~~^^~~cddzdzSrwrrr rrzTTracebackErrorLocationCaretTestBase.test_specialization_variations.<locals>.<lambda>sqAv{r cddzSrrrr rrzTTracebackErrorLocationCaretTestBase.test_specialization_variations.<locals>.<lambda>rmr z~~^^~cddzSrrrr rrzTTracebackErrorLocationCaretTestBase.test_specialization_variations.<locals>.<lambda>rmr z~^^~~)rgr:s rtest_specialization_variationszBTracebackErrorLocationCaretTestBase.test_specialization_variationss#{&+	-}&+	-}&-	/0&-	/|&,	.~&,	.0&1	36&1	3|&,	.|&,	.&,	.~&.	02&.	0}&-	/}&-	/r c
8	dd		fd}|j|}|jj}jj}dtd|jdtd|dzdtd|dzd	
}|j||j
	fd
}|j|}|jj}dtd|jdtd|dzdtd|dzd	
}|j||j
y)NctN)rr1s r	dec_errorz`TracebackErrorLocationCaretTestBase.test_decorator_application_lineno_correct.<locals>.dec_errorsOr c|Srrrs rdec_finez_TracebackErrorLocationCaretTestBase.test_decorator_application_lineno_correct.<locals>.dec_finesKr c d}y)Ncyrrrr rgzkTracebackErrorLocationCaretTestBase.test_decorator_application_lineno_correct.<locals>.applydecs.<locals>.gsr r)rrrs r	applydecsz`TracebackErrorLocationCaretTestBase.test_decorator_application_lineno_correct.<locals>.applydecss

r rrrrJz5, in applydecs
    @dec_error
     ^^^^^^^^^
  File "z#, in dec_error
    raise TypeError
c.Gdd}y)NceZdZy)qTracebackErrorLocationCaretTestBase.test_decorator_application_lineno_correct.<locals>.applydecs_class.<locals>.AN)rrrrr rAr1sr rr)rrrs rapplydecs_classzfTracebackErrorLocationCaretTestBase.test_decorator_application_lineno_correct.<locals>.applydecs_class0s

Mr z;, in applydecs_class
    @dec_error
     ^^^^^^^^^
  File ")rrrrrrSrl)
r0rrlineno_applydescslineno_dec_errorr,rlineno_applydescs_classrrs
        @@r)test_decorator_application_lineno_correctzMTracebackErrorLocationCaretTestBase.test_decorator_application_lineno_correctsU			)))4%..==$--<<
j););(<=j):Q)>(?@ j)9A)=(>?$

$		
~'@'@'BC	))/:"1":":"I"I
j););(<=j)@1)D(EF j)9A)=(>?$

$		
~'@'@'BCr cd}|j|}ddtd|jdddtd|jjdzdd	d
g}|j||y)Nc$djyrmethodrr rrmzKTracebackErrorLocationCaretTestBase.test_multiline_method_call_a.<locals>.fCs
r "Traceback (most recent call last):  File "r, in get_exception    callable()rL, in fz    .methodz     ^^^^^^rrrrrrSr0rmactualrs    rtest_multiline_method_call_az@TracebackErrorLocationCaretTestBase.test_multiline_method_call_aBsz	##A&0z4+=+=*>>PQz1::+D+Dq+H*IP

	
*r cd}|j|}ddtd|jdddtd|jjdzdd	g}|j||y)
Nc$djyrrrr rrmzKTracebackErrorLocationCaretTestBase.test_multiline_method_call_b.<locals>.fSs
r rrrrrrLrz
    methodrrs    rtest_multiline_method_call_bz@TracebackErrorLocationCaretTestBase.test_multiline_method_call_bRsw	##A&0z4+=+=*>>PQz1::+D+Dq+H*IP
	
*r cd}|j|}ddtd|jdddtd|jjdzdd	d
g}|j||y)Nc$djyrrrr rrmzKTracebackErrorLocationCaretTestBase.test_multiline_method_call_c.<locals>.fbs
&r rrrrrrLrz    . methodz      ^^^^^^rrs    rtest_multiline_method_call_cz@TracebackErrorLocationCaretTestBase.test_multiline_method_call_casz	##A&0z4+=+=*>>PQz1::+D+Dq+H*IP

	
*r cd}|j|}ddtd|jdddtd|jjdzdd	g}|j||y)
Nctyrwidthrr rrmzhTracebackErrorLocationCaretTestBase.test_wide_characters_unicode_with_problematic_byte_offset.<locals>.frsr rrrrrrJru    widthrrs    r9test_wide_characters_unicode_with_problematic_byte_offsetz]TracebackErrorLocationCaretTestBase.test_wide_characters_unicode_with_problematic_byte_offsetqsw	##A&0z4+=+=*>>PQz1::+D+Dq+H*IP!
	
*r cd}|j|}ddtd|jdddtd|jjdzdd	g}|j||y)
Ncd}t|rMrrs rrmz[TracebackErrorLocationCaretTestBase.test_byte_offset_with_wide_characters_middle.<locals>.fsO_--r rrrrrrLru%    raise ValueError(width)rrs    r,test_byte_offset_with_wide_characters_middlezPTracebackErrorLocationCaretTestBase.test_byte_offset_with_wide_characters_middlesw	.##A&0z4+=+=*>>PQz1::+D+Dq+H*IP3
	
*r cd}|j|}ddtd|jdddtd|jjdzdd	d
g}|j||y)Nc0d}d}td||yrprint)wwwths  rrmzITracebackErrorLocationCaretTestBase.test_byte_offset_multiline.<locals>.fs IF!Y
r rrrrrrIru    print(1, www(z             ^^^^rrs    rtest_byte_offset_multilinez>TracebackErrorLocationCaretTestBase.test_byte_offset_multilinesz	##A&0z4+=+=*>>PQz1::+D+Dq+H*IP%

	
*r N)rrr__doc__rrrrrr!r-r1r4r8rBrJrOrSrWrZrbrgr|rrrrrrrrr rrrs@$@$@"@(!@F@*D"D"D"D$D"D"D$D,D,D$D0P
/@(DT+ 
++ +
++r rceZdZdZy)"PurePythonTracebackErrorCaretTestst
    Same set of tests as above using the pure Python implementation of
    traceback printing in traceback.py.
    Nrrrrrr rrrsr rceZdZdZy)CPythonTracebackErrorCaretTestsS
    Same set of tests as above but with Python's internal traceback printing.
    Nrrr rrrr rceZdZdZy)%CPythonTracebackLegacyErrorCaretTestszZ
    Same set of tests as above but with Python's legacy internal traceback printing.
    Nrrr rrrrr rceZdZdZeddZdZdZdZdZ	dZ
ed	Zeed
Z
dZedZd
ZedZdZedZdZy)TracebackFormatTestsctd)Nblah)KeyErrorr:s rsome_exceptionz#TracebackFormatTests.some_exceptions
vr Ncddlm}	|jtd#t$r4}|j
}|||jddjtj|z}t}||||j}td5}tj|dddn#1swYnxYwt}	tj||	td5}
tjdddn#1swYnxYwtj}t}tj|Yd}~nd}~wwxYw|j!|||j!j|	j|j!
j|j|j!||j|j#}
|
d}|j!t%|
d|
d	|
d
}}|j'|j)d|j'|j)d|j'|j)d
y)Nr)traceback_printz&unable to create test traceback stringz#Traceback (most recent call last):
rrnrrr	Traceback  Filez	    raise)rrrrrrr(rr.	format_tbrrrprint_tbrrrSrlrTrU
startswith)r0cleanup_funcrrr%
traceback_fmtfile_
python_fmtrtbfile	excstderrexcfmtrtb_linesbannerlocationsource_lines                 rcheck_traceback_formatz+TracebackFormatTests.check_traceback_formats-	B!,@AA+	.B'RZZ(BGGI$7$7$;<=MJEB&..*J *
'h""2&
'
'
'ZFr/ *
&i##%
&
&
&))+FjGW--'	.0	

3**,foo.?@++-w/?/?/AB!1!1!34((*!X* (hrl+))+67++H56..{;<sE#
E!A5E"C8	EC
	3E9D	ED 	;EE!c$|jyrrr:s rtest_traceback_formatz*TracebackFormatTests.test_traceback_formats##%r c,d}|j|y)Nc8|jjyr)r&clearrs r
cleanup_tbzRTracebackFormatTests.test_traceback_format_with_cleared_frames.<locals>.cleanup_tbsKKr r)r0rs  r)test_traceback_format_with_cleared_framesz>TracebackFormatTests.test_traceback_format_with_cleared_framess	 ##J/r ctd5}tjtjddddt}tjtjd||j
j|jtjtjd}|j
|jdj|y#1swYxYw)NrnrJrr)
rr.print_stackr	_getframerrSrformat_stackr)r0ststderrstfilestfmts    rtest_stack_formatz&TracebackFormatTests.test_stack_formatsX
&	4(!!#--"23	4cmmA.V<**,foo.?@&&s}}Q'78**,bggen=	4	4s)C77Dc	d}td5}|ddd|jj}|jj	jdddt|dzfzddt|dzfzd	gy#1swYmxYw)
Nc,tjyr)r.rrr rprnz2TracebackFormatTests.test_print_stack.<locals>.prns!!#r rnz)  File "%s", line %d, in test_print_stackraz	    prn()z  File "%s", line %d, in prnrJz    traceback.print_stack())rrrrSrrlr)r0rrnrs    rtest_print_stackz%TracebackFormatTests.test_print_stacks	$
X
&	&E	,,*557<78VAX:NN*hq-AA)	?
			sBBc
d|_fdtd5}	|jddddjj
}dtd|dzdtd|dzd	td|dzd	td|dzd
}|j}jj}|j|dd|dd|j|d|d|j|d|dtj}|jttj d
|dj#t%|dz
|d$fd	td5}	|jddddjj
}	dtd|	dzdtd|	dzdtd|	dzdtd|	dzd}
dtd|	dzd}||
zj}jj}|j||d$fd	td5}	|jddddjj
}
dtd|
dzdtd|
dzdtd|
dzdtd|
dzdtd|
dzd}||
zj}jj}|j||td5}	t(j*|jdddddtd|	dzdtd|	dzdtd|	dzdtd|	dzd}
dtd|	dzd }||
zj}|jj}|j||td5}	t(j*dz|jdddddtd|	dzdtd|	dzdtd|	dzd!td|	dzd}
dtd|	d"zd#}||
zj}|jj}|j||y#t$r|YswxYw#1swYyxYw#t&$r|Y@wxYw#1swYFxYw#t&$r|YwxYw#1swYxYw#t&$r|YwxYw#1swYxYw#t&$r|Y6wxYw#1swY<xYw)%NcyrrrmsrrmzBTracebackFormatTests._check_recursive_traceback_display.<locals>.f#s
Cr rnzno recursion occurredrrrz8, in _check_recursive_traceback_display
    f()
  File "rJz, in f
    f()
  File "zn, in f
    f()
  \[Previous line repeated (\d+) more times\]
RecursionError: maximum recursion depth exceeded
rrz\d+<c*|r|dz
StrMr)rYrs rrzBTracebackFormatTests._check_recursive_traceback_display.<locals>.gPsqz!r zno value error was raisedrrLz;, in g
    return g(count-1)
           ^^^^^^^^^^
  File "zc, in g
    return g(count-1)
           ^^^^^^^^^^
  [Previous line repeated 7 more times]
  File "raz', in g
    raise ValueError
ValueError
z0, in _check_recursive_traceback_display
    g()
c.|r|dz
SyrMr)rYrhs rrzBTracebackFormatTests._check_recursive_traceback_display.<locals>.hwsqz!
Cr z8, in _check_recursive_traceback_display
    h()
  File "z;, in h
    return h(count-1)
           ^^^^^^^^^^
  File "zc, in h
    return h(count-1)
           ^^^^^^^^^^
  [Previous line repeated 7 more times]
  File "z, in h
    g()
zno error raisedMzK, in _check_recursive_traceback_display
    g(traceback._RECURSIVE_CUTOFF)
zb, in g
    return g(count-1)
           ^^^^^^^^^^
  [Previous line repeated 1 more time]
  File "lzO, in _check_recursive_traceback_display
    g(traceback._RECURSIVE_CUTOFF + 1)
)r&)maxDiffrrRecursionErrorrrrrlrrSassertRegexrWrgetrecursionlimitrresearchgroupranger-r._RECURSIVE_CUTOFF)r0
render_excstderr_frresult_frr	rec_limitstderr_glineno_gresult_gtb_linestderr_hlineno_hresult_hrmrrs               @@@r"_check_recursive_traceback_displayz7TracebackFormatTests._check_recursive_traceback_displays	X
&	3(
3		12
	3::,,
j!5j!5j!5j!5A
A	$&&(""$//1	
hsm4Xb\2

hrlF2J/))+	

c"))FF2J7==?@%	RTV_B`a	
X
&	7(
7		56
	7::,,xj!5 j!5 j!5 j!5
	 
j!5
	
h&224""$//1*	
X
&	7(
7		56
	7::,,
j!5j!5 j!5 j!5 j!5
	"x'335""$//1*X
&	-(
-)--.		+,
	-xj!5 j!5 j!5 j!5
	
j"
63
3	
h&224""$//1*X
&	-(
-)--12		+,
	-xj!5 j!5 j!5 j!5
	 
j#77
7	
h&224""$//1*]"

	3	3d

	7	7T

	7	7D

	-	-D

	-	-sR,RR,2S4R9;SS4SS4TT(TT<T%1T<R)%R,(R))R,,R69S
	SS

SSS1-S40S11S44S>TTTTT"%T95T<8T99T<<UcB|jtjyr)rr.rr:s rtest_recursive_traceback_pythonz4TracebackFormatTests.test_recursive_traceback_pythons//	0C0CDr c>ddlmfd}|j|y)Nrrc:tjyr)r	exceptionrsrrzRTracebackFormatTests.test_recursive_traceback_cpython_internal.<locals>.render_excsCMMO,r )rrr)r0rrs  @r)test_recursive_traceback_cpython_internalz>TracebackFormatTests.test_recursive_traceback_cpython_internals	.	-//
;r cd}|}|jj}|j|dddt|dzfzdt|dzfzgy)Nc*tjSr)r.rrr rfmtz3TracebackFormatTests.test_format_stack.<locals>.fmts))++r rz>  File "%s", line %d, in test_format_stack
    result = fmt()
rLzA  File "%s", line %d, in fmt
    return traceback.format_stack()
rJ)rrrSr)r0rresultrs    rtest_format_stackz&TracebackFormatTests.test_format_stackse	,,,
#&.q%9
:
47?6J
K'
	r cddlm}Gddt}|d}|d}	||#|$r	|#|$r}|}Yd}~nd}~wwxYwYnwxYwtd5}||dddn#1swYnxYwj	jj
}|jdt||jtj|d	|jd
|d|jd|d
y)NrrceZdZdZy)ATracebackFormatTests.test_unhashable.<locals>.UnhashableExceptioncyNTrr0others  r__eq__zHTracebackFormatTests.test_unhashable.<locals>.UnhashableException.__eq__r Nrrrrrr rUnhashableExceptionr
r r!ex1ex2rnrzUnhashableException: ex2razUnhashableException: ex1r&)rrrrrrVrlrSrTcontext_messagerW)	r0rr!r#r$rexc_valrr%s	         rtest_unhashablez$TracebackFormatTests.test_unhashables-	)	"%(!%(	3"	
	&

		X
&	%(G$	%	%	%


 
&
&
(
3
3
5SW%..0"Q%8

0"Q%8

0"R&9s8*A	2A>A	AA	A		A))A2cVtd}tdD]}td|g}|S)NrJr^)rrr`)r0ris   rdeep_egzTracebackFormatTests.deep_egs1aLt	*AtaS)A	*r c`ddlm}d}|j}td5}t	j
|5||ddddddj
}|jd||j|jd|y#1swYUxYw#1swYYxYw)NrrKrn	max_depthr`)
rrr,rrinfinite_recursionrrWassertLessEqualrY)r0rLIMITr^rrs      r(test_exception_group_deep_recursion_capiz=TracebackFormatTests.test_exception_group_deep_recursion_capis-
\\^
X
&	$(++e<
$#
$	$""$

&/V\\*:;UC	
$
$	$	$s"B$	BB$B!	B$$B-cd}|j}td5}tj|5t	j
t
|||jddddddj}|jd||j|jd|y#1swYUxYw#1swYYxYw)Nr.rnr/r`)r,rrr1r.rtyperrrWr2rY)r0r3r^rrs     r-test_exception_group_deep_recursion_tracebackzBTracebackFormatTests.test_exception_group_deep_recursion_tracebacks
\\^
X
&	J(++e<
J))$r(B8H8HI
J	J""$

&/V\\*:;UC	
J
J	J	Js"C+B4 C4B=	9CC	cddlm}td5}|dddd|jj	dy#1swY*xYw)Nrrrn*zFTypeError: print_exception(): Exception expected for value, int found
)rrrrSr)r0rrns   r"test_print_exception_bad_type_capiz7TracebackFormatTests.test_print_exception_bad_type_capi(sI-
X
&	 &B	 OO9	
	 	 s	AA
cd}|jt|5tjddddy#1swYyxYw)Nz'Exception expected for value, int foundr9)rrr.r)r0msgs  r$test_print_exception_bad_type_pythonz9TracebackFormatTests.test_print_exception_bad_type_python3s:7

#
#Is
3	*%%b)	*	*	*s	8Ar)rrrrrrrrrrrr
r
rrr(r,r4r7r:r=rr rrrs*=*=X&0>{+zEE<<
::4	D	DD

*r rzG
The above exception was the direct cause of the following exception:

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

rQ|ryceZdZdZejj
dzZdZdZdZ	dZ
dZdZd	Z
d
ZdZdZd
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!dZ"dZ#y )!BaseExceptionReportingTestscht|tr|S	|y#t$r}|cYd}~Sd}~wwxYwr)
isinstance
BaseExceptionr)r0exception_or_callablers   rrz)BaseExceptionReportingTests.get_exceptionFs3+];((	!#	H	s	1,11rIcddzyrrr:s rzero_divz$BaseExceptionReportingTests.zero_divPs		!r ch|j}tr9|j|djd|j	d|dn8|j|djd|j	d|d|j|djd|dy)Nrz1/0 # In zero_divrrrZeroDivisionError)rlrrUrrW)r0r<ros   rcheck_zero_divz*BaseExceptionReportingTests.check_zero_divSs  OOE"I00:;MM-uRy9OOE"I00:;MM-uRy9b	,,-@A59Mr cD	ddz|jj}tr?|j	t|d|j
|djdn>|j	t|d|j
|djd|j
|djd|j
|djd|jd	|d
y#t$r
}|}Yd}~d}~wwxYw)NrJrrIrarIrrrz1/0 # MarkerrL)	rI
get_reportrlrrSrTrUrrWr0rrros    rtest_simplez'BaseExceptionReportingTests.test_simple]s	
aC"--/ SZ+OOE!H//0CDESZ+OOE!H//0CDEa++K89a++H56

neAh/!	A	sD			DDDcfdfd}tjj|}jt	|dj|dt
j
|djd|dy)NcX	jy#t$r}t|d}~wwxYwrrFrIr)rr0s rinner_raisez;BaseExceptionReportingTests.test_cause.<locals>.inner_raisens)
&

$
&A%
&s	)$)cyrrrRsrouter_raisez;BaseExceptionReportingTests.test_cause.<locals>.outer_raisesMr rarJrinner_raise() # MarkerrL
boundariessplitrLrSrT
cause_messagerJrWr0rUblocksrRs`  @r
test_causez&BaseExceptionReportingTests.test_causemss	&
	!!$//+">?Va(M2F1I&

.q	:r cfdfd}tjj|}jt	|dj|dt
j
|djd|dy)NcN	jy#t$rtwxYwrrQr:srrRz=BaseExceptionReportingTests.test_context.<locals>.inner_raise|s%


$

s$cyrrrTsrrUz=BaseExceptionReportingTests.test_context.<locals>.outer_raiserVr rarJrrWrL)rYrZrLrSrTr&rJrWr\s`  @rtest_contextz(BaseExceptionReportingTests.test_context{ss	
	!!$//+">?Va(O4F1I&

.q	:r c		t#tdxYw#t$r}|}Yd}~nd}~wwxYw|j|j}|j	t|d|j
|djd|j
|djd|j
|djd|jd|d	y)
NrIrarIrrrJrzZeroDivisionError from NonerL)	rrIrLrlrSrTrUrrWrMs    rtest_context_suppressionz4BaseExceptionReportingTests.test_context_suppressions	
2
2'T1 	A	"--/UQ'a++,?@Aa++K89a++H56

3U1X>s			*%*cfdfd}tjj|}jt	|dj|dt
j
|djd|dy)Nc	j	ty#t$r}|}Yd}~d}~wwxYw#t$rtwxYwr)rFrIxyzzy	NameErrorr)_err0s  rrRzGBaseExceptionReportingTests.test_cause_and_context.<locals>.inner_raisesH



&%


&A%
&s3	0+0AcyrrrTsrrUzGBaseExceptionReportingTests.test_cause_and_context.<locals>.outer_raiserVr rarJrrWrLrXr\s`  @rtest_cause_and_contextz2BaseExceptionReportingTests.test_cause_and_contextss	&	!!$//+">?Va(M2F1I&

.q	:r crfdfd}tjj|}jt	|dj|dt
j
d|djd|dj
d|d	j|d	y)
Nc		jy#t$r}|}t|d}~wwxYw#t$r}|d}~wwxYwrrQ)rr=r0s  rrRzEBaseExceptionReportingTests.test_cause_recursive.<locals>.inner_raisesK
*MMO(*A")*
Q
s"	,	',/	A;AcyrrrTsrrUzEBaseExceptionReportingTests.test_cause_recursive.<locals>.outer_raiserVr rarJzraise KeyError from erz1/0rWrL)	rYrZrLrSrTr[rWassertNotInrJr\s`  @rtest_cause_recursivez0BaseExceptionReportingTests.test_cause_recursives		!!$//+">?Va(M2

-vay9q	*	


.q	:F1I&r cd}|j|j}|j|ddd}|j|j}|j|ddy)Nctdd)Nr)rrrhello)rRrr rrzFBaseExceptionReportingTests.test_syntax_error_offset_at_eol.<locals>.esb"566r rz	        ^ctdy)Nzx = 5 | 4 |)r7rr rrzFBaseExceptionReportingTests.test_syntax_error_offset_at_eol.<locals>.es
r z               ^)rLrlrSr0rr<s   rtest_syntax_error_offset_at_eolz;BaseExceptionReportingTests.test_syntax_error_offset_at_eolsc	7ooa ++-R+.	 ooa ++-R"45r ctd}|j|j}|j|dgd|_|j|j}|j|ddgtd}d|_|j|j}|j|dgd|_|j|j}|j|ddgy)Nr`zSyntaxError: bad syntaxdz  File "<string>", line 100z	myfile.pyz#SyntaxError: bad syntax (myfile.py)z  File "myfile.py", line 100)rRrLrlrSrfilenamerus   rtest_syntax_error_no_linenoz7BaseExceptionReportingTests.test_syntax_error_no_linenos
%ooa ++-
&'	)ooa ++-
*,EF	H
% 
ooa ++-
23	5ooa ++-
+-FG	Ir cb|jtd}|jd||jtd}|jd||jt}|jd||jtd}|jd|y)NzException: None
Nonez
Exception
r)rLrrWrZs  rtest_message_nonez-BaseExceptionReportingTests.test_message_nonesooio.

)3/ooi/0

)3/ooik*

mS)ooim,

mS)r cftddD]!}dD]}d|zd|zz}dg}|dkr#|jd|jznx|d	kr=|jd|jz|jd
d|dz
zzn6|jd|jz|jd
dz|jd|jd
|jt	ddd||z|f}dj|}|j
||$y)Nr&)rrLrUztext%dz  File "file.py", line 1rJz    %srz    %s^z     zSyntaxError: msgrr<zfile.pyrN)rappendrdrLrRrrS)r0offsetaddrrr[exps       r!test_syntax_error_various_offsetsz=BaseExceptionReportingTests.test_syntax_error_various_offsetssBm	+F
+3wF!2267A:OOHt{{}$<=q[OOHt{{}$<=OOIfQh$@AOOHt{{}$<=OOI$78 23#ook%)Qs
TX9Y&Z[ii)  c*
+	+r ctd}|j|}|jd|j|j||dz|`|jd|j|j||dz|`|jd|j|j||dz|`|j|j||y)N{zMy NotezMy Note
rrNz	Your Notez
Your Note
r-rLadd_noterS	__notes__r0rvanillas   rtest_exception_with_notez4BaseExceptionReportingTests.test_exception_with_notessO//!$	

9+W{-BC
K	

2+Wt^<
K	

;+W}-DE
K+W5r ctd}|j|}Gdd}Gdd}||_d}|j|j|||zdz||_d}|j|j|||zdz|d	g|_d
}|j|j|||zdz|d	g|_d}|j|j|||zdzd
|_d}|j|j|||zdzd|_d}|j|j|||zdzy)NrceZdZdZdZy)OBaseExceptionReportingTests.test_exception_with_invalid_notes.<locals>.BadThingcy)Nbad strrr:s rrzWBaseExceptionReportingTests.test_exception_with_invalid_notes.<locals>.BadThing.__str__s r cy)Nbad reprrr:s r__repr__zXBaseExceptionReportingTests.test_exception_with_invalid_notes.<locals>.BadThing.__repr__ s!r Nrrrrrrr rBadThingrs
!
"r rceZdZdZy)RBaseExceptionReportingTests.test_exception_with_invalid_notes.<locals>.UnprintablectdN	bad valuerr:s rrz[BaseExceptionReportingTests.test_exception_with_invalid_notes.<locals>.Unprintable.__repr__%s
 --r N)rrrrrr rUnprintabler$s
.r rrrNz<__notes__ repr() failed>z
Final Noterz
Final Note
z<note str() failed>zplease 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')r-rLrrS)r0rrrr
notes_reprrbad_notes        r!test_exception_with_invalid_notesz=BaseExceptionReportingTests.test_exception_with_invalid_notessasO//!$	"	"	.	.j
+Wz-AD-HI!m-+Ww->-EF!
L1+Wx-?BR-RS$
|4'+Ww->AQ-QR1.+Ww->-EF:7+Ww->-EFr ctd}|j|}|jd|jd|jd|j|j||dzdzdz|`|jd|`|jd	|jd
|j|j||dzdzy)
Nr9zNote 1zNote 2zNote 3zNote 1
zNote 2
zNote 3
zNote 4zNote 5zNote 6zNote 5
zNote 6
rrs   r,test_exception_with_note_with_multiple_noteszHBaseExceptionReportingTests.test_exception_with_note_with_multiple_notesBsrN//!$	

8	

8	

8OOAj :-
:	<
K	

8
K	

8	

8OOAj :-	/r cNGdd}|j|jj}d}dj|jjj|jjj
g}|d|d}|j
|t|zy)Nc eZdZGddZy)>BaseExceptionReportingTests.test_exception_qualname.<locals>.Ac"eZdZGddeZy)@BaseExceptionReportingTests.test_exception_qualname.<locals>.A.BceZdZdZy)BBaseExceptionReportingTests.test_exception_qualname.<locals>.A.B.XcyNI am Xrr:s rrzJBaseExceptionReportingTests.test_exception_qualname.<locals>.A.B.X.__str__\s'r Nrrr rrr[s(r rN)rrrrrrr rBrZs(	(r rN)rrrrrr rrrYs
(
(r rrrrrN)rLrrrrrrS
MODULE_PREFIX)r0rr[rrrs      rtest_exception_qualnamez3BaseExceptionReportingTests.test_exception_qualnameXsy	(	(ooacceeg&	88QSSUU--qssuu/A/ABC$i0mc12r c`Gddt}dD]}||_|j|5|j|}d}|dvr
|j}n'dj|j|jg}|d|d	}|j
||dddy#1swYxYw)
NceZdZdZy)@BaseExceptionReportingTests.test_exception_modulename.<locals>.Xcyrrr:s rrzHBaseExceptionReportingTests.test_exception_modulename.<locals>.X.__str__gr Nrrr rrrf
 r r)rrsome_module)
modulenamer)rrrrrN)rrsubTestrLrrrS)r0rrr[rrrs       rtest_exception_modulenamez5BaseExceptionReportingTests.test_exception_modulenamees	 		 @
	+J%AL4
+ooac*$	!99 ~~H"xxq~~(FGH$,i8  c*
+
+
	+
+
+sA+B$$B-	ctjd}t|dd}ii}}t||||j	|d}d}|j||y)Nz~
            try:
                raise ValueError(42)
            except Exception as e:
                exc = e
            z<does not exist>r7r2z>  File "<does not exist>", line 3, in <module>
ValueError: 42
)rrrsr9r7rLrW)r0srcrrlr[rs       r'test_exception_angle_bracketed_filenamezCBaseExceptionReportingTests.test_exception_angle_bracketed_filenamevs`oos.721T1aooah'P

c3r cGddt}d|_|j|}d|jd}|j	||y)NceZdZdZy)LBaseExceptionReportingTests.test_exception_modulename_not_unicode.<locals>.Xcyrrr:s rrzTBaseExceptionReportingTests.test_exception_modulename_not_unicode.<locals>.X.__str__rr Nrrr rrrrr rr9z
<unknown>.z	: I am X
)rrrLrrS)r0rr[rs    r%test_exception_modulename_not_unicodezABaseExceptionReportingTests.test_exception_modulename_not_unicodesJ	 		 ooac"1>>**5c"r cGddt}|j|}d}dj|j|jg}|jt|z|d|dy)NceZdZdZy)@BaseExceptionReportingTests.test_exception_bad__str__.<locals>.Xcddzyrrr:s rrzHBaseExceptionReportingTests.test_exception_bad__str__.<locals>.X.__str__rr Nrrr rrrrr rrrrrN)rrLrrrrSrrs     rtest_exception_bad__str__z5BaseExceptionReportingTests.test_exception_bad__str__sb			ooac".	88Q\\1>>:;,
"YKr.JKr c	d}dtd|jdtd|jjdzd	}|j	|}|j||y)NcBtdtdtdgr]r_rr rr2zCBaseExceptionReportingTests.test_exception_group_basic.<locals>.excs 
1
y|'DEEr rar?, in get_exception
  |     exception_or_callable()
  |   File "rJa, in exc
  |     raise ExceptionGroup("eg", [ValueError(1), TypeError(2)])
  | ExceptionGroup: eg (2 sub-exceptions)
  +-+---------------- 1 ----------------
    | ValueError: 1
    +---------------- 2 ----------------
    | TypeError: 2
    +------------------------------------
rrrrrLrSr0r2rreports    rtest_exception_group_basicz6BaseExceptionReportingTests.test_exception_group_basicsp	F$:Xd.@.@-AB$:Xcll.I.IA.M-NO;
<	%*r c
d}dtd|jjdzdtd|jdtd|jjdzd
}|j	|}|j||y)	Nct}	|dtdtdg#t$r#}|dtdtdg|d}~wwxYw)Neg1rJrLeg2rarIr`r-rr)EGrs  rr2zCBaseExceptionReportingTests.test_exception_group_cause.<locals>.excsUB
FA	! =>>
FA	! =>AE
Fs%	AAArarraa, 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 "rra, in exc
  |     raise EG("eg2", [ValueError(3), TypeError(4)]) from e
  | ExceptionGroup: eg2 (2 sub-exceptions)
  +-+---------------- 1 ----------------
    | ValueError: 3
    +---------------- 2 ----------------
    | TypeError: 4
    +------------------------------------
rrrrrLrSrs    rtest_exception_group_causez6BaseExceptionReportingTests.test_exception_group_causes	F##+*HS\\5P5PST5T4UV#$,*HT5G5G4HI##+*HS\\5P5PST5T4UVBC0%*r cDd}dtd|jjdzdtd|jjdzdtd|jdtd|jjd	zd
}|j	|}|j||y)Nct}		|dtdtdg#|dtdtdgxYw#tdxYw)NrrJrLrrarIr)r`r-rImportError)rs rr2zRBaseExceptionReportingTests.test_exception_group_context_with_context.<locals>.excs^B
%CUZ]IaL$ABBCUZ]IaL$ABB
%!!n$s&AA
ArarrIa, 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 "ra, 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 "z7, in get_exception
    exception_or_callable()
  File "z1, in exc
    raise ImportError(5)
ImportError: 5
rrs    r)test_exception_group_context_with_contextzEBaseExceptionReportingTests.test_exception_group_context_with_contexts	%$:Xcll.I.IA.M-NO%:Xcll.I.IA.M-NO!z$*<*<)=> z#,,*E*E*I)JK 7!	@%*r cDd}dtd|jjdzdtd|jjdzdtd|jdtd|jjd	zd
}|j	|}|j||y)Nct}t}t}		|d|d|dg#t$r}|}Yd}~nd}~wwxYw|d|d||dg#|d|dgxYw)	NnestedrLrar^rJrItoprr)rVETErr2s     rr2zDBaseExceptionReportingTests.test_exception_group_nested.<locals>.excsBBB
)X1r!u~66 C1sBqE233
)A((s#,	A<AAAA.rar	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 "ra, 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 "rr%z, in exc
  |     raise EG("top", [VE(5)])
  | ExceptionGroup: top (1 sub-exception)
  +-+---------------- 1 ----------------
    | ValueError: 5
    +------------------------------------
rrs    rtest_exception_group_nestedz7BaseExceptionReportingTests.test_exception_group_nesteds	)##+*HS\\5P5PST5T4UV%&.Jhs||7R7RUV7V6WX#$,*HT5G5G4HI##+*HS\\5P5PSU5U4VWB3C@%*r cg}tdD]}|jt|td|}d}|j	|}|j||y)Nr^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
    +------------------------------------
)rrr-r`rLrS)r0excsr+r^rrs      r test_exception_group_width_limitz<BaseExceptionReportingTests.test_exception_group_width_limit2s_t	'AKK
1
&	'
D$
'!BF$*r c	td}tdD]'}td|t||t|g})d}|j	|}|j||y)Nbad typerr^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
    +------------------------------------
)rrr`r-rLrS)r0r2r+rrs     r test_exception_group_depth_limitz<BaseExceptionReportingTests.test_exception_group_depth_limit^sp
#t	6A QCAZ^46C	6
FBP%*r cDd}dtd|jdtd|jjdzdtd|jjdzdtd|jjdzd	}|j	|}|j||y)
Nc	g}dD]
}	t|td|#t$r/}|jd||j|Yd}~Od}~wwxYw#t$r}|jdd}~wwxYw)Nrzterrible valuethe rt>> Multi line note
>> Because I am such
>> an important exception.
>> empty lines work too

(that was an empty line)r-rrr`rr<rs   rr2zHBaseExceptionReportingTests.test_exception_group_with_notes.<locals>.excs
:'C'(o-'%Xt44&'

T#<0A'"


79
s<A"
A	A%AAAA	A=&A88A=rarrraQ, 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 "rz, 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
    +------------------------------------
rrs    rtest_exception_group_with_notesz;BaseExceptionReportingTests.test_exception_group_with_notess	&##+*HT5G5G4HI##+*HS\\5P5PST5T4UV%&.Jhs||7R7RUV7V6WX%&.Jhs||7R7RUV7V6WXB)C4%*r cDd}dtd|jdtd|jjdzdtd|jjdzdtd|jjdzd	}|j	|}|j||y)
NcJ	g}dD]
}	t|td|#t$rC}|jd||jd||j|Yd}~cd}~wwxYw#t$r(}|jd|jdd}~wwxYw)NrrzGoodbye rrzGoodbye!rrs   rr2zQBaseExceptionReportingTests.test_exception_group_with_multiple_notes.<locals>.excs
:'C'(o-'%Xt44	&'

T#<0

XcU#34A'
"


79

:&
s<A1"
A1	A.9A)$A1)A..A11	B":#BB"rarrr&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 "rz, 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
    +------------------------------------
rrs    r(test_exception_group_with_multiple_noteszDBaseExceptionReportingTests.test_exception_group_with_multiple_notess	*##+*HT5G5G4HI##+*HS\\5P5PSU5U4VW%&.Jhs||7R7RUV7V6WX%&.Jhs||7R7RUV7V6WXB-C:%*r cd}d}|}d}|jj}tj||||}t	}||_dtd|d}|j|}	dj|	jdD
cgc]}
|
jc}
}	|j|	|ycc}
w)Nc*tjSrrrrr rrmzTBaseExceptionReportingTests.test_KeyboardInterrupt_at_first_line_of_frame.<locals>.fs==?"r rrrz', in f
    def f():

KeyboardInterrupt
rN)rrtypes
TracebackTyper}rrrLrrZrstriprS)r0rmr(r!lastirr%r2rrrs           r-test_KeyboardInterrupt_at_first_line_of_framezIBaseExceptionReportingTests.test_KeyboardInterrupt_at_first_line_of_frames	#**

 
 %
?!'j9*+%T0BC1AHHJCD*Ds
B;N)$rrrrrrrrFrJrNr^rbrdrkrprvrzr}rrrrrrrrrrrrrrrrrrrr rr@r@Ds"**99A=MN0 ;;
?;('.	6I2	*+&6$)GV/,3+"
 	#L+(!+F,+\/+b*+XP+d/+b4+l+r r@ceZdZdZy)PyExcReportingTestscn|j|}djtjt	|||j
}t
d5}tjt	|||j
ddd|jj||S#1swY+xYw)Nrrn)
rrr.rr6rrrrSr)r0rssios    rrLzPyExcReportingTests.get_report7sq!GG&&tAw1??C
E
X
&	C#%%d1gq!//B	C+	C	Cs+B++B4N)rrrrLrr rrr1sr rceZdZedZy)CExcReportingTestscddlm}|j|}td5}||ddd|j	S#1swYj	SxYw)Nrrrn)rrrrr)r0rrrs    rrLzCExcReportingTests.get_reportFsO-q!
X
&	!A	zz|	zz|s	AAN)rrrrrLrr rrrAs
r rc^eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZy)
LimitTestsze Tests for limit argument.
        It's enough to test extact_tb, extract_stack and format_exception ctd)NzLast raisedrr:s rlast_raises1zLimitTests.last_raises1Ts

&&r c$|jyr)r	r:s rlast_raises2zLimitTests.last_raises2Wr c$|jyr)rr:s rlast_raises3zLimitTests.last_raises3Zrr c$|jyr)rr:s rlast_raises4zLimitTests.last_raises4]rr c$|jyr)rr:s rlast_raises5zLimitTests.last_raises5`rr c*tjSrrr:s rlast_returns_frame1zLimitTests.last_returns_frame1cs}}r c"|jSr)rr:s rlast_returns_frame2zLimitTests.last_returns_frame2f''))r c"|jSr)rr:s rlast_returns_frame3zLimitTests.last_returns_frame3irr c"|jSr)rr:s rlast_returns_frame4zLimitTests.last_returns_frame4lrr c"|jSr)rr:s rlast_returns_frame5zLimitTests.last_returns_frame5orr c\jfd}fd}tjtdd5|}j	t|dj
|d|dd||d	|d
ddj
|d|dd||d
|dd	t|dz
dz
j
|d
gt`|||ddt_j
||ddj
|d|ddj
|d|ddd
t_j
|gdt_j
|gdddy#1swYyxYw)Nc0tjfi|Srr.
extract_stack)kwargsr!s rextractz.LimitTests.test_extract_stack.<locals>.extractts**5;F;;r cj|d||d|j||dzd||dzdjt|t|yrM)rSrT)rrignorer0s   rassertEqualExceptz8LimitTests.test_extract_stack.<locals>.assertEqualExceptvs^VGV_hw.?@VF1HI.0CDS[#h-8r tracebacklimitrrrLlimitrrxiirJrrarHr)rr	swap_attrr
assertGreaterrTrSr')r0r#r&nolimr!s`   @rtest_extract_stackzLimitTests.test_extract_stackrs((*	<	9


s$4d
;	,IEs5z1-W1-uRSz:gC0%,EW2.bq	:gD15#;E
1QOW1-r2"gi5!"CWYbc
3W1-uRSz:W2.bq	:!"CWY+!#CWY+#	,	,	,sE!F""F+c	|jfd}tjt
dd5|}|j
t|d|j
|d|dd|j
|d||j
|d|dd|j
|d	||j
|d
gt
`|j
||dt
_|j
||dd|j
|d|dd|j
|d|ddd
t
_|j
|gd
t
_|j
|gdddy#t$r}|jYd}~d}~wwxYw#1swYyxYw)Nc0tjfi|Sr)r.
extract_tb)r"r%s rr#z+LimitTests.test_extract_tb.<locals>.extracts''5f55r r'rrrLr(r&rrrarHr)	rrrrr*rrSrTr')r0rr#r,r%s    @rtest_extract_tbzLimitTests.test_extract_tbs	!	6

s$4d
;	,IESZ-W1-uRay9W2.6W2.bc
;W3/7W1-r2"WY.!"CWYbq	2W1-uRay9W2.bc
;!"CWY+!#CWY+#	,	,	!B	!
	,	,s#F E$G 	G)F;;GGc	|jfd}tjtdd5|}|jt
|d|j|d|dd|j|d||j|d|dd|j|d	||j|d
gt`|j||dt_|j||dd|j|d|dd|j|d|ddd
t_|j|gd
t_|j|gdddy#t$r
}|Yd}~d}~wwxYw#1swYyxYw)Nc6tjfi|ddS)NrJr)r.r)r"r2s rr#z1LimitTests.test_format_exception.<locals>.extracts --c<V<QrBBr r'rrrLr(r&rr1rrarHr)rrrr*rrSrTr')r0rr#r,r2s    @rtest_format_exceptionz LimitTests.test_format_exceptions	
	C

s$4d
;	,IESZ-W1-uRay9W2.6W2.bc
;W3/7W1-r2"WY.!"CWYbq	2W1-uRay9W2.bc
;!"CWY+!#CWY+#	,	,	C		,	,s#F E$F9 	F6)F11F69GN)rrrrr	rrrrrrrrrr-r2r5rr rrrOsIN'****,8,6,r rceZdZdZdZy)MiscTracebackCasescfd}fdd	|jjjj}|j	t|jdtj||j	t|jdy#t$r}|j}Yd}~d}~wwxYw)Ncyrr)middlesrouterz,MiscTracebackCases.test_clear.<locals>.outersHr cyrr)innersrr:z-MiscTracebackCases.test_clear.<locals>.middlesGr cd}ddzyrr)r+s rr=z,MiscTracebackCases.test_clear.<locals>.innersA
aCr rJr)	rCrr(r&rSrTr$r.clear_frames)r0r;rr%inner_framer=r:s     @@r
test_clearzMiscTracebackCases.test_clears				!G
jj((0099[112A6	r"	
[112A6	!B	!sB""	C+B<<Ccd}|}|jj}|j|ddt|dzddft|dzddfg|jt	|d	d
y)Nc*tjSrr rr rr#z6MiscTracebackCases.test_extract_stack.<locals>.extracts**,,r rrLr-zresult = extract()rJr#z return traceback.extract_stack()rrI)rrrSrrT)r0r#rrs    rr-z%MiscTracebackCases.test_extract_stacksw	-!!00
vax!57KL
vax,NO'		
VAY+r N)rrrrAr-rr rr7r7s
70	,r r7c*eZdZdZdZdZdZdZy)	TestFramec@tjtjdtt	j
ddd}|j
|d|j
t|d|j
|t	j
ddd|j
|t||j
t|||j|j|j|t|j
|ty)NrmrJdummy)rmrJrG%"""Test cases for traceback module""")
	linecache
clearcache	lazycacheglobalsr.FrameSummaryrStupleassertIsNonelocalsassertNotEqualobjectr	r0rms  rtest_basicszTestFrame.test_basicssC+""373F	HqF	HI2237CDE!H%	
q1%!((#Avx(I&r c
tjtjdddd}|j	d|j
tjdt|j	d|jy)NrmrJrGF)lookup_linerH)	rIrJr.rMrS_linerKrLlinerSs  rtest_lazy_lineszTestFrame.test_lazy_lines	sb""37Fqww'C+3
FF	r cjtjddd}|j|jdy)NrmrGr.rMrSrXrSs  rtest_no_linezTestFrame.test_no_line	s*""3g6&r cntjdddd}|jd|jy)NrmrJrGrXrXr[rSs  rtest_explicit_linezTestFrame.test_explicit_line	s,""37@(r cltjdddd}|jt|dy)NrmrJrGrXr^rI)r.rMrSrTrSs  rtest_lenzTestFrame.test_len	s,""37@Q#r N)rrrrTrYr\r_rarr rrErEs'"')$r rEc`eZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZy)	TestStackcd}ttjd}|}|jt	|t	|z
d|j|dd|y)Nc>ttjdSr)listr.
walk_stackrr rdeeperz)TestStack.test_walk_stack.<locals>.deeper	s	,,T233r rJ)rfr.rgrSrT)r0rhs1s2s    rtest_walk_stackzTestStack.test_walk_stack	sV	4
)&&t,
-
XR3r7*A.AB$r c	ddzttj}|jt
|dy#t$r}|j}Yd}~Td}~wwxYwr)rrrfr.walk_tbrSrT)r0rr%rs    rtest_walk_tbzTestStack.test_walk_tb#	sT	!
aC
""2&'Q#	!B	!sA	A 
AA ctjjtjd}|j	|tjyr)r.StackSummaryr#rgassertIsInstancer0rs  rr-zTestStack.test_extract_stack+	s9""**9+?+?+EFa!7!78r ctjjtjdd}|j	t|dy)Nrr()r.rpr#rgrSrTrrs  rtest_extract_stack_limitz"TestStack.test_extract_stack_limit/	s<""**9+?+?+EQ*OQ#r cZtjtjdtt	dd}t|dd}tjjt|dfgd}tj|j|djdy)N/foo.pyrrTlookup_linesr
import sys)rIrJupdatecacherL	test_code
test_framer.rpr#rrSrXr0rNrmrs    rtest_extract_stack_lookup_linesz)TestStack.test_extract_stack_lookup_lines3	si3i*q$%""**4!Q>*M1L1r crtjtdd}t|dd}tj
j
t|dfgd}|jitjtjdt|j|djdy)NrvrrFrwrry)
rIrJr{r|r.rpr#rrScacherzrLrXr}s    r*test_extract_stackup_deferred_lookup_linesz4TestStack.test_extract_stackup_deferred_lookup_lines<	si*q$%""**4!Q>*NY__-i31L1r ctjjdg}|jdg|j	yNfoo.pyrJfredrXz*  File "foo.py", line 1, in fred
    line
r.rp	from_listrSrrrs  rtest_from_listzTestStack.test_from_listE	s9"",,.K-LM
;<
HHJ	r ctjjdg}d|d<tjj|}|jdg|j	y)Nr)rrLrrXrz*  File "foo.py", line 2, in fred
    line
r)r0rrjs   rtest_from_list_edited_stackz%TestStack.test_from_list_edited_stackK	sX"",,.K-LM,!

#
#
-
-a
0
;<IIK	r ctjjdg}|jdg|j	yrrrrs  rtest_format_smokezTestStack.test_format_smokeS	s;
"",,.K-LM
;<
HHJ	r c"tjdttdd}t	|tddi}t
jjt|dfgd}|j|djdd	iy)
Nrvr	somethingrJrTcapture_localsr1rIrzrLr{r|r.rpr#rrSrPr}s    rtest_localszTestStack.test_locals[	swi3i*q')k1%56""**4!Q>$*O1{C&89r ctjdttdd}t	|tddi}t
jjt|dfg}|j|djdy)NrvrrrJrrrr}s    rtest_no_localszTestStack.test_no_localsb	smi3i*q')k1%56""**4!Q>:1d+r cd}|dd}|jdt|jjdzfzg|j	y)Nctd}d}tjjtjdddS)NrJrLT)rr))r.rpr#rg)kvrr7s    r
some_innerz0TestStack.test_format_locals.<locals>.some_innerj	s>AA))11$$T*4q2J
Jr rarIzw  File "%s", line %d, in some_inner
    return traceback.StackSummary.extract(
    a = 1
    b = 2
    k = 3
    v = 4
)rSrrrr)r0rrs   rtest_format_localszTestStack.test_format_localsi	sZ	J

q!
'
(;(;(J(JQ(NOP
xxz	r cGddtjfd}|}|j|jtd|j
jdzgy)NceZdZdZy)>TestStack.test_custom_format_frame.<locals>.CustomStackSummaryc8|jd|jS)N:)ryr)r0
frame_summarys  rformat_frame_summaryzSTestStack.test_custom_format_frame.<locals>.CustomStackSummary.format_frame_summary{	s!'001=3G3G2HIIr N)rrrrrr rCustomStackSummaryrz	s
Jr rcPjtjddS)NrJr()r#r.rg)rsrrz6TestStack.test_custom_format_frame.<locals>.some_inner~	s+%--$$T*!.5
5r rrJ)r.rprSrrrr)r0rrrs   @rtest_custom_format_framez"TestStack.test_custom_format_framey	s`	J!7!7	J	5
L
HHJz:..==AB
CD	Fr cbdfd}|}Gddtj}|jtj|j	}|jt
|djjdz}|j|ddtd|d	y)
Ncddzyrrrr rrmz)TestStack.test_dropping_frames.<locals>.f		
aCr cZ	y#t$r}|jcYd}~Sd}~wwxYwr)rr)rrms rrz)TestStack.test_dropping_frames.<locals>.g	s'
'
'&
's	*%**ceZdZfdZxZS).TestStack.test_dropping_frames.<locals>.Skip_GcB|jdk(ryt|	|S)Nr)namesuperr)r0rr~s  rrzCTestStack.test_dropping_frames.<locals>.Skip_G.format_frame_summary	s$ %%,w3MBBr )rrrr
__classcell__r~s@rSkip_Gr	s
C
Cr rrJrrrz, in f
    1/0
)
r.rpr#rmrrSrTrrr)r0rr%rstacklnorms      @rtest_dropping_frameszTestStack.test_dropping_frames	s		'S	CY++	Cb!##)68		
UQ'jj''!+!Hxj->?	
r N)rrrrkrnr-rtr~rrrrrrrrrrr rrcrc	sI%$9$22:, F
r rcceZdZdefdZy)Unrepresentablerctd)Nrrr:s rrzUnrepresentable.__repr__	s)**r N)rrrrrrr rrr	s+#+r rceZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZedZy)TestTracebackExceptioncj	ddz|jdj|jd|j|jd|j|j|j|jt|j|jt|t|y#t$rh}|}tjj|}tjjtj|j}Yd}~&d}~wwxYw)NrJrFrr.TracebackExceptionfrom_exceptionrpr#rmrrS	__cause____context____suppress_context__rr6exc_typer)r0rexc_objr2expected_stacks     r
test_smokez!TestTracebackException.test_smoke	s	4
aC	
s}}-s/ 8 893g5Ws3x0	4G..==a@C&33;;!!!//24N	4sC	D2
AD--D2cd}	||j}|j}|jd|j|jd|j|jd|j|j||j|jt|j |jt#|t#|y#t$r|}|}|j}tjj	tj
|ddd|_tjj|ddd|_	Yd}~Rd}~wwxYw)Ncddzyrrrr rrz7TestTracebackException.test_from_exception.<locals>.foo	rr rJFT)r)rxr)rrr.rpr#rmrrrr2rSrrrrr6rr)r0rrrr%rr2s       rtest_from_exceptionz*TestTracebackException.test_from_exception	s,			EE,,hhs}}-s/ 8 893g5Ws3x0	EGB"+"8"8"@"@!!"%QU##A#%D!33BBtCEDHH
	EsC	E#'A1EE#c		ddztj}tjj	|}td}td|#tj}tjj	|}td}td|xYw#t
$rg}|}tjj	|}tjjtj|j}Yd}~nd}~wwxYwtjt
d}|j||j|j|j|jd|j|j||j|jt||j |jt#|t#|y)NrJrcauseuh ohTrrr.rrrrpr#rmrrSrrrrr6rr)r0r2exc_contextrrrr	exc_causes        rr^z!TestTracebackException.test_cause	sq	4
4!mmo'::II#N!'*(e3mmo'::II#N!'*(e3	4G..==a@C&33;;!!!//24N	4
00E4H	CMM2coo6s7783g5Ws3x0s+AA
B ABB  	D)ADDcj		ddztj}tjj	|}td#tj}tjj	|}tdxYw#t
$rg}|}tjj	|}tjjtj|j}Yd}~nd}~wwxYw|jd|j|j|j|jd|j|j||j|jt||j |jt#|t#|y)NrJrrFrr0r2rrrrs      rrbz#TestTracebackException.test_context	sE	4
)!mmo'::II#N((mmo'::II#N((	4G..==a@C&33;;!!!//24N	4
	
s}}-coo6 8 893g5Ws3x0s)A>B?BB	C8AC33C8c	fd	|jdtjj	}t|j
}|jt|tj|jt|Dcgc]	}d|vs|c}tjdz|jd|dy#t$r}|}Yd}~d}~wwxYwcc}w)Nc.	ddzy#YyxYwrrrsrrmz9TestTracebackException.test_long_context_chain.<locals>.f	s
!
s		zException not raisedzZeroDivisionError:g?z0RecursionError: maximum recursion depth exceededr)rrr.rrrfrr+rTrrrW)r0rrteresrrms      @rtest_long_context_chainz.TestTracebackException.test_long_context_chain	s		.
C
II,-

)
)
8
8
A299;	
3s8S%:%:%<=C=q#71#<=>!!#c)	+	


>B	I	G	>s#C	C6#C6	C3'C..C3c		ddztd}td|#td}td|xYw#t$ri}|}tjj|d}tjjtj|j}Yd}~nd}~wwxYwtjtd}|j||j|jd|j|jd|j|j||j|jt||j|jt|t|y)NrJrrrTcompactr)r0rrrr2rrs       rtest_compact_with_causez.TestTracebackException.test_compact_with_cause
s6
	:
4!!'*(e3"'*(e3	:G..==gt=TC&33;;!!'"7"78:N	:
00E4H	CMM2s/s7783g5Ws3x0s":7:	B,AB''B,cn		ddztj}tjj	|}td#tj}tjj	|}tdxYw#t
$ri}|}tjj	|d}tjjtj|j}Yd}~nd}~wwxYw|jd|j|j|j|jd|j|j||j|jt||j |jt#|t#|y)NrJrrTrFrrs      rtest_compact_no_causez,TestTracebackException.test_compact_no_cause&
sL	:
)!mmo'::II#N((mmo'::II#N((	:G..==a=NC&33;;!!'"7"78:N	:
	
s}}-coo6 8 893g5Ws3x0s)A>B?BB	C:AC55C:c	ddztj}tj|j}tj
j
|}|jtj|||jtj|j|y#t$r}|}Yd}~d}~wwxYwr)rrgetrefcountrr.rrrS)r0rrrefcnt1refcnt2r2s      r/test_no_refs_to_exception_and_traceback_objectszFTestTracebackException.test_no_refs_to_exception_and_traceback_objects:
s	
aC//'*//'"7"78**99'B17;)>)>?I	G	sB//	C8B??Ccd	ddz|j	|j|||j
|t|j|ty#t$rJ}|}tjj|}tjj|}Yd}~d}~wwxYwr)	rr.rrassertIsNotrSrQrRr	)r0rrr2exc2s     rtest_comparison_basicz,TestTracebackException.test_comparison_basicF
s	H
aC
	
d#d#C*i(	HG..==gFC//>>wGD	HsA	B/%AB**B/cdfd}	|tjj}tjj|d}tjj|d}|j	|||j||tjj|d}|j||tjj|d}tjj|dd	}	|j	||	tjj|d
}
tjj|d
d	}|j|
|y#t$r
}|}Yd}~td}~wwxYw)Nc&	td#xYwrrrr r	raise_exczKTestTracebackException.test_comparison_params_variations.<locals>.raise_excS
s
 --
s
cd\}}y)N)rJrLr)r<rPrs  rraise_with_localszSTestTracebackException.test_comparison_params_variations.<locals>.raise_with_localsY
sDAqKr r&r(rLTrr)r)rr)rr.rrrSrQ)
r0rrrr2exc1rexc3exc4exc5exc6exc7rs
            @r!test_comparison_params_variationsz8TestTracebackException.test_comparison_params_variationsR
sa			**99'B++::7":M++::7!:Ld#C&++::7SW:XC&++::7":M++::7"]a:bt$++::7":M++::7"]a:bD$'-	G	sE55	F>FFcxg}tdD]}	ddz
|j
|d|d|j
t|djt|djy#t$r8}|jtjj|Yd}~d}~wwxYwr )	rrrr.rrrSrfr)r0rrrs    r/test_comparison_equivalent_exceptions_are_equalzFTestTracebackException.test_comparison_equivalent_exceptions_are_equalw
sq	LA
L!	L
	
a$q'*d1gnn./d1gnn6F1GH
LI88GGJKK
LsA88	B9.B44B9cRGddt}|d}|d}	||#|$r	|#|$r}|}Yd}~nd}~wwxYwYnwxYwtjj|}t	|j}|j
d|d|j
d|dy)	NceZdZdZy)CTestTracebackException.test_unhashable.<locals>.UnhashableExceptioncyrrrs  rrzJTestTracebackException.test_unhashable.<locals>.UnhashableException.__eq__
rr Nr rr rr!r
r"r r!r#r$zUnhashableException: ex2
rLzUnhashableException: ex1
r)rr.rrrfrrW)r0r!r#r$rrr2	formatteds        rr(z&TestTracebackException.test_unhashable
s	)	"%(!%(	3"	
	&

		
**99'B&	

2IaLA

2IaLAs)$A,=8A=AAcDfd	d|jjy#t$ri}tjj|d}tjjtj|jd}Yd}~d}~wwxYw)Nc,|r|dz
yddzyrr)nrecurses rrz2TestTracebackException.test_limit.<locals>.recurse
s!!r r&rr()
rr.rrrpr#rmrrSr)r0rr2rrs    @r
test_limitz!TestTracebackException.test_limit
s	
	=BK
	
3		=..==aq=IC&33;;!!!//2!<=N	=s-	BABBctjtd}tdd}t	|dd}t|ddd}t
jt||d}|jtjitjdt|j|jdjdy)	NrrvrrrFrwry)rIrJrr{r|test_tbr.rrSrrzrLrrXr0rrNrmr%r2s      rtest_lookup_linesz(TestTracebackException.test_lookup_lines
sgi*q$%
Q4
#**9a%P"-i31**L9r c`tjdttd}t	dd}t|tddt
d}t|ddd}tjt||d	
}|j|jdjddd
dy)NrvrrrJstring)rrunrepresentablerrTrrz'string'z<local repr() failed>)
rIrzrLrr{r|rrr.rrSrrPrs      rrz"TestTracebackException.test_locals
si3gi*q')1x\k\m%no
Q4
#**q"T3IIaL
G^_	ar c@tjdttd}t	dd}t|tddi}t
|ddd}tjt||}|j|jdjdy)NrvrrrrJrr)rIrzrLrr{r|rr.rrSrrPrs      rrz%TestTracebackException.test_no_locals
si3gi*q')k1%56
Q4
#**9a<1,,d3r ctjttdd}|jt	|jdgy)NhavenzException: haven
)r.rrrSrfr)r0r2s  rtest_traceback_headerz,TestTracebackException.test_traceback_header
s<**9i6H$Ocjjl+.B-CDr cd}tjj|d}t}|j	||j|j
jdddgdy)NcDd}	|dzy#t$r}|cYd}~Sd}~wwxYw)Nrr)r<rs  rrmz,TestTracebackException.test_print.<locals>.f
s(A
!

s
	TrrrNr)z    x/0z    ~^~z
    x = 12z#ZeroDivisionError: division by zeror)r.rrrrrSrrZ)r0rmr2rs    r
test_printz!TestTracebackException.test_print
sj	**99!#d9S		v	OO##D)"#.
	r N)rrrrrr^rbrrrrrrrr(rrrrrr
rrr rrr	su
11.1,1(I21(1(
J
)#(JIB&4	:
a4Er rcHeZdZfdZdZdZdZdZdZdZ	dZ
xZS)	&TestTracebackException_ExceptionGroupscLt||j|_yr)rsetUp_get_exception_groupr^)r0r~s rrz,TestTracebackException_ExceptionGroups.setUp
s

++-r cd}d}|jj|_|jj|_			|	|dtdg#t$r}|}Yd}~'d}~wwxYw#t$r}|}Yd}~6d}~wwxYw#t
$r}|}Yd}~nd}~wwxYw	|dn#t$r}|}Yd}~nd}~wwxYwtd|g#t
$r}|cYd}~Sd}~wwxYw)Ncddzyrrrr rrmzFTestTracebackException_ExceptionGroups._get_exception_group.<locals>.f
rr ct|rrrs rrzFTestTracebackException_ExceptionGroups._get_exception_group.<locals>.g
sQ-r r9rr)rrlno_flno_grr`r)	r0rmrrrrrrr^s	         rrz;TestTracebackException_ExceptionGroups._get_exception_group
s		 ZZ..
ZZ..
	
CbE%UT4L99
!D!D"


"

 t55	I	sAA6B	A3'A.)B.A33B6	B?BBBB	B#BCB##C'B0/C0	C9C;CCC	C+C& C+&C+c|j}tjt|||j}tjj|}|j
|||j||yr)r^r.rr6rrrrS)r0r^teg1teg2s    r!test_exception_group_constructionzHTestTracebackException_ExceptionGroups.test_exception_group_constructions_
WW++DHb":J:JK++::2>t$t$r ctjj|j}dj	|jj
d}dj
d}|j||y)NrrNz'ExceptionGroup: eg2 (2 sub-exceptions)
)r.rrr^rr/rZrS)r0tegrrs    r*test_exception_group_format_exception_onlyzQTestTracebackException_ExceptionGroups.test_exception_group_format_exception_onlys^**99$''BGGC5578>>tD	=CCDIH-r crtjj|j}dj	|jj
d}|j}|j}gddtd|dzddd	d
ddtd|d
zddddddtd|dzdddtd|dzdddddddtd|dzdddtd|dzdddd d!d"dtd|d#zdd$dtd|dzdd%d&d'}|j||y)(NrrNz6  + Exception Group Traceback (most recent call last):z  |   File "rr_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 "rz      |     f()rJrz      |     1/0z      |     ~^~z+      | ZeroDivisionError: division by zero*      +---------------- 2 ----------------
z      |     g(42)z, in gz      |     raise ValueError(v)z      | ValueError: 42+      +------------------------------------(    +---------------- 2 ----------------z(    | Traceback (most recent call last):r%z    |     g(24)z    |     raise ValueError(v)z    | ValueError: 24)    +------------------------------------)r.rrr^rrrZrrrrS)r0rrrrrs      rtest_exception_group_formatzBTestTracebackException_ExceptionGroups.test_exception_group_formatsf**99$''BGGCJJL)//5	



"L""8*HU2XJ>WX"H"A	"
?"O
"%XJhuRxj@YZ"J"C"A"A"'xjq	AZ["&"'xjq	H"&" &!""B#"$A%"&A'"('xjr
B[\)"*(+",'xjq	H-".6/"0-1"2B3"4?5"6?7"8%XJhuRxj@YZ9":&;"<%XJhuQwivF=">4?"@+A"B@C"DE"H	
H-r cg}g}tdD]}|jt|tdD]}|jt|t}|d|d||d|g}t
jj|d}dj|jjd	}gd
}|j||y)Nrar&r^rrrL)max_group_widthrrN)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)rrr-rr`r.rrrrrZrS)	r0excs1excs2r+rr^rrrs	         rtest_max_group_widthz;TestTracebackException_ExceptionGroups.test_max_group_width<sq	(ALLA'	(r	'ALL1&	'
r%'E5)9:
;**99"a9PGGCJJL)//5	,	
H-r c	Htd}tdD]$}tdt||t|g}&tj
j
|d}dj|jjd}gd}|j||y)	Nrrar2rL)max_group_depthrrN)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)rrr`r-r.rrrrrZrS)r0r2r+rrrs      rtest_max_group_depthz;TestTracebackException_ExceptionGroups.test_max_group_depthbs
#q	NA QBjm(LMC	N**99#q9QGGCJJL)//5	$	
H-r c	|j#t$r}|}Yd}~nd}~wwxYwtdD]}	|#t$r}|}Yd}~d}~wwxYwtj
j
}tj
j
|}tj
j
|d}tj
j
|d}|j|||j|||j|||j|||j|t|j|ty)Nri,r(ra)r^r`rrr.rrrrSrQrRr	)r0rr2rrrrnes        rtest_comparisonz6TestTracebackException_ExceptionGroups.test_comparison~s	''M	C	q	A
	

	
**99'B++::7C++::7#:N

)
)
8
8
8
Jd#d#d#C$C*i(s%	##7	AAA)rrrrrrrr(r/r2r5rrs@rr
r

s..*@%.+.Z$.L.8)r r
ceZdZd!dZdZdZdZdZdZdZ	d	Z
d
ZdZdZ
d
ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ d Z!y)"SuggestionFormattingTestBaseNcNfd}n}|j|dd}|dS)Nctyr)getattr)	attr_nameobjsrrz=SuggestionFormattingTestBase.get_suggestion.<locals>.callables
Y'r rrrr)r)r0r<r;rrs ``  rget_suggestionz+SuggestionFormattingTestBase.get_suggestions= 
(H))"*
Ar c	&Gdd}Gdd}Gdd}Gdd}Gd	d
}Gdd}Gd
d}|df|df|df|df|df|df|df|dffD].\}}	|j|d}
|j|	|
0y)Nc eZdZdxZxZxZZdZy)KSuggestionFormattingTestBase.test_getattr_suggestions.<locals>.SubstitutionN)rrrnoise
more_noiserbcblechrr rSubstitutionrAs*..E.J.REr rFc eZdZdxZxZxZZdZy)JSuggestionFormattingTestBase.test_getattr_suggestions.<locals>.EliminationN)rrrrBrCrrDblchrr rEliminationrHs*..E.J.RDr rJc eZdZdxZxZxZZdZy)GSuggestionFormattingTestBase.test_getattr_suggestions.<locals>.AdditionN)rrrrBrCrrDbluchinrr rAdditionrLs*..E.J.RGr rNceZdZdZdZy)ZSuggestionFormattingTestBase.test_getattr_suggestions.<locals>.SubstitutionOverEliminationN)rrrblachblucrr rSubstitutionOverEliminationrPsEDr rSceZdZdZdZy)WSuggestionFormattingTestBase.test_getattr_suggestions.<locals>.SubstitutionOverAdditionN)rrrrQbluchirr rSubstitutionOverAdditionrUsEFr rWceZdZdZdZy)VSuggestionFormattingTestBase.test_getattr_suggestions.<locals>.EliminationOverAdditionN)rrrblucharRrr rEliminationOverAdditionrYsFDr r[ceZdZdZdZdZy)YSuggestionFormattingTestBase.test_getattr_suggestions.<locals>.CaseChangeOverSubstitutionN)rrrLuchfluchBLuchrr rCaseChangeOverSubstitutionr]sDEEr ra
'bluchin'?'blech'?'blch'?'blach'?'bluc'?'BLuch'?bluchr>rW)r0rFrJrNrSrWr[racls
suggestionrs           rtest_getattr_suggestionsz5SuggestionFormattingTestBase.test_getattr_suggestionss														|$
:&
)$
|$
(*5
%z2
$i0
'4	 
	.OC((8FMM*f-	.r cjGdd}|j|d}|jd|y)NceZdZdZy)cSuggestionFormattingTestBase.test_getattr_suggestions_do_not_trigger_for_long_attributes.<locals>.ANrrrrErr rrroEr rsomethingverywrongrEr>ror0rrs   r;test_getattr_suggestions_do_not_trigger_for_long_attributeszXSuggestionFormattingTestBase.test_getattr_suggestions_do_not_trigger_for_long_attributess3		$$QS*>?&)r cpGdd}dD]}|j|5|j||}|jd||jd||jd||jd||jd	||jd
|dddy#1swYxYw)Nc eZdZdxZxZxZxZZy)oSuggestionFormattingTestBase.test_getattr_error_bad_suggestions_do_not_trigger_for_small_names.<locals>.MyClassN)rrrvvvmomrdidpythorr rMyClassrxs)--C-#--Br r}r7rmpyrDid you meanz'vvv'mom''id''w''pytho'rr>ro)r0r}rrs    rAtest_getattr_error_bad_suggestions_do_not_trigger_for_small_namesz^SuggestionFormattingTestBase.test_getattr_error_bad_suggestions_do_not_trigger_for_small_namess	.	.*	4D4(
4,,Wd;  8  0  &1  0  /  F3
4
4	4
4
4sA?B,,B5	cGdd}tdD]}t|d|d|j|d}|jd|y)NceZdZdZy)]SuggestionFormattingTestBase.test_getattr_suggestions_do_not_trigger_for_big_dicts.<locals>.ANrprr rrrrqr rr*index_rhrE)rsetattrr>ro)r0rindexrs    r5test_getattr_suggestions_do_not_trigger_for_big_dictszRSuggestionFormattingTestBase.test_getattr_suggestions_do_not_trigger_for_big_dictssZ		4[	/EAw'.	/$$QS'2&)r cGdd}|j|d}|jd|Gdd}|j|d}|jd|y)NceZdZdZdZy)HSuggestionFormattingTestBase.test_getattr_suggestions_no_args.<locals>.ANctrAttributeErrorr0attrs  r__getattr__zTSuggestionFormattingTestBase.test_getattr_suggestions_no_args.<locals>.A.__getattr__s$&&r rrrrErrr rrrsE
'r rrhrEceZdZdZdZy)rNctrrrs  rrzTSuggestionFormattingTestBase.test_getattr_suggestions_no_args.<locals>.A.__getattr__s$$r rrr rrzHSuggestionFormattingTestBase.test_getattr_suggestions_no_args.<locals>.AsE
%r rirts   r test_getattr_suggestions_no_argsz=SuggestionFormattingTestBase.test_getattr_suggestions_no_argss^	'	'
$$QS'2

gv&	%	%
$$QS'2

gv&r cGddGfdd}Gdd}Gdd}|||fD]+}|j|d	}|jd
|-y)NceZdZdZdZy)]SuggestionFormattingTestBase.test_getattr_suggestions_invalid_args.<locals>.NonStringifyClassNrrr rNonStringifyClassrsGHr rceZdZdZfdZy)MSuggestionFormattingTestBase.test_getattr_suggestions_invalid_args.<locals>.ANc$trr)r0rrs  rrzYSuggestionFormattingTestBase.test_getattr_suggestions_invalid_args.<locals>.A.__getattr__s$%6%899r r)rsrrrs
E
:r rceZdZdZdZy)MSuggestionFormattingTestBase.test_getattr_suggestions_invalid_args.<locals>.BNctdd)Nrr_rrs  rrzYSuggestionFormattingTestBase.test_getattr_suggestions_invalid_args.<locals>.B.__getattr__s$Wb11r rrr rrr
sE
2r rceZdZdZdZy)MSuggestionFormattingTestBase.test_getattr_suggestions_invalid_args.<locals>.CNctd)Nr_rrs  rrzYSuggestionFormattingTestBase.test_getattr_suggestions_invalid_args.<locals>.C.__getattr__s
$R((r rrr rCrsE
)r rrhrEri)r0rrrrjrrs      @r%test_getattr_suggestions_invalid_argszBSuggestionFormattingTestBase.test_getattr_suggestions_invalid_argssd			:	:
	2	2
	)	)
q!9	+C((8FMM'6*	+r cjGdd}|j|d}|jd|y)NceZdZdZy)NSuggestionFormattingTestBase.test_getattr_suggestions_for_same_name.<locals>.AcdgS)NrErr:s r__dir__zVSuggestionFormattingTestBase.test_getattr_suggestions_for_same_name.<locals>.A.__dir__s
y r N)rrrrrr rrrs
!r rrErrsrts   r&test_getattr_suggestions_for_same_namezCSuggestionFormattingTestBase.test_getattr_suggestions_for_same_names2	!	!$$QS'20r cGdd}|j|d}|jd||jd|y)NceZdZdZdZy)NSuggestionFormattingTestBase.test_attribute_error_with_failing_dict.<locals>.TrJctd)Noh no!rr:s rrzVSuggestionFormattingTestBase.test_attribute_error_with_failing_dict.<locals>.T.__dir__"s
$X..r N)rrrrhrrr rTr sE
/r rblichrErrs)r0rrs   r&test_attribute_error_with_failing_dictzCSuggestionFormattingTestBase.test_attribute_error_with_failing_dictsB	/	/
$$QS'2&)6*r c\d}|j|dd}|jd|dy)Nctdd)Nr
r_)rr<rrr r#raise_attribute_error_with_bad_namezlSuggestionFormattingTestBase.test_attribute_error_with_bad_name.<locals>.raise_attribute_error_with_bad_name*s bb11r rr=r6rror0rrs   r"test_attribute_error_with_bad_namez?SuggestionFormattingTestBase.test_attribute_error_with_bad_name)s<	2))/R4*
	
l2./r cGddGfdd}|j|d}|jd||jd|y)NceZdZdZy)RSuggestionFormattingTestBase.test_attribute_error_inside_nested_getattr.<locals>.ArJN)rrrrhrr rrr3sEr rceZdZfdZy)RSuggestionFormattingTestBase.test_attribute_error_inside_nested_getattr.<locals>.Bc*}|jSr)r)r0rrrs   r__getattribute__zcSuggestionFormattingTestBase.test_attribute_error_inside_nested_getattr.<locals>.B.__getattribute__7sCwwr N)rrrr)rsrrr6s
r rrrrhri)r0rrrs   @r*test_attribute_error_inside_nested_getattrzGSuggestionFormattingTestBase.test_attribute_error_inside_nested_getattr2sI				
$$QS+6

nf-

gv&r cttj}|jtj
|tjjt||jtjjdjtjtjd}||dzz}|j!||S)Nrr!)rz.py)rtempfilemkdtemprQshutilrmtreerpathrrpoprrandomchoicesr
ascii_letters
write_text)r0rtmpdirmod_namemodules     rmake_modulez(SuggestionFormattingTestBase.make_module?sh&&()

v.F$%776>>&*>*>"EF8e+,$r cj|fd}jtj|dd}|dS)Nc	tddy#t$r}|dd}~wt$r'}jdt	|Yd}~yd}~wwxYw)Nzfrom z import zExpected ImportError but got )r7rrrr6)rmodnamerr0s rrzISuggestionFormattingTestBase.get_import_from_suggestion.<locals>.callableOs\
EuWIXdV45
"T!
E		9$q'CDD
Es	A!AAArr=r)rrQrr)r0mod_dictrrrrs` `  @rget_import_from_suggestionz7SuggestionFormattingTestBase.get_import_from_suggestionLsQ""8,	E	
())"*
Ar c	tjd}tjd}tjd}tjd}tjd}tjd}tjd}|df|d	f|d
f|df|df|df|df|d
ffD])\}}	|j|d}
|j|	|
+y)NzP            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
        rbrcrdrerfrgrh)rrrsrrW)r0substitutioneliminationadditionsubstitutionOverEliminationsubstitutionOverAdditioneliminationOverAdditioncaseChangeOverSubstitutionrrkrs           rtest_import_from_suggestionsz9SuggestionFormattingTestBase.test_import_from_suggestions]s(

oo'

??$

'/oo7'
#
$,??4$
 
#+//3#

&.__6&
"|$
:&
)$
|$
(*5
%z2
$i0
'4	!
	.D*44T7CFMM*f-	.r cPd}|j|d}|jd|y)Nzblech = NonerrrErs)r0rrs   r?test_import_from_suggestions_do_not_trigger_for_long_attributesz\SuggestionFormattingTestBase.test_import_from_suggestions_do_not_trigger_for_long_attributess*$$T+?@&)r c`d}dD]}|j|5|j||}|jd||jd||jd||jd||jd||jd	|dddy#1swYxYw)
Nz!vvv = mom = w = id = pytho = Noner~rrz'vvv'rrrr)rrro)r0rrrs    rEtest_import_from_error_bad_suggestions_do_not_trigger_for_small_nameszbSuggestionFormattingTestBase.test_import_from_error_bad_suggestions_do_not_trigger_for_small_namess2)	4D4(
488tD  8  &1  &1  0  /  F3
4
4	4
4
4sA?B$$B-	ctdDcgc]}d|d
}}|jddj|}|j|d}|j	d|ycc}w)Nrz = z NonerUrhrE)rrrrro)r0rchunksrrs     r>test_import_from_suggestions_do_not_trigger_for_big_namespacesz[SuggestionFormattingTestBase.test_import_from_suggestions_do_not_trigger_for_big_namespacessc38:>%F5'%>>

gxx00w?&)	?s
A$c\d}|j|dd}|jd|dy)Nctddd)Nr
r_r%)rr<	name_from)rrr rrznSuggestionFormattingTestBase.test_import_from_error_with_bad_name.<locals>.raise_attribute_error_with_bad_names22<<r rr=r6rrs   r$test_import_from_error_with_bad_namezASuggestionFormattingTestBase.test_import_from_error_with_bad_names<	=))/R4*
	
l2./r cd}d}d}d}d}d}|df|df|d	f|d
f|df|dffD](\}}|j|}	|j||	*y)Nc6dx}x}x}}d}ttyrrrh)rBrCrrDrEs     rrFzNSuggestionFormattingTestBase.test_name_error_suggestions.<locals>.Substitutions"*..E.J.RE%Lr c6dx}x}x}}d}ttyrr)rBrCrrDrIs     rrJzMSuggestionFormattingTestBase.test_name_error_suggestions.<locals>.Eliminations"*..E.J.RD%Lr c6dx}x}x}}d}ttyrr)rBrCrrDrMs     rrNzJSuggestionFormattingTestBase.test_name_error_suggestions.<locals>.Additions"*..E.J.RG%Lr c*d}d}ttyrr)rQrRs  rrSz]SuggestionFormattingTestBase.test_name_error_suggestions.<locals>.SubstitutionOverEliminationsED%Lr c*d}d}ttyrr)rQrVs  rrWzZSuggestionFormattingTestBase.test_name_error_suggestions.<locals>.SubstitutionOverAdditionsEF%Lr c*d}d}ttyrr)rZrRs  rr[zYSuggestionFormattingTestBase.test_name_error_suggestions.<locals>.EliminationOverAdditionsFD%Lr rcrdrbz	'blucha'?reri)
r0rFrJrNrSrWr[r1rkrs
          rtest_name_error_suggestionsz8SuggestionFormattingTestBase.test_name_error_suggestionss	
	
	
	
	
	
#/
!;!,i 8!)< 8!8+ F!<j I!9: F!H	.D*((.FMM*f-	.r cPd}|j|}|jd|y)Nc"ttyr)rglobal_for_suggestiorr rr1zSSuggestionFormattingTestBase.test_name_error_suggestions_from_globals.<locals>.funcs&'r z'global_for_suggestions'?rir0r1rs   r(test_name_error_suggestions_from_globalszESuggestionFormattingTestBase.test_name_error_suggestions_from_globalss&	($$T*

16:r cPd}|j|}|jd|y)Nc"ttyr)rZeroDivisionErrrrrrr rr1zTSuggestionFormattingTestBase.test_name_error_suggestions_from_builtins.<locals>.funcs$%r 'ZeroDivisionError'?rirs   r)test_name_error_suggestions_from_builtinszFSuggestionFormattingTestBase.test_name_error_suggestions_from_builtinss&	&$$T*

,f5r cPd}|j|}|jd|y)Ncptj}t|d<tt	d|y)N__builtins__r)rLcopyrreval)custom_globalss rr1zlSuggestionFormattingTestBase.test_name_error_suggestions_from_builtins_when_builtins_is_module.<locals>.funcs*$Y^^-N-5N>*$+^<=r rrirs   rAtest_name_error_suggestions_from_builtins_when_builtins_is_modulez^SuggestionFormattingTestBase.test_name_error_suggestions_from_builtins_when_builtins_is_modules(	>$$T*

,f5r cPd}|j|}|jd|y)Nc&d}ttyr)rsomethingverywronghe)somethingverywronghehehehehehes rr1zdSuggestionFormattingTestBase.test_name_error_suggestions_do_not_trigger_for_long_names.<locals>.funcs-1*&'r somethingverywronghehersrs   r9test_name_error_suggestions_do_not_trigger_for_long_nameszVSuggestionFormattingTestBase.test_name_error_suggestions_do_not_trigger_for_long_namess*	($$T*16:r cd}d}d}d}d|fd|fd|fd|ffD]\}}|j|	5|j|}|jd
||jd||jd||jd
||jd||jd|dddy#1swYxYw)Nc$dx}x}x}x}}tyr)r7ryrzrdr{r|s     rf_bzhSuggestionFormattingTestBase.test_name_error_bad_suggestions_do_not_trigger_for_small_names.<locals>.f_b)--C-#--B
r c$dx}x}x}x}}tyrrrs     rf_vzhSuggestionFormattingTestBase.test_name_error_bad_suggestions_do_not_trigger_for_small_names.<locals>.f_vrr c$dx}x}x}x}}tyr)rrs     rf_mzhSuggestionFormattingTestBase.test_name_error_bad_suggestions_do_not_trigger_for_small_names.<locals>.f_m
rr c$dx}x}x}x}}tyr)rrs     rf_pyziSuggestionFormattingTestBase.test_name_error_bad_suggestions_do_not_trigger_for_small_names.<locals>.f_py
s)--C-#--Br r7rrrrzyou meanryrzrrrr)r0rrrrrr1rs        r>test_name_error_bad_suggestions_do_not_trigger_for_small_namesz[SuggestionFormattingTestBase.test_name_error_bad_suggestions_do_not_trigger_for_small_namess				 :SzC:d|L	4JD$4(
4,,T2  V4  /  /  0  /  F3
4
4	4
4
4sA>B<<C	cPd}|j|}|j|dy)Ncdx}x}x}x}x}x}x}x}x}x}	x}
x}x}x}
x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x} x}!x}"x}#x}$x}%x}&x}'x}(x})x}*x}+x},x}-x}.x}/x}0x}1x}2x}3x}4x}5x}6x}7x}8x}9x}:x};x}<x}=x}>x}?x}@x}Ax}Bx}Cx}Dx}Ex}Fx}Gx}Hx}Ix}Jx}Kx}Lx}Mx}Nx}Ox}Px}Qx}Rx}Sx}Tx}Ux}Vx}Wx}Xx}Yx}Zx}[x}\x}]x}^x}_x}`x}ax}bx}cx}dx}ex}fx}gx}hx}ix}jx}kx}lx}mx}nx}ox}px}qx}rx}sx}tx}ux}vx}wx}xx}yx}zx}{x}|x}}x}~x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}	x}
x}x}x}
x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x} x}!x}"x}#x}$x}%x}&x}'x}(x})x}*x}+x},x}-x}.x}/x}0x}1x}2x}3x}4x}5x}6x}7x}8x}9x}:x};x}<x}=x}>x}?x}@x}Ax}Bx}Cx}Dx}Ex}Fx}Gx}Hx}Ix}Jx}Kx}Lx}Mx}Nx}Ox}Px}Qx}Rx}Sx}Tx}Ux}Vx}Wx}Xx}Yx}Zx}[x}\x}]x}^x}_x}`x}ax}bx}cx}dx}ex}fx}gx}hx}ix}jx}kx}lx}mx}nx}ox}px}qx}rx}sx}tx}ux}vx}wx}xx}yx}zx}{x}|x}}x}~x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}	x}
x}x}x}
x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x} x}!x}"x}#x}$x}%x}&x}'x}(x})x}*x}+x},x}-x}.x}/x}0x}1x}2x}3x}4x}5x}6x}7x}8x}9x}:x};x}<x}=x}>x}?x}@x}Ax}Bx}Cx}Dx}Ex}Fx}Gx}Hx}Ix}Jx}Kx}Lx}Mx}Nx}Ox}Px}Qx}Rx}Sx}Tx}Ux}Vx}Wx}Xx}Yx}Zx}[x}\x}]x}^x}_x}`x}ax}bx}cx}dx}ex}fx}gx}hx}ix}jx}kx}lx}mx}nx}ox}px}qx}rx}sx}tx}ux}vx}wx}xx}yx}zx}{x}|x}}x}~x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}	x}
x}x}x}
x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}x}}ttyr)ra0( a1a2a3a4a5a6a7a8a9a10a11a12a13a14a15a16a17a18a19a20a21a22a23a24a25a26a27a28a29a30a31a32a33a34a35a36a37a38a39a40a41a42a43a44a45a46a47a48a49a50a51a52a53a54a55a56a57a58a59a60a61a62a63a64a65a66a67a68a69a70a71a72a73a74a75a76a77a78a79a80a81a82a83a84a85a86a87a88a89a90a91a92a93a94a95a96a97a98a99a100a101a102a103a104a105a106a107a108a109a110a111a112a113a114a115a116a117a118a119a120a121a122a123a124a125a126a127a128a129a130a131a132a133a134a135a136a137a138a139a140a141a142a143a144a145a146a147a148a149a150a151a152a153a154a155a156a157a158a159a160a161a162a163a164a165a166a167a168a169a170a171a172a173a174a175a176a177a178a179a180a181a182a183a184a185a186a187a188a189a190a191a192a193a194a195a196a197a198a199a200a201a202a203a204a205a206a207a208a209a210a211a212a213a214a215a216a217a218a219a220a221a222a223a224a225a226a227a228a229a230a231a232a233a234a235a236a237a238a239a240a241a242a243a244a245a246a247a248a249a250a251a252a253a254a255a256a257a258a259a260a261a262a263a264a265a266a267a268a269a270a271a272a273a274a275a276a277a278a279a280a281a282a283a284a285a286a287a288a289a290a291a292a293a294a295a296a297a298a299a300a301a302a303a304a305a306a307a308a309a310a311a312a313a314a315a316a317a318a319a320a321a322a323a324a325a326a327a328a329a330a331a332a333a334a335a336a337a338a339a340a341a342a343a344a345a346a347a348a349a350a351a352a353a354a355a356a357a358a359a360a361a362a363a364a365a366a367a368a369a370a371a372a373a374a375a376a377a378a379a380a381a382a383a384a385a386a387a388a389a390a391a392a393a394a395a396a397a398a399a400a401a402a403a404a405a406a407a408a409a410a411a412a413a414a415a416a417a418a419a420a421a422a423a424a425a426a427a428a429a430a431a432a433a434a435a436a437a438a439a440a441a442a443a444a445a446a447a448a449a450a451a452a453a454a455a456a457a458a459a460a461a462a463a464a465a466a467a468a469a470a471a472a473a474a475a476a477a478a479a480a481a482a483a484a485a486a487a488a489a490a491a492a493a494a495a496a497a498a499a500a501a502a503a504a505a506a507a508a509a510a511a512a513a514a515a516a517a518a519a520a521a522a523a524a525a526a527a528a529a530a531a532a533a534a535a536a537a538a539a540a541a542a543a544a545a546a547a548a549a550a551a552a553a554a555a556a557a558a559a560a561a562a563a564a565a566a567a568a569a570a571a572a573a574a575a576a577a578a579a580a581a582a583a584a585a586a587a588a589a590a591a592a593a594a595a596a597a598a599a600a601a602a603a604a605a606a607a608a609a610a611a612a613a614a615a616a617a618a619a620a621a622a623a624a625a626a627a628a629a630a631a632a633a634a635a636a637a638a639a640a641a642a643a644a645a646a647a648a649a650a651a652a653a654a655a656a657a658a659a660a661a662a663a664a665a666a667a668a669a670a671a672a673a674a675a676a677a678a679a680a681a682a683a684a685a686a687a688a689a690a691a692a693a694a695a696a697a698a699a700a701a702a703a704a705a706a707a708a709a710a711a712a713a714a715a716a717a718a719a720a721a722a723a724a725a726a727a728a729a730a731a732a733a734a735a736a737a738a739a740a741a742a743a744a745a746a747a748a749a750a751a752a753a754a755a756a757a758a759a760a761a762a763a764a765a766a767a768a769a770a771a772a773a774a775a776a777a778a779a780a781a782a783a784a785a786a787a788a789a790a791a792a793a794a795a796a797a798a799a800s                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 rr1ziSuggestionFormattingTestBase.test_name_error_suggestions_do_not_trigger_for_too_many_locals.<locals>.func
sO'daP
BP
P
bP
2P
P
RP
"P
rP
BP
P
P
P
P
!P
$'P
*-P
03P
69P
<?P
BEP
P
P
P
!P
$'P
*-P
03P
69P
<?P
BEP

P
P
P
"P
%(P
+.P
14P
7:P
=@P
CFP

	P
	P
	P
"	P
%(	P
+.	P
14	P
7:	P
=@	P
CF	P


P

P

P

"P

%(P

+.P

14P

7:P

=@P

CFP


P

P

P
"
P
%(
P
+.
P
14
P
7:
P
=@
P
CF
P

P
P
P
"P
%(P
+.P
14P
7:P
=@P
CFP

P
P
P
"P
%(P
+.P
14P
7:P
=@P
CFP

P
P
P
"P
%(P
+.P
14P
7:P
=@P
CGP

P
P
P
"&P
)-P
04P
7;P
>BP
EIP
LPP

P
P
P
"&P
)-P
04P
7;P
>BP
EIP
LPP

P
P
P
"&P
)-P
04P
7;P
>BP
EIP
LPP

P
P
P
"&P
)-P
04P
7;P
>BP
EIP
LPP

P
P
P
"&P
)-P
04P
7;P
>BP
EIP
LPP

P
P
P
"&P
)-P
04P
7;P
>BP
EIP
LPP
 
!P
 !P
 !P
 "&!P
 )-!P
 04!P
 7;!P
 >B!P
 EI!P
 LP!P
"
#P
"#P
"#P
""&#P
")-#P
"04#P
"7;#P
">B#P
"EI#P
"LP#P
$
%P
$%P
$%P
$"&%P
$)-%P
$04%P
$7;%P
$>B%P
$EI%P
$LP%P
&
'P
&'P
&'P
&"&'P
&)-'P
&04'P
&7;'P
&>B'P
&EI'P
&LP'P
(
)P
()P
()P
("&)P
()-)P
(04)P
(7;)P
(>B)P
(EI)P
(LP)P
*
+P
*+P
*+P
*"&+P
*)-+P
*04+P
*7;+P
*>B+P
*EI+P
*LP+P
,
-P
,-P
,-P
,"&-P
,)--P
,04-P
,7;-P
,>B-P
,EI-P
,LP-P
.
/P
./P
./P
."&/P
.)-/P
.04/P
.7;/P
.>B/P
.EI/P
.LP/P
0
1P
01P
01P
0"&1P
0)-1P
0041P
07;1P
0>B1P
0EI1P
0LP1P
2
3P
23P
23P
2"&3P
2)-3P
2043P
27;3P
2>B3P
2EI3P
2LP3P
4
5P
45P
45P
4"&5P
4)-5P
4045P
47;5P
4>B5P
4EI5P
4LP5P
6
7P
67P
67P
6"&7P
6)-7P
6047P
67;7P
6>B7P
6EI7P
6LP7P
8
9P
89P
89P
8"&9P
8)-9P
8049P
87;9P
8>B9P
8EI9P
8LP9P
:
;P
:;P
:;P
:"&;P
:)-;P
:04;P
:7;;P
:>B;P
:EI;P
:LP;P
<
=P
<=P
<=P
<"&=P
<)-=P
<04=P
<7;=P
<>B=P
<EI=P
<LP=P
>
?P
>?P
>?P
>"&?P
>)-?P
>04?P
>7;?P
>>B?P
>EI?P
>LP?P
@
AP
@AP
@AP
@"&AP
@)-AP
@04AP
@7;AP
@>BAP
@EIAP
@LPAP
B
CP
BCP
BCP
B"&CP
B)-CP
B04CP
B7;CP
B>BCP
BEICP
BLPCP
D
EP
DEP
DEP
D"&EP
D)-EP
D04EP
D7;EP
D>BEP
DEIEP
DLPEP
F
GP
FGP
FGP
F"&GP
F)-GP
F04GP
F7;GP
F>BGP
FEIGP
FLPGP
H
IP
HIP
HIP
H"&IP
H)-IP
H04IP
H7;IP
H>BIP
HEIIP
HLPIP
J
KP
JKP
JKP
J"&KP
J)-KP
J04KP
J7;KP
J>BKP
JEIKP
JLPKP
L
MP
LMP
LMP
L"&MP
L)-MP
L04MP
L7;MP
L>BMP
LEIMP
LLPMP
N
OP
NOP
NOP
N"&OP
N)-OP
N04OP
N7;OP
N>BOP
NEIOP
NLPOP
P
QP
PQP
PQP
P"&QP
P)-QP
P04QP
P7;QP
P>BQP
PEIQP
PLPQP
R
SP
RSP
RSP
R"&SP
R)-SP
R04SP
R7;SP
R>BSP
REISP
RLPSP
T
UP
TUP
TUP
T"&UP
T)-UP
T04UP
T7;UP
T>BUP
TEIUP
TLPUP
V
WP
VWP
VWP
V"&WP
V)-WP
V04WP
V7;WP
V>BWP
VEIWP
VLPWP
X
YP
XYP
XYP
X"&YP
X)-YP
X04YP
X7;YP
X>BYP
XEIYP
XLPYP
Z
[P
Z[P
Z[P
Z"&[P
Z)-[P
Z04[P
Z7;[P
Z>B[P
ZEI[P
ZLP[P
\
]P
\]P
\]P
\"&]P
\)-]P
\04]P
\7;]P
\>B]P
\EI]P
\LP]P
^
_P
^_P
^_P
^"&_P
^)-_P
^04_P
^7;_P
^>B_P
^EI_P
^LP_P
`
aP
`aP
`aP
`"&aP
`)-aP
`04aP
`7;aP
`>BaP
`EIaP
`LPaP
b
cP
bcP
bcP
b"&cP
b)-cP
b04cP
b7;cP
b>BcP
bEIcP
bLPcP
d
eP
deP
deP
d"&eP
d)-eP
d04eP
d7;eP
d>BeP
dEIeP
dLPeP
f
gP
fgP
fgP
f"&gP
f)-gP
f04gP
f7;gP
f>BgP
fEIgP
fLPgP
h
iP
hiP
hiP
h"&iP
h)-iP
h04iP
h7;iP
h>BiP
hEIiP
hLPiP
j
kP
jkP
jkP
j"&kP
j)-kP
j04kP
j7;kP
j>BkP
jEIkP
jLPkP
l
mP
lmP
lmP
l"&mP
l)-mP
l04mP
l7;mP
l>BmP
lEImP
lLPmP
n
oP
noP
noP
n"&oP
n)-oP
n04oP
n7;oP
n>BoP
nEIoP
nLPoP
p
qP
pqP
pqP
p"&qP
p)-qP
p04qP
p7;qP
p>BqP
pEIqP
pLPqP
r
sP
rsP
rsP
r"&sP
r)-sP
r04sP
r7;sP
r>BsP
rEIsP
rLPsP
t
uP
tuP
tuP
t"&uP
t)-uP
t04uP
t7;uP
t>BuP
tEIuP
tLPuP
v
wP
vwP
vwP
v"&wP
v)-wP
v04wP
v7;wP
v>BwP
vEIwP
vLPwP
x
yP
xyP
xyP
x"&yP
x)-yP
x04yP
x7;yP
x>ByP
xEIyP
xLPyP
z
{P
z{P
z{P
z"&{P
z)-{P
z04{P
z7;{P
z>B{P
zEI{P
zLP{P
|
}P
|}P
|}P
|"&}P
|)-}P
|04}P
|7;}P
|>B}P
|EI}P
|LP}P
~
P
~P
~P
~"&P
~)-P
~04P
~7;P
~>BP
~EIP
~LPP
@
AP
@AP
@AP
@"&AP
@)-AP
@04AP
@7;AP
@>BAP
@EIAP
@LPAP
B
CP
BCP
BCP
B"&CP
B)-CP
B04CP
B7;CP
B>BCP
BEICP
BLPCP
D
EP
DEP
DEP
D"&EP
D)-EP
D04EP
D7;EP
D>BEP
DEIEP
DLPEP
F
GP
FGP
FGP
F"&GP
F)-GP
F04GP
F7;GP
F>BGP
FEIGP
FLPGP
H
IP
HIP
HIP
H"&IP
H)-IP
H04IP
H7;IP
H>BIP
HEIIP
HLPIP
J
KP
JKP
JKP
J"&KP
J)-KP
J04KP
J7;KP
J>BKP
JEIKP
JLPKP
L
MP
LMP
LMP
L"&MP
L)-MP
L04MP
L7;MP
L>BMP
LEIMP
LLPMP
N
OP
NOP
NOP
N"&OP
N)-OP
N04OP
N7;OP
N>BOP
NEIOP
NLPOP
P
QP
PQP
PQP
P"&QP
P)-QP
P04QP
P7;QP
P>BQP
PEIQP
PLPQP
R
SP
RSP
RSP
R"&SP
R)-SP
R04SP
R7;SP
R>BSP
REISP
RLPSP
T
UP
TUP
TUP
T"&UP
T)-UP
T04UP
T7;UP
T>BUP
TEIUP
TLPUP
V
WP
VWP
VWP
V"&WP
V)-WP
V04WP
V7;WP
V>BWP
VEIWP
VLPWP
X
YP
XYP
XYP
X"&YP
X)-YP
X04YP
X7;YP
X>BYP
XEIYP
XLPYP
Z
[P
Z[P
Z[P
Z"&[P
Z)-[P
Z04[P
Z7;[P
Z>B[P
ZEI[P
ZLP[P
\
]P
\]P
\]P
\"&]P
\)-]P
\04]P
\7;]P
\>B]P
\EI]P
\LP]P
^
_P
^_P
^_P
^"&_P
^)-_P
^04_P
^7;_P
^>B_P
^EI4"Ir z
NameError.*a1)r>assertNotRegexrs   r>test_name_error_suggestions_do_not_trigger_for_too_many_localsz[SuggestionFormattingTestBase.test_name_error_suggestions_do_not_trigger_for_too_many_locals
s,S	j$$T*F$45r cd}|j|}|jd|d}|j|}|jd|y)Ncd}trrhrEs rr1zQSuggestionFormattingTestBase.test_name_error_with_custom_exceptions.<locals>.funcl
sE+r rEcd}trrDrEs rr1zQSuggestionFormattingTestBase.test_name_error_with_custom_exceptions.<locals>.funcs
sEOr rsrs   r&test_name_error_with_custom_exceptionszCSuggestionFormattingTestBase.test_name_error_with_custom_exceptionsk
sP	$$T*&)	$$T*&)r cGdd}|}|j|j}|jd|y)NceZdZdZdZy)ESuggestionFormattingTestBase.test_name_error_with_instance.<locals>.Acd|_yrrEr:s r__init__zNSuggestionFormattingTestBase.test_name_error_with_instance.<locals>.A.__init__|
	!
r cd}t}yrMrE)r0rr<s   rrzISuggestionFormattingTestBase.test_name_error_with_instance.<locals>.A.foo~
sr NrrrrLrrr rrrJ{
s
"
r r
self.blech)r>rrWr0rinstancers    rtest_name_error_with_instancez:SuggestionFormattingTestBase.test_name_error_with_instancez
s7		3$$X\\2

lF+r cGdd}|}|j|j}|jd|y)NceZdZdZdZy)NSuggestionFormattingTestBase.test_unbound_local_error_with_instance.<locals>.Acd|_yrrEr:s rrLzWSuggestionFormattingTestBase.test_unbound_local_error_with_instance.<locals>.A.__init__
rMr cd}}d}yrMr)r0rrEr<s    rrzRSuggestionFormattingTestBase.test_unbound_local_error_with_instance.<locals>.A.foo
sr NrOrr rrrV
s
"
r rrP)r>rrorQs    r&test_unbound_local_error_with_instancezCSuggestionFormattingTestBase.test_unbound_local_error_with_instance
s9		3$$X\\2v.r cPd}|j|}|jd|y)Nc"d}td}y)Nrar)r	somethongs  rr1zRSuggestionFormattingTestBase.test_unbound_local_error_does_not_match.<locals>.func
sI)Ir rrsrs   r'test_unbound_local_error_does_not_matchzDSuggestionFormattingTestBase.test_unbound_local_error_does_not_match
s)	
$$T*f-r cPd}|j|}|jd|y)Nc,tj}yr)iorstreams rr1zMSuggestionFormattingTestBase.test_name_error_for_stdlib_modules.<locals>.func
s
[[]Fr zforget to import 'io'rirs   r"test_name_error_for_stdlib_modulesz?SuggestionFormattingTestBase.test_name_error_for_stdlib_modules
s(	#$$T*

-v6r cPd}|j|}|jd|y)Nc,tj}yr)_iorras rr1zUSuggestionFormattingTestBase.test_name_error_for_private_stdlib_modules.<locals>.func
s
\\^Fr zforget to import '_io'rirs   r*test_name_error_for_private_stdlib_moduleszGSuggestionFormattingTestBase.test_name_error_for_private_stdlib_modules
s(	$$$T*

.7r r)"rrrr>rlrurrrrrrrrrrrrrrrrrrr
rrrArGrSrYr]rcrgrr rr7r7s
).V*4	*'"+01+0'"0.d*4*0&.P;66;48W6r
*
,/.78r r7ceZdZdZy)#PurePythonSuggestionFormattingTestsrNrrr rriri
s
r riceZdZdZy) CPythonSuggestionFormattingTestsrNrrr rrkrk
sr rkcHeZdZdZdZejddZy)MiscTestct}dh}ttD]J}|jds||vrt	t|}t	|dddk(s:|j|L|j
tj|y)N
print_listrrr.)setdirr.rr:rassertCountEqual__all__)r0rdenylistr
module_objects     rtest_allzMiscTest.test_all
sz5 >	N	#Ds#tx'7#It4M}lD9[HT"	#	
i//:r cfd}|ddd|ddd|ddd|dd	d|d
dd|d
dd|ddd|ddd|ddd|ddd|ddd|ddd|ddd|dd d|d!d"d#|d$d%d&|d$d'd(|d)d*d|d)d+d&|d,d-dy).NcXtj||d}j||y)Ni)r._levenshtein_distancerS)rr7rrr0s    rCHECKz1MiscTest.test_levenshtein_distance.<locals>.CHECK
s'44Q4@FVX.r rrrrLrrJAppleApleBananazB@n@n@rCherryzCherry!z---0---z------abcrPaabbrIaaaaaAAAAArwxyzwXyZwXyZ123rPythonJavar
zC#AbstractFoobarManagerabstract_foobar_managerrCPythonPyPyr&pypyr%rAttributeErropAttributeErrorTestsABAAABr)r0rzs` rtest_levenshtein_distancez"MiscTest.test_levenshtein_distance
s	/	b"a
b#q
c3
gvq!
h!$
h	1%
i1%
eS!
dD!
gw"
ffa 
fi#
h#
fdA
%'@%H
i$
i$
 0!4
 5r:
eUAr cpuc	Btjs|jtdtjd5}t	j
|}dddD]\}}}t
j||d}|j||||f||dz|dzfD]0}t
j|||}|j|||||f2t|D]0}t
j|||}	|j|	||||f2y#1swYxYw)Nz. is missing. Run `make regen-test-levenshtein`rr)r<rJrL)LEVENSHTEIN_DATA_FILEis_filerrjjsonloadr.ryrSrr+)
r0rmexamplesrr7rres1	thresholdres2res3s
          r'test_levenshtein_distance_short_circuitz0MiscTest.test_levenshtein_distance_short_circuit
s;$,,.II()*56

#
'
'
,	$yy|H	$&
	KNAq(221a>DT8!Q8&1hlC
H	 66q!YG  xaI5F G
H
#8_
K	!66q!YG""4Ay8I"J	
K
	K	$	$sDDN)rrrrvrrrequires_resourcerrr rrmrm
s/	;:Wu%K&Kr rm)Qrcollectionsrr`rrIrrrrunittestrrrrtestrrtest.supportrrrr	r
rrtest.support.os_helperr
rtest.support.script_helperrrtest.support.import_helperrrrrr.	functoolsrpathlibrrrr{co_positionsr|rrparentrTestCaser+rrrrrrrrr[r&r9escaperYr@rrrr7rErcrrr
global_for_suggestionsr7rirkrmmainrr r<module>rs=%"
	


///2N-"*j"88*Ab
v
y9:	7	
!D
E

TK
LX--0KKU*X&&U*p
>>
>
>)EA+A+A+J&' '&'p*8,,p*h&
&RZZ=)9299_+EFH
j+j+Z
5x7H7H
 4h6G6Gu,""u,p&,**&,R&$!!&$RH
!!H
T++rX..rj	u)X->->u)pQ8Q8j&   AKx  AKHzHMMOr