+
     Bi=                        R t ^ RIHt ^ RIt^ RIt^ RIHtHt ^ RIt^ RIH	t	 ^ RIt^ RI
Ht ^ RIHt R]n         ! R R	]P                  4      t ! R
 R]4      t ! R R4      t ! R R]P                  4      t ! R R]P                  4      t ! R R]P                  4      t ! R R]P                  4      t ! R R]P                  4      t]R8X  d   ]P2                  ! ^R7       R# R# )zTest run, coverage 54%.)runN)captured_outputcaptured_stderr)mock)Func)force_not_colorizedTc                      a  ] tR t^t o R tR]R3R]R3R]R33t]	R 4       t
]	]P                  P                  ]R	R
 R7      R 4       4       tRtV tR# )ExceptionTestc                    ! R  R\         4      pV! R4      pV! R4      p W2h  T d     Th  T d    \        4       ;_uu_ 4       p\        P                  P	                  \
        R4      ;_uu_ 4       pR Tn        \
        P                  ! 4        RRR4       M  + '       g   i     M; iRRR4         M  + '       g   i       M; ii ; ii ; iXP                  4       P                  4       P                  4       pT P                  ^\        T4      4       T P                  RT^,          4       T P                  RT^
,          4       R# )	c                   &   a  ] tR t^t o R tRtV tR# )JExceptionTest.test_print_exception_unhashable.<locals>.UnhashableExceptionc                    R # )T )selfothers   &&1/usr/lib/python3.14/idlelib/idle_test/test_run.py__eq__QExceptionTest.test_print_exception_unhashable.<locals>.UnhashableException.__eq__   s        r   N)__name__
__module____qualname____firstlineno__r   __static_attributes____classdictcell____classdict__s   @r   UnhashableExceptionr      s      r   r   ex1ex2cleanup_tracebackc                     V # Nr   tes   &&r   <lambda>?ExceptionTest.test_print_exception_unhashable.<locals>.<lambda>!   s    ar   NzUnhashableException: ex2zUnhashableException: ex1)	Exceptionr   r   patchobjectr   side_effectprint_exceptiongetvaluestrip
splitlinesassertEquallenassertIn)r   r   r   r   outputcttbs   &      r   test_print_exception_unhashable-ExceptionTest.test_print_exception_unhashable   s   	) 	 "%(!%(		." 	..	& .$&&&**30CDD)7++- EDDD '&&&.	. __$$&113SW%0"Q%80"R&9sZ   # C-C-B8	3B	B8	B*%B8	-C5C8C
CC
CC1/0zdivision by zero
abczSname 'abc' is not defined. Did you mean: 'abs'? Or did you forget to import 'abc'?
zint.reelzAtype object 'int' has no attribute 'reel'. Did you mean: 'real'?
c           
        V P                    F@  w  rpV P                  VR 7      ;_uu_ 4         \        \        VRR4      4       RRR4       KB  	  R#   T d\    \        P
                  ! 4       w  rEp\        P                  ! YET4      ^ ,          pTP                   RT 2pT P                  Yx4        Loi ; i  + '       g   i     K  ; i))code evalz: N)
datasubTestr=   compilesysexc_infor   get_message_linesr   r0   )	r   r;   excmsgtypvalr5   actualexpects	   &        r   test_get_messageExceptionTest.test_get_message2   s    "iiNDs4((5r623 )( (  5#&<<>LCb 223R@CF #~Ru5F$$V4	5 )((s)   B8AAB5	2B84B5	5B88C	r    c                     R  # )c                     R # r"   r   r#   s   &&r   r&   (ExceptionTest.<lambda>.<locals>.<lambda>@   s    $r   r   r   r   r   r&   ExceptionTest.<lambda>@   s    ->r   new_callablec                   V P                   pV^ ,          V^,          3V^,          V^,          3V^,          V^ ,          33p^ pV FG  w  w  rVpw  rp
V P                  WX3R7      ;_uu_ 4         \        \        VRR4      4       RRR4       KI  	  V P                  V\        V4      4       R#   T d     \        \        TRR4      4        LI  T	 d    \	        4       ;_uu_ 4       p\
        P                  ! 4        RRR4       M  + '       g   i     M; iXP                  4       pT P                  Y|4       T P                  Y4       T^,          p  Li ; ii ; i  + '       g   i     EK+  ; i)    )codesr<   r=   N)r>   r?   r=   r@   r   r   r,   r-   r2   r0   r1   )r   r   ddata2subtestscode1exc1msg1code2exc2msg2r3   rH   s   &&           r   test_get_multiple_message'ExceptionTest.test_get_multiple_message>   s7    IIA$!!ad|adAaD\:8=4U$!4%tUM22&F34 32 9> 	3u:.  	&&WUB78 &,..&//1 /...!'!2d3d3 A&	& 322sa   -E/B..E	6CEE'D=	EDAEE	EEE	EE1r   N)r   r   r   r   r6   ZeroDivisionError	NameErrorAttributeErrorr>   r   rJ   r   r)   r*   r   r^   r   r   r   s   @r   r	   r	      s     :. %';<I  F G +,	D 	5 	5 	ZZs/$?  A/A /r   r	   c                   D   a  ] tR t^Wt o R tR tR tR tR tR t	Rt
V tR# )	Sc                :    R \        V 4      P                  ,          # )z%s:strtyper   r   s   &r   __str__	S.__str__X   s    $t*----r   c                :    R \        V 4      P                  ,          # )z
%s:unicoderf   rh   s   &r   __unicode__S.__unicode__Z   s    d4j1111r   c                    ^# )   r   rh   s   &r   __len__	S.__len__\   s    r   c                    \        R 4      # )r9   )iterrh   s   &r   __iter__
S.__iter__^   s    E{r   c                :    R \        V 4      P                  ,          # )z%s:itemrf   r   argss   &*r   __getitem__S.__getitem__`   s    4:....r   c                :    R \        V 4      P                  ,          # )z%s:slicerf   rw   s   &*r   __getslice__S.__getslice__b   s    DJ////r   r   N)r   r   r   r   ri   rl   rp   rt   ry   r|   r   r   r   s   @r   rd   rd   W   s(     .2/0 0r   rd   c                   D   a  ] tR t^ft o R tR tR tR tR tR t	Rt
V tR# )		MockShellc                &    V P                  4        R # r"   )resetrh   s   &r   __init__MockShell.__init__g   s    

r   c                <    V P                   P                  V4       R # r"   )writtenappendrw   s   &*r   writeMockShell.writei   s    D!r   c                6    V P                   P                  4       # r"   )linespoprh   s   &r   readlineMockShell.readlinek   s    zz~~r   c                    R # r"   r   rh   s   &r   closeMockShell.closem   s    r   c                    . V n         R # r"   )r   rh   s   &r   r   MockShell.reseto   s	    r   c                :    \        V4      R R R1,          V n        R # )N)listr   )r   r   s   &&r   pushMockShell.pushq   s    %[2&
r   )r   r   N)r   r   r   r   r   r   r   r   r   r   r   r   r   s   @r   r   r   f   s(     " ' 'r   r   c                   D   a  ] tR t^ut o R tR tR tR tR tR t	Rt
V tR# )	StdInputFilesTestc                   \        4       p\        P                  ! VR 4      pV P                  V\        P
                  4       V P                  VP                  R4       V P                  VP                  R4       V P                  VP                  4       V P                  VP                  R4       V P                  VP                  4       V P                  VP                  4       4       V P                  VP!                  4       4       V P                  VP#                  4       4       V P                  VP%                  4       4       R# )stdinutf-8strictz<stdin>N)r   r   StdInputFileassertIsInstanceio
TextIOBaser0   encodingerrorsassertIsNonenewlinesnameassertFalseclosed
assertTrueisattyreadablewritableseekabler   shellfs   &  r   	test_miscStdInputFilesTest.test_miscw   s    UG,a/W-8,!**%+"
#

%&&r   c                   \        4       p\        P                  ! VR 4      pV P                  \        VP
                  4       V P                  \        VP                  4       V P                  \        VP                  ^ 4       V P                  \        VP                  R4       V P                  \        VP                  R.4       R# )r   xN)
r   r   r   assertRaisesOSErrorfilenotellseekr   
writelinesr   s   &  r   test_unsupported"StdInputFilesTest.test_unsupported   s    UG,'188,'166*'1661-'177C0'1<<#7r   c                   \        4       p\        P                  ! VR 4      pVP                  . RO4       V P	                  VP                  4       R4       VP                  . RO4       V P	                  VP                  R4      R4       VP                  . RO4       V P	                  VP                  R4      R4       VP                  . RO4       V P	                  VP                  ^4      R4       V P	                  VP                  ^4      R4       V P	                  VP                  ^
4      R4       VP                  RR.4       V P	                  VP                  ^ 4      R4       V P                  \        VP
                  R	4       V P                  \        VP
                  R
4       V P                  \        VP
                  ^^4       R# )r   one
two
r<   one
two
Nonze
tz	wo
three
      ?1r   r   r<   r   )r   r   three
r<   )r   r   r   r   r0   readr   	TypeErrorr   s   &  r   	test_readStdInputFilesTest.test_read   sJ   UG,

)*<0

)*\2

)*|4

45D)F+]3

GW%&B')QVVS1)QVVS1)QVVQ2r   c                   \        4       p\        P                  ! VR 4      pVP                  . RO4       V P	                  VP                  4       R4       V P	                  VP                  R4      R4       V P	                  VP                  R4      R4       VP                  R.4       V P	                  VP                  4       R4       V P	                  VP                  4       R4       VP                  . RO4       V P	                  VP                  4       R4       V P	                  VP                  4       R4       VP                  . RO4       V P	                  VP                  ^4      R4       V P	                  VP                  ^4      R	4       V P	                  VP                  ^4      R
4       V P	                  VP                  ^
4      R4       VP                  RR.4       V P	                  VP                  ^ 4      R4       V P                  \        VP                  R4       V P                  \        VP                  R4       V P                  \        VP                  ^^4       R# )r   r   r   r   Nr   onetwor   r%   
r<   r   r   )r   r   r   zfour
r   )r   r   three)r   r   r   )	r   r   r   r   r0   r   r   r   	readlinesr   s   &  r   test_readlineStdInputFilesTest.test_readline   s   UG,

:;w/B1D)95

L>"w/w/

*+u-u-

01A-A,A-B1

GW%&A+)Q[[#6)Q[[#6)Q[[!Q7r   c                   \        4       p\        P                  ! VR 4      pVP                  . RO4       V P	                  VP                  4       RR.4       VP                  . RO4       V P	                  VP                  R4      RR.4       VP                  . RO4       V P	                  VP                  R4      RR.4       VP                  . RO4       V P	                  VP                  ^ 4      RR.4       VP                  . RO4       V P	                  VP                  ^4      R.4       VP                  . RO4       V P	                  VP                  ^4      RR.4       VP                  . RO4       V P                  \        VP
                  R4       V P                  \        VP
                  R4       V P                  \        VP
                  ^^4       R# )r   r   r   Nr   r   r   r   )r   r   r   r   r0   r   r   r   r   s   &  r   test_readlines StdInputFilesTest.test_readlines   sd   UG,

)*'(:;

)*R7G*<=

)*T*Wg,>?

)*Q'7);<

)*Q'3

)*Q'7);<

)*)Q[[#6)Q[[#6)Q[[!Q7r   c                   \        4       p\        P                  ! VR 4      pVP                  . RO4       V P	                  VP
                  4       V P                  VP                  4       R4       VP                  4        V P	                  VP
                  4       V P                  VP                  4       R4       V P                  \        VP                  ^4       R# )r   r   r   Nr   )r   r   r   r   r   r   r0   r   r   r   r   r   s   &  r   
test_closeStdInputFilesTest.test_close   s    UG,

)*"w/		"w/)QWWa0r   r   N)r   r   r   r   r   r   r   r   r   r   r   r   r   s   @r   r   r   u   s(     '83(828*	1 	1r   r   c                   D   a  ] tR t^t o R tR tR tR tR tR t	Rt
V tR# )	StdOutputFilesTestc                   \        4       p\        P                  ! VR 4      pV P                  V\        P
                  4       V P                  VP                  R4       V P                  VP                  R4       V P                  VP                  4       V P                  VP                  R4       V P                  VP                  4       V P                  VP                  4       4       V P                  VP!                  4       4       V P                  VP#                  4       4       V P                  VP%                  4       4       R# )stdoutr   r   z<stdout>N)r   r   StdOutputFiler   r   r   r0   r   r   r   r   r   r   r   r   r   r   r   r   r   s   &  r   r   StdOutputFilesTest.test_misc   s    eX.a/W-8,!**%,"
#&

%&r   c                   \        4       p\        P                  ! VR 4      pV P                  \        VP
                  4       V P                  \        VP                  4       V P                  \        VP                  ^ 4       V P                  \        VP                  ^ 4       V P                  \        VP                  ^ 4       R# )r   N)
r   r   r   r   r   r   r   r   r   r   r   s   &  r   r   #StdOutputFilesTest.test_unsupported   s    eX.'188,'166*'1661-'1661-'1::q1r   c                   \        4       p\        P                  ! VR 4      pVP                  R4       V P	                  VP
                  R.4       VP                  4        VP                  R4       V P	                  VP
                  R.4       VP                  4        VP                  \        R4      4       V P	                  VP
                  R.4       V P	                  \        VP
                  ^ ,          ^ ,          4      \        4       VP                  4        V P                  \        VP                  4       V P	                  VP
                  . 4       V P                  \        VP                  R4       V P                  \        VP                  ^{4       V P	                  VP
                  . 4       V P                  \        VP                  RR4       V P	                  VP
                  . 4       R# )r   test	   tèś𝖙   testspamNr   r   )r   r   r   r   r   r   r0   r   r   rd   rg   strr   r   r   s   &  r   
test_writeStdOutputFilesTest.test_write   s_   eX.	);(<=	'()L(MN	)*+)L(MNemmA.q12C8)QWW-+)QWWg6)QWWc2+)QWWff=+r   c                t   \        4       p\        P                  ! VR RR4      pVP                  R4       V P	                  VP
                  R.4       VP                  4        VP                  \        R4      4       V P	                  VP
                  R.4       V P	                  \        VP
                  ^ ,          ^ ,          4      \        4       VP                  4        V P                  \        VP                  4       V P	                  VP
                  . 4       V P                  \        VP                  R4       V P                  \        VP                  ^{4       V P	                  VP
                  . 4       V P                  \        VP                  RR4       V P	                  VP
                  . 4       R# )	stderrziso-8859-15backslashreplaceu   tèś𝖙¤r   r   r   N)u   tè\u015b\U0001d599\xa4r   r   r   s   &  r   test_write_stderr_nonencodable1StdOutputFilesTest.test_write_stderr_nonencodable  s8   eX}>PQ	+,)S(TU	-./)S(TUemmA.q12C8)QWW-+)QWWg6)QWWc2+)QWWff=+r   c                   \        4       p\        P                  ! VR 4      pVP                  . 4       V P	                  VP
                  . 4       VP                  4        VP                  RR.4       V P	                  VP
                  RR	.4       VP                  4        VP                  RR.4       V P	                  VP
                  R
R.4       VP                  4        VP                  \        R4      .4       V P	                  VP
                  R.4       V P	                  \        VP
                  ^ ,          ^ ,          4      \        4       VP                  4        V P                  \        VP                  4       V P	                  VP
                  . 4       V P                  \        VP                  ^{4       V P	                  VP
                  . 4       V P                  \        VP                  R.4       V P                  \        VP                  ^{.4       V P	                  VP
                  . 4       V P                  \        VP                  . . 4       V P	                  VP
                  . 4       R# )r   r   r      onè
   twò   tèstr   N)r   r   )r   r   )r   r   )r   r   )r   r   )r   r   r   r   r0   r   r   rd   rg   r   r   r   r   s   &  r   test_writelines"StdOutputFilesTest.test_writelines   s   eX.	R+	gu%&-/@A	C	j(+,02FG	I	a	l^$)>(?@emmA.q12C8)Q\\2+)Q\\37+)Q\\G9=)Q\\C59+)Q\\2r:+r   c                   \        4       p\        P                  ! VR 4      pV P                  VP                  4       VP                  R4       VP                  4        V P                  VP                  4       V P                  \        VP
                  R4       V P                  VP                  R.4       VP                  4        V P                  \        VP                  ^4       R# )r   r   r   Nr   )r   r   r   r   r   r   r   r   r   
ValueErrorr0   r   r   r   s   &  r   r   StdOutputFilesTest.test_close>  s    eX."			!*aggs3);(<=		)QWWa0r   r   N)r   r   r   r   r   r   r   r   r   r   r   r   r   s   @r   r   r      s(     '2,.,(,<
1 
1r   r   c                   8   a  ] tR tRt o R tR tR tR tRtV t	R# )RecursionLimitTestiK  c                   \         P                  ! 4        V P                  \         P                  4       \        P
                  pV P                  \        V^dR7       V P                  \        V^dR4       V P                  \        V^ 4       R# )d   )limiti  N)	r   install_recursionlimit_wrappers
addCleanup!uninstall_recursionlimit_wrappersrA   setrecursionlimitr   r   r   )r   r   s   & r    test_bad_setrecursionlimit_calls3RecursionLimitTest.test_bad_setrecursionlimit_callsN  sf    ++-==>!!)Qc2)QT2*a+r   c                l   \         P                  ! 4        V P                  \         P                  4       \        P
                  ! 4       pV P                  \        P                  V4       \        P                  ! V^,           4       \        P
                  ! 4       pV P                  W!^,           4       R# )ro   N)r   r   r   r   rA   getrecursionlimitr   r0   r   orig_reclimitnew_reclimits   &  r   test_roundtrip!RecursionLimitTest.test_roundtripV  sz    ++-==> --/--}=ma/0 ,,.q'89r   c                    \         P                  ! 4       p\        P                  ! 4        V P	                  \        P
                  4       \         P                  ! 4       pV P                  W!4       R # r"   )rA   r  r   r   r   r   r0   r  s   &  r   &test_default_recursion_limit_preserved9RecursionLimitTest.test_default_recursion_limit_preservedc  sJ    --/++-==>,,.5r   c                    R  p\         P                  ! VR4       V P                  VP                  R4       RVn        \         P                  ! VR4       V P                  VP                  R4       R# )c                     R# )	docstringNr   r   r   r   func,RecursionLimitTest.test_fixdoc.<locals>.funcl  s    r   morezdocstring

moreN)r   fixdocr0   __doc__)r   r  s   & r   test_fixdocRecursionLimitTest.test_fixdocj  sQ    

4 ':;

4 v.r   r   N)
r   r   r   r   r  r  r  r  r   r   r   s   @r   r   r   K  s     ,:6/ /r   r   c                   &   a  ] tR tRt o R tRtV tR# )HandleErrorTestit  c           
     L   V P                   p\        R 4      ;_uu_ 4       p\        P                  ! R\        R7      ;_uu_ 4       p \
        h  \
         d%    \        P                  P                  RRR4        Mi ; iT! \        P                  R4       R\        n	        T! TP                  4       R4        \        h  \         d%    \        P                  P                  RRR4        Mi ; iT! \        P                  R4       R\        n        TP                  4       pT P                  RT4       T P                  RT4       T P                  R	T4       T! TP                  ^4       RRR4       M  + '       g   i     M; iRRR4       R#   + '       g   i     R# ; i)

__stderr__z!idlelib.run.thread.interrupt_mainrP   Nr9   123TFr<   
IndexError)r0   r   r   r)   r   EOFErrorr   MyRPCServerhandle_errorexit_nowr-   r  quittingr2   called)r   eqerrr  rE   s   &    r   test_fatal_error HandleErrorTest.test_fatal_errorv  s:   \**cZZ;%)+ +.2A A,,T5%@As||T" CLs||~r"A   A,,T5%@As||T" CL,,.CMM%%MM%%MM,,t{{A)+ + + + +***s`   %FE5	A,A<9E5	;A<<<E5	9B??,C.+E5	-C..A>E5	,	F5F FF#	r   N)r   r   r   r   r%  r   r   r   s   @r   r  r  t  s      r   r  c                   F   a  ] tR tRt o ]R 4       t]R 4       tR tRtV t	R# )ExecRuncodeTesti  c                8   V P                  \        \        R \        P                  4       \	        4       V n        V P
                  \        n        \        P                  ! 4       p\	        RR7      VP                  n	        \        P                  ! V4      V n        R# )r,   F)resultN)addClassCleanupsetattrr   r,   r   prtr   Mockconsolegetvar	Executiveex)clsmockrpcs   & r   
setUpClassExecRuncodeTest.setUpClass  s^    GC(9#:M:MN&!gg))+!%U!3w'r   c                P    \         P                  \         P                  8X  g   Q hR # r"   )rA   
excepthook__excepthook__)r3  s   &r   tearDownClassExecRuncodeTest.tearDownClass  s    ~~!3!3333r   c                T   V P                   pVP                  R 4       V P                  VP                  ^ ,          \        4       V P                  \        \        R\        P                  4       R \        n	        VP                  R 4       V P                  V P                  P                  ^ ,          \        4       R \        n	        VP                  R 4       VP                  w  r#pV P                  V\        4       V P                  \        VP                  \        4      4       R# )r8   r8  c                 .    \         P                  ! V 4      # r"   )r   r,   )r$   r%   r5   s   &&&r   r&   1ExecRuncodeTest.test_exceptions.<locals>.<lambda>  s    #*=*=a*@r   c                      R # r"   r   r   r   r   r&   r>    s    r   N)r2  runcodeassertIsuser_exc_infor`   r   r,  rA   r9  r8  r-  rx   r   r   
isinstance__context__)r   r2  r$   r%   r5   s   &    r   test_exceptionsExecRuncodeTest.test_exceptions  s    WW


5b&&q)+<=lC4F4FG@


5dhhmmA&(9:%


5##ba#
1==2CDEr   r   N)
r   r   r   r   classmethodr5  r:  rE  r   r   r   s   @r   r(  r(    s7     ( ( 4 4F Fr   r(  __main__)	verbosity)r  idlelibr   r   rA   test.supportr   r   unittestr   idlelib.idle_test.mock_idler   r   testingTestCaser	   r   rd   r   r   r   r   r  r(  r   mainr   r   r   <module>rQ     s      	 
 9    , ,C/H%% C/N0 0' 'd1)) d1Nl1** l1^&/** &/Rh'' 8Fh'' F@ zMMA r   