+
    Bir                        ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ]P2                  t ! R R	]P4                  4      t] P8                  R
 4       t ! R R]P<                  4      t] R8X  d   ]PB                  ! 4        R# R# )    N)support)import_helper)	os_helper)script_helper)socket_helper)warnings_helperc                   P   a a ] tR t^t oV 3R ltV3R lV 3R lltR tRtVtV ;t	# )LogCaptureHandlerc                Z   < \         SV `  \        P                  ! 4       4       . V n        R # N)super__init__ioStringIOrecords)self	__class__s   &(/usr/lib/python3.14/test/test_support.pyr   LogCaptureHandler.__init__   s    '    c                   < V ^8  d   QhRR/# )   returnN )format__classdict__s   "r   __annotate__LogCaptureHandler.__annotate__#   s      d r   c                \   < V P                   P                  V4       \        SV `  V4       R # r   )r   appendr   emit)r   recordr   s   &&r   r!   LogCaptureHandler.emit#   s!    F#Vr   c                    h r   r   )r   r"   s   &&r   handleErrorLogCaptureHandler.handleError'   s    r   )r   )
__name__
__module____qualname____firstlineno__r   r!   r%   __static_attributes____classdictcell____classcell__)r   r   s   @@r   r
   r
      s       r   r
   c               #      "   \        4       p \        P                  ! 4       pVP                  V 4        V x  VP	                  V 4       R #   TP	                  T 4       i ; i5ir   )r
   logging	getLogger
addHandlerremoveHandler)handlerroot_loggers     r   _caplogr5   +   sO     !G##%K7#+!!'*!!'*s   1A!A A!AA!c                     a  ] tR t^6t o ]R 4       t]R 4       tR tR tR t	R t
]P                  ! R4      R 4       tR	 tR
 tR tR t]P&                  ! 4       R 4       t]P&                  ! 4       R 4       t]P&                  ! 4       R 4       tR tR tR tR t]P6                  ! 4       R 4       tR tR tR tR t R t!R t"R t#R t$R t%R t&R t'R  t(R! t)R" t*R# t+R$ t,R% t-R& t. ! R' R(4      t/ ! R) R*4      t0R+ t1R, t2R- t3]Ph                  ! ]5! ]6R.4      ;'       d
    ]5! ]6R/4      R04      ]P6                  ! 4       R1 4       4       t7]Pp                  ! 4       RER3 l4       t9]Pt                  ! R44      R5 4       t;R6 t<]Pz                  ! ]P|                  R74      ]Pz                  ! ]P~                  R84      R9 4       4       t@R: tAR; tBR< tCR= tDR> tER? tFR@ tGRA tHRB tIRC tJRDtKV tLR2# )FTestSupportc                    \        \        P                  ! 4       4      p\        P                  ! R RR7      V n        \        P                  ! \        RR7      V n        R# )ztest.support.warnings_helperz.*used in test_support.*)likez!.*You should NOT be seeing this.*N)lenwarnings_get_filtersr   ignore_deprecations_from_warnings_helper_tokenr'   _test_support_tokenclsorig_filter_lens   & r   
setUpClassTestSupport.setUpClass7   sI    h3356%,%E%E*1K&
" #*"B"B>#
r   c                    \        \        P                  ! 4       4      p\        P                  ! V P
                  V P                  4       R # r   )r:   r;   r<   r   clear_ignored_deprecationsr>   r?   r@   s   & r   tearDownClassTestSupport.tearDownClassB   s5    h3356**&&##	
r   c                f   \         P                  ! R R7      ;_uu_ 4       p\        P                  ! 4        \         P                  ! R\
        4       V Uu. uF  p\        VP                  4      NK  	  ppRRR4       V P                  \        X4      ^ V4       R# u upi   + '       g   i     L3; i)T)r"   zYou should NOT be seeing this.N)
r;   catch_warningsr   _warn_about_deprecationwarnDeprecationWarningstrmessageassertEqualr:   )r   warning_objswmessagess   &   r   $test_ignored_deprecations_are_silent0TestSupport.test_ignored_deprecations_are_silentK   sx    $$D11\335MM:<NO0<=1AIIH= 2 	X84 > 21s   5B B3B B  B0	c                    \         P                  ! R 4       V P                  \        P                  \         P                  R4       R# )ftplibfooN)r   import_moduleassertRaisesunittestSkipTestr   s   &r   test_import_moduleTestSupport.test_import_moduleS   s1    ##H-(++'55u	>r   c                2    \         P                  ! R 4       R# )rW   N)r   import_fresh_moduler]   s   &r   test_import_fresh_module$TestSupport.test_import_fresh_moduleX   s    ))(3r   c                    V P                  \        P                  ! V R 4      V P                  4       V P	                  \
        P                  \        P                  V R4       R# )test_get_attributerX   N)rP   r   get_attributere   rZ   r[   r\   r]   s   &r   re   TestSupport.test_get_attribute[   sI    ..t5IJ//	1(++W-B-BD%Pr   zfailing buildbotsc                l    V P                  \        P                  ! 4       \        P                  4       R # r   )rP   r   get_original_stdoutsysstdoutr]   s   &r   test_get_original_stdout$TestSupport.test_get_original_stdout`   s    446

Cr   c                    ^ RI pV P                  R\        P                  4       \        P
                  ! R4       V P                  R\        P                  4       R# )r   Nsched)ro   assertInrj   modulesr   unloadassertNotIn)r   ro   s   & r   test_unloadTestSupport.test_unloadd   s9    gs{{+W%#++.r   c                @   \        \        R RR7      ;_uu_ 4       p RRR4       \        P                  ! \        4       V P	                  \
        P                  P                  \        4      4       \        P                  ! \        4       R#   + '       g   i     Lx; i)rR   utf-8encodingN)openTESTFNr   unlinkassertFalseospathexists)r   fs   & r   test_unlinkTestSupport.test_unlinkj   s[    &#00A 1 /0 	 10s   BB	c                f   \         P                  R ,           p\        P                  P	                  VR4      p\        P
                  ! V4       \        P
                  ! V4       \         P                  ! V4       V P                  \        P                  P                  V4      4       \        P                  ! \        R^ 4      ;_uu_ 4        \         P                  ! V4       RRR4       \        P
                  ! V4       \        P
                  ! V4       \        P                  ! V\        P                  \        P                  ,          4       \        P                  ! \        R^ 4      ;_uu_ 4        \         P                  ! V4       RRR4       V P                  \        P                  P                  V4      4       \        P
                  ! V4       \        P
                  ! V4       \        P                  ! V^ 4       \        P                  ! \        R^ 4      ;_uu_ 4        \         P                  ! V4       RRR4       V P                  \        P                  P                  V4      4       R#   + '       g   i     EL; i  + '       g   i     EL	; i  + '       g   i     Lh; i)dsubdirverboseN)r   r{   r~   r   joinmkdirrmtreer}   r   r   	swap_attrchmodstatS_IRUSRS_IXUSR)r   dirpath
subdirpaths   &  r   test_rmtreeTestSupport.test_rmtreeq   s   ""S(WW\\'84


!01w	155W% 6 	

$,,t||34w	155W% 601


!w	155W% 601 655 655 65s$   I85J)J 8J		J	 J0	c                   \         R ,           p\        VRRR7      ;_uu_ 4       p\        RVR7       RRR4       \        P                  P                  ^ \        P                  4       \        P                  ! 4         \        \         4      pV P                  \         \        P                  4       \        P                  ! \         4       V P                  \         \        P                  4       \        P                  ^  \         P"                  ! V4       \         P$                  ! R4       R#   + '       g   i     EL; i  \        P                  ^  \         P"                  ! T4       \         P$                  ! R4       i ; i)z.pyrR   rw   rx   zfoo = 1fileN__pycache__)r{   rz   printrj   r   insertr~   curdir	importlibinvalidate_caches
__import__rp   rq   r   forgetrs   r   r|   r   )r   mod_filenamer   mods   &   r   test_forgetTestSupport.test_forget   s    ~,g66!)!$ 7299%##%		,V$CMM&#++.  (VS[[1\*]+ 766 \*]+s   D.>A1E .D?	?Fc                r    \         P                  ! \        P                  ^ 34      pVP	                  4        R# )r   N)socketcreate_serverr   HOSTcloser   ss   & r   	test_HOSTTestSupport.test_HOST   s&      -"4"4a!89		r   c                    \         P                  ! 4       p\        P                  ! \         P                  V34      pVP                  4        R # r   )r   find_unused_portr   r   r   r   )r   portr   s   &  r   test_find_unused_port!TestSupport.test_find_unused_port   s4    --/  -"4"4d!;<		r   c                    \         P                   ! 4       p\        P                  ! V4       VP                  4        VP	                  4        R # r   )r   r   	bind_portlistenr   r   s   & r   test_bind_portTestSupport.test_bind_port   s-    MMO"	
		r   c                   \         P                  ! 4       p\        P                  P	                  V4      p \        P                  P                  VR 4      pV P                  \        P                  P                  V4      4       \        P                  ! V4      ;_uu_ 4       pV P                  W24       V P                  \        P                  P                  V4      4       RRR4       V P                  \        P                  P                  V4      4       \        P                  ! V4       R#   + '       g   i     LV; i  \        P                  ! T4       i ; i)tempN)tempfilemkdtempr~   r   realpathr   r}   isdirr   temp_dirrP   
assertTruer   )r   
parent_dirr   	temp_paths   &   r   test_temp_dirTestSupport.test_temp_dir   s    %%'
WW%%j1
	)77<<
F3DRWW]]401##D))Y  1d 34 * RWW]]401Z( *)
 Z(s%   A,E "A D0"6E 0E 	;E Ec                0   \         P                  ! 4       ;_uu_ 4       pV P                  \        P                  P                  V4      4       R R R 4       V P                  \        P                  P                  X4      4       R #   + '       g   i     L@; ir   )r   r   r   r~   r   r   r}   )r   r   s   & r   test_temp_dir__path_none$TestSupport.test_temp_dir__path_none   sU    !!YOOBGGMM)45 "y12 "!s   /BB	c                   R  p\         P                  ! 4       p\        P                  P	                  V4      p V P                  \        P                  P                  V4      4       V P                  \        W4       V P                  \        P                  P                  V4      4       \        P                  ! V4       R#   \        P                  ! T4       i ; i)c                 ~    \         P                  ! V 4      ;_uu_ 4       p\        R 4      h  + '       g   i     R# ; izshould not get hereN)r   r   	Exception)r   r   s   & r   call_temp_dirMTestSupport.test_temp_dir__existing_dir__quiet_default.<locals>.call_temp_dir   s-    ##D))Y 566 *))   +<	N)r   r   r~   r   r   r   r   rZ   FileExistsErrorshutilr   )r   r   r   s   &  r   *test_temp_dir__existing_dir__quiet_default6TestSupport.test_temp_dir__existing_dir__quiet_default   s    	7 !ww%	 OOBGGMM$/0o}COOBGGMM$/0MM$FMM$s   A2C Cc                   \         P                  ! 4       p\        P                  P	                  V4      p \
        P                  ! 4       ;_uu_ 4       p\        4       ;_uu_ 4       p\        P                  ! VR R7      ;_uu_ 4       pV P                  W4       RRR4       VP                   Uu. uF  p\        VP                  4      NK  	  ppRRR4       RRR4       V P                  \        P                  P                  V4      4       \         P"                  ! V4       V P%                  X. 4       V P                  \'        XP(                  4      ^4       VP(                  ^ ,          pV P+                  VP-                  4       RV: R24       R#   + '       g   i     EL; iu upi   + '       g   i     L; i  + '       g   i     L; i  \         P"                  ! T4       i ; i)TquietNz5tests may fail, unable to create temporary directory : )r   r   r~   r   r   r   check_warningsr5   r   r   rP   r;   rN   rO   r   r   r   r   assertListEqualr:   r   assertStartsWith
getMessage)r   r   recordercaplogr   rR   r;   r"   s   &       r   'test_temp_dir__existing_dir__quiet_true3TestSupport.test_temp_dir__existing_dir__quiet_true   sO   !ww%	  //11XwyyF''D99Y$$T5 :4<4E4EF4EqC		N4EF @I1
 OOBGGMM$/0MM$Xr*V^^,a0"##'(".	
 :99F @Iy11 MM$s_   G G &!F-	FF-	/F(F-	G 6G F%F-	-F=8G  G	G G+c                \    \         P                  ! R \        P                  ! R4      4       R# )-ca  
            import os
            from test import support
            from test.support import os_helper
            with os_helper.temp_cwd() as temp_path:
                pid = os.fork()
                if pid != 0:
                    # parent process

                    # wait for the child to terminate
                    support.wait_process(pid, exitcode=0)

                    # Make sure that temp_path is still present. When the child
                    # process leaves the 'temp_cwd'-context, the __exit__()-
                    # method of the context must not remove the temporary
                    # directory.
                    if not os.path.isdir(temp_path):
                        raise AssertionError("Child removed temp_path.")
        N)r   assert_python_oktextwrapdedentr]   s   &r   test_temp_dir__forked_child'TestSupport.test_temp_dir__forked_child   s$    
 	&&tX__ > . 	r   c           	        \         P                  ! 4       p\        P                  ! 4       ;_uu_ 4       p\        P                  ! V4      ;_uu_ 4       pV P                  W24       V P                  \         P                  ! 4       V4       R R R 4       R R R 4       V P                  \         P                  ! 4       V4       R #   + '       g   i     L?; i  + '       g   i     LJ; ir   )r~   getcwdr   r   
change_cwdrP   )r   original_cwdr   new_cwds   &   r   test_change_cwdTestSupport.test_change_cwd  s    yy{!!Y%%i00G  4  g6 1 "
 	l3	 10 "!s#   C7C 		C CCC#	c                `   \         P                  ! 4       pR  p\        P                  ! 4       ;_uu_ 4       p\         P                  P                  VR4      pV P                  \        VV4       RRR4       V P                  \         P                  ! 4       V4       R#   + '       g   i     L7; i)c                 ~    \         P                  ! V 4      ;_uu_ 4       p\        R 4      h  + '       g   i     R# ; ir   )r   r   r   )r   r   s   & r   call_change_cwdFTestSupport.test_change_cwd__non_existent_dir.<locals>.call_change_cwd  s-    %%d++w 566 ,++r   does_not_existN)	r~   r   r   r   r   r   rZ   FileNotFoundErrorrP   )r   r   r   r   non_existent_dirs   &    r   !test_change_cwd__non_existent_dir-TestSupport.test_change_cwd__non_existent_dir  sw    yy{	7 !!Z!ww||J8HI/.0 "
 	l3 "!s   8BB-	c                   \         P                  ! 4       p\        P                  ! 4       ;_uu_ 4       p\         P                  P                  VR 4      p\        P                  ! 4       ;_uu_ 4       p\        4       ;_uu_ 4       p\        P                  ! VRR7      ;_uu_ 4       pV P                  Wa4       V P                  \         P                  ! 4       V4       RRR4       VP                   Uu. uF  p\        VP                  4      NK  	  ppRRR4       RRR4       RRR4       V P                  X. 4       V P                  \        XP                   4      ^4       VP                   ^ ,          p	V P#                  V	P%                  4       RX: R24       R#   + '       g   i     L; iu upi   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i)r   Tr   NBtests may fail, unable to change the current working directory to r   )r~   r   r   r   r   r   r   r   r5   r   rP   r;   rN   rO   r   r:   r   r   r   )
r   r   r   bad_dirr   r   r   rR   r;   r"   s
   &         r   -test_change_cwd__non_existent_dir__quiet_true9TestSupport.test_change_cwd__non_existent_dir__quiet_true  sK   yy{!!Zggll:/?@G //11XwyyF))'>>'$$W;$$RYY[': ? 5=4E4EF4EqC		N4EF	 @I1 " 	Xr*V^^,a0"B 	
 ?> G	 @Iy11 "!s_   >G1G	!F3%7FF32F.F3G	GF+&F33G>G	GGG)	c                   \         R ,           p\        P                  ! 4       ;_uu_ 4       p\        4       ;_uu_ 4       p\        P
                  ! VRR7      ;_uu_ 4         RRR4       VP                   Uu. uF  p\        VP                  4      NK  	  ppRRR4       RRR4       V P                  X. 4       V P                  \        XP                  4      ^4       VP                  ^ ,          pV P                  VP                  4       RV: R24       R#   + '       g   i     L; iu upi   + '       g   i     L; i  + '       g   i     L; i)_does_not_existT)r   r   Nr   r   )r{   r   r   r5   r   r   r;   rN   rO   r   rP   r:   r   r   r   )r   r   r   r   rR   rS   r"   s   &      r   test_change_cwd__chdir_warning*TestSupport.test_change_cwd__chdir_warning7  s    ))++--799%%4t<< =080A0AB0A1AII0AHB <E-
 	Xr*V^^,a0"	
 =<B <E9--sF   E!D0	D!D0	7D+D0	ED(#D0	0E ;EE	c                   \         P                  ! 4       p\        P                  ! \        R 7      ;_uu_ 4        V P                  \         P                  P                  \         P                  ! 4       4      \        4       RRR4       V P                  \         P                  P                  \        4      4       V P                  \         P                  ! 4       V4       R#   + '       g   i     Li; i)nameN)
r~   r   r   temp_cwdr{   rP   r   basenamer}   r   )r   heres   & r   test_temp_cwdTestSupport.test_temp_cwdK  s    yy{V,,RWW--biik:FC -/0d+ -,s   AC!!C1	c                   \         P                  ! 4       p\        P                  ! R R7      ;_uu_ 4       pV P	                  W!4       V P                  \         P                  P                  V4      4       V P                  \         P                  ! 4       V4       R R R 4       V P                  \         P                  ! 4       V4       R #   + '       g   i     L7; i)Nr   )	r~   r   r   r   assertNotEqualr   r   r   rP   )r   r   r   s   &  r   test_temp_cwd__name_none$TestSupport.test_temp_cwd__name_noneS  s    yy{T**g6OOBGGMM'23RYY['2 + 	l3	 +*s   A%C		C	c           
     ^    V P                  \        P                  ! ^^^^^^/4      R4       R# )   z{1: 1, 2: 2, 3: 3}N)rP   r   sortdictr]   s   &r   test_sortdictTestSupport.test_sortdict\  s*    ))1Q!Qq/:<PQr   c                8   \         P                  ! 4       pV P                  \        4      ;_uu_ 4       p\        P
                  ! VR 4       RRR4       V P                  XP                  P                  \        P                  4       R#   + '       g   i     LF; i)s   fooN)
r   make_bad_fdrZ   OSErrorr~   writerP   	exceptionerrnoEBADF)r   fdcms   &  r   test_make_bad_fdTestSupport.test_make_bad_fd_  s]    ""$w''2HHR  (++U[[9 ('s   B		B	c                    \         P                  ! V R ^^R7       V P                  \        4      ;_uu_ 4        \         P                  ! V R4       RRR4       R#   + '       g   i     R# ; i)z	def class)linenooffsetzx=1N)r   check_syntax_errorrZ   AssertionErrorr]   s   &r   test_check_syntax_error#TestSupport.test_check_syntax_errore  sF    ""4QqI~..&&tU3 /...s   AA+	c                    ^ RI p\        P                  ! R4      ;_uu_ 4        VP                  ! R4       RRR4       R#   + '       g   i     R# ; i)r   Npprint)r   r   CleanImportrY   )r   r   s   & r   test_CleanImportTestSupport.test_CleanImportj  s3    &&x00##H- 1000s   A  A	c                |   \         P                  ! R R4      ;_uu_ 4        V P                  R \        P                  4       V P                  R\        P                  4       RRR4       V P                  R \        P                  4       V P                  R\        P                  4       R#   + '       g   i     LR; i)rX   barN)r   DirsOnSysPathrp   rj   r   rs   r]   s   &r   test_DirsOnSysPathTestSupport.test_DirsOnSysPatho  sq    ((66MM%*MM%* 7 	))	 76s   AB++B;	c                    \         P                  ! 4       ;_uu_ 4       p\        R 4       RRR4       V P                  XP	                  4       R4       R#   + '       g   i     L2; i)helloNhello
)r   captured_stdoutr   rP   getvalue)r   rk   s   & r   test_captured_stdout TestSupport.test_captured_stdoutv  s?    $$&&&'N '*I6 '&s   AA$	c                    \         P                  ! 4       ;_uu_ 4       p\        R \        P                  R7       RRR4       V P                  XP                  4       R4       R#   + '       g   i     L2; i)r*  r   Nr+  )r   captured_stderrr   rj   stderrrP   r-  )r   r2  s   & r   test_captured_stderr TestSupport.test_captured_stderr{  sF    $$&&&'

+ '*I6 '&s   A$$A4	c                    \         P                  ! 4       ;_uu_ 4       pVP                  R 4       VP                  ^ 4       \	        4       pRRR4       V P                  XR4       R#   + '       g   i     L$; i)r+  Nr*  )r   captured_stdinr  seekinputrP   )r   stdincaptureds   &  r   test_captured_stdinTestSupport.test_captured_stdin  sQ    ##%%KK	"JJqMwH	 &
 	7+ &%s   -A''A7	c                0    \         P                  ! 4        R # r   )r   
gc_collectr]   s   &r   test_gc_collectTestSupport.test_gc_collect  s    r   c                X    V P                  \        P                  ! 4       \        4       R # r   )assertIsInstancer   python_is_optimizedboolr]   s   &r   test_python_is_optimized$TestSupport.test_python_is_optimized  s    g99;TBr   c                    ! R  R4      pV! 4       p^Vn         \        P                  ! VR^4      ;_uu_ 4       pV P                  VP                   ^4       V P                  V^4       RRR4       V P                  VP                   ^4       \        P                  ! VR^4      ;_uu_ 4       pV P                  VP                  ^4       V P                  V4       RRR4       V P                  VR4       \        P                  ! VR^4      ;_uu_ 4        V=RRR4       V P                  VR4       R#   + '       g   i     L; i  + '       g   i     Lt; i  + '       g   i     LJ; i)c                       ] tR tRtRtR# )'TestSupport.test_swap_attr.<locals>.Obji  r   N)r'   r(   r)   r*   r+   r   r   r   ObjrI    s    r   rJ  xNy)rK  r   r   rP   rL  assertIsNoneassertNotHasAttr)r   rJ  objrK  rL  s   &    r   test_swap_attrTestSupport.test_swap_attr  s
   	 	esC++qSUUA&Q" , 	"sC++qSUUA&a  , 	c3'sC++ ,c3' ,+ ,+ ,+s#   /D3,.EE3E	E	E)	c                   R ^/p\         P                  ! VR ^4      ;_uu_ 4       pV P                  VR ,          ^4       V P                  V^4       RRR4       V P                  VR ,          ^4       \         P                  ! VR^4      ;_uu_ 4       pV P                  VR,          ^4       V P                  V4       RRR4       V P	                  RV4       \         P                  ! VR^4      ;_uu_ 4        VR RRR4       V P	                  RV4       R#   + '       g   i     L; i  + '       g   i     Lu; i  + '       g   i     LJ; i)rK  NrL  )r   	swap_itemrP   rM  rs   )r   DrK  rL  s   &   r   test_swap_itemTestSupport.test_swap_item  s    Gq#q))QQsVQ'Q" * 	3#q#q))QQsVQ'a  * 	a q#q))# *a  *) *) *)s#   ,D+D*7D=D'	*D:	=E	c                   &    ] tR tRtRtRtRtRtRtR# )TestSupport.RefClassi  Nr   )	r'   r(   r)   r*   
attribute1
attribute2_hidden_attribute1__magic_1__r+   r   r   r   RefClassrX    s    

!r   r]  c                   &    ] tR tRtRtRtRtRtRtR# )TestSupport.OtherClassi  Nr   )	r'   r(   r)   r*   rZ  
attribute3r\  __magic_2__r+   r   r   r   
OtherClassr_    s    

r   rb  c                    \         P                  ! V P                  V P                  4      pV P	                  R 0V4       \         P                  ! V P                  V P                  4      pV P	                  RR0V4       R# )rY  r`  ra  N)r   detect_api_mismatchr]  rb  rP   )r   missing_itemss   & r   test_detect_api_mismatch$TestSupport.test_detect_api_mismatch  se    33DMM48OOE,733DOO48MMC,6Fr   c                *   . ROp\         P                  ! V P                  V P                  VR7      pV P	                  \        4       V4       \         P                  ! V P                  V P                  VR7      pV P	                  \        4       V4       R# )rY  )ignoreN)rY  r`  ra  not_in_either)r   rd  r]  rb  rP   set)r   ri  re  s   &  r    test_detect_api_mismatch__ignore,TestSupport.test_detect_api_mismatch__ignore  si    M33tv?.33v?.r   c                    R 0pR0p\         P                  ! V \        VVR7       RR0p0 Rmp\         P                  ! V \        RVVR7       V P	                  \
        \         P                  V \        4       R# )tempdirtemplate)extranot_exportedTextTestResultinstallHandlerN>   
load_testsTestProgramBaseTestSuite)zunittest.resultzunittest.casezunittest.suitezunittest.loaderzunittest.mainzunittest.runnerzunittest.signalszunittest.async_case)r   check__all__r   r[   rZ   r  )r   rq  rr  s   &  r   test_check__all__TestSupport.test_check__all__  s}    "|T%#(*6	8 
 FT%I $)*6	8 	.'*>*>hOr   waitpidWNOHANGz need os.waitpid() and os.WNOHANGc                (   \         P                  ! 4        \        P                  ! 4       pV^ 8X  d   \        P                  ! ^ 4       \         P
                  p R\         n        \        P                  ! 4       p\         P                  ! \         P                  4       Fg  p\         P                  ! \         P                  RV4      ;_uu_ 4        \         P                  ! 4        RRR4       \         P
                  '       g   Kg   M	  RV,          pV P                  WSP                  4       4       V P                  \         P
                  4       V\         n        \         P                  ! 4        R#   + '       g   i     L; i  T\         n        i ; i)r   Forig_stderrNz2Warning -- reap_children() reaped child process %s)r   reap_childrenr~   fork_exitenvironment_alteredr   r   sleeping_retrySHORT_TIMEOUTr   print_warningrp   r-  r   )r   pidwas_alteredr2  _msgs   &     r   test_reap_childrenTestSupport.test_reap_children  s	   
 	 ggi!8HHQK11	6*/G'[[]F++G,A,AB&&w'<'<mVTT))+ U
 ... C GLCMM#01OOG778*5G' 	! UT +6G's,   A5F E1$F AF 1F<F FNc                   R V RV R2p\         P                  .VORNVNp\        P                  P	                  4        UUu/ uF   w  rgVP                  R4      '       d   K  WgbK"  	  ppp\        P                  ! V\        P                  \        P                  RVR7      p	Vf   TpV P                  V	P                  P                  4       \        V4      4       V P                  V	P                  ^ 4       R# u uppi )zfrom test.support import z; print(repr(z()))r   PYTHONT)rk   r2  universal_newlinesenvN)rj   
executabler~   environitems
startswith
subprocessrunPIPEDEVNULLrP   rk   rstriprepr
returncode)
r   argsfuncexpectedcodecmdkeyvaluer  procs
   &&&&      r   check_optionsTestSupport.check_options
  s    *4&dV4H~~11d1D1,.JJ,<,<,> 0,>jcnnX. sz,> 0~~c%/__%/%7%715"%	'
 H++-tH~>!,0s   C9"C9cpuc                8   . R .R.R.R.R.R.R.R.R.R	.R
.R.RR.. RORR.RR.RR.RR.RR.RR.3 F8  pV P                  VR7      ;_uu_ 4        V P                  VR4       RRR4       K:  	  V P                  . RORR.4       R#   + '       g   i     Ke  ; i)z-B-sz-S-Ez-vz-b-Pz-q-Iz-bbz-vvv-Wignore-Xdevfaulthandler
importtimezimporttime=2showrefcounttracemallocztracemalloc=3optsargs_from_interpreter_flagsN)r  r  r  )r  r  r  r  subTestr  r   r  s   & r    test_args_from_interpreter_flags,TestSupport.test_args_from_interpreter_flags  s    
 FFFFFFFFFGHL5M%>"< >">"=!?#5
D8 4((""4)FG )(9
> 	38 6	# )((s   BBc                    . R .R.R.3 F8  pV P                  VR7      ;_uu_ 4        V P                  VR4       RRR4       K:  	  R#   + '       g   i     KO  ; i)z-Oz-OOz-OOOOr  !optim_args_from_interpreter_flagsNr  r  s   & r   &test_optim_args_from_interpreter_flags2TestSupport.test_optim_args_from_interpreter_flags@  sZ     FGI
D 4((""4)LM )(
 )((s   AAzUnstable on Apple MobilezUnavailable on WASIc                @   \         P                  ! 4       p\        P                  ! \        \        P
                  4      p \         P                  ! 4       p\        P                  ! V4       V P                  W1,
          ^4       R#   \        P                  ! T4       i ; i   N)r   fd_countr~   rz   __file__O_RDONLYr   rP   )r   startr  mores   &   r   test_fd_countTestSupport.test_fd_countL  se     ""$WWXr{{+	%%'DHHRLq) HHRLs    B Bc                0   \         P                  ! 4       p\        P                  ! \        P                  R V4      ;_uu_ 4        \        P                  ! V4       RRR4       V P                  VP                  4       V4       R#   + '       g   i     L2; i)r~  N)r   r   r   r   r  rP   r-  )r   r  r  r2  s   &&& r   check_print_warningTestSupport.check_print_warning\  s]    w44mVLL!!#& M*H5 MLs   BB	c                N    V P                  R R4       V P                  RR4       R# )r  zWarning -- msg
za
bzWarning -- a
Warning -- b
N)r  r]   s   &r   test_print_warningTestSupport.test_print_warningb  s)      !3	5  !?	Ar   c                    \         P                  R 8X  d"   V P                  \        P                  4       R# V P                  \        P                  4       R# )win32N)rj   platformr}   r   has_strftime_extensionsr   r]   s   &r   test_has_strftime_extensions(TestSupport.test_has_strftime_extensionsh  s4    <<7"W<<=OOG;;<r   c                `    \         P                  ! R 4      p\        P                  ! RV4       R# )ap  
            from test import support
            import sys

            def check(cond):
                if not cond:
                    raise AssertionError("test failed")

            # depth 1
            check(support.get_recursion_depth() == 1)

            # depth 2
            def test_func():
                check(support.get_recursion_depth() == 2)
            test_func()

            def test_recursive(depth, limit):
                if depth >= limit:
                    # cannot call get_recursion_depth() at this depth,
                    # it can raise RecursionError
                    return
                get_depth = support.get_recursion_depth()
                print(f"test_recursive: {depth}/{limit}: "
                      f"get_recursion_depth() says {get_depth}")
                check(get_depth == depth)
                test_recursive(depth + 1, limit)

            # depth up to 25
            with support.infinite_recursion(max_depth=25):
                limit = sys.getrecursionlimit()
                print(f"test with sys.getrecursionlimit()={limit}")
                test_recursive(2, limit)

            # depth up to 500
            with support.infinite_recursion(max_depth=500):
                limit = sys.getrecursionlimit()
                print(f"test with sys.getrecursionlimit()={limit}")
                test_recursive(2, limit)
        r   N)r   r   r   r   )r   r  s   & r   test_get_recursion_depth$TestSupport.test_get_recursion_depthn  s(     &  &N 	&&tT2r   c                  a V3R  loR Fh  p\         P                  ! V4      ;_uu_ 4        \         P                  ! 4       pS! V4        S! V^,           4       V P                  R4       RRR4       Kj  	  \         P                  ! ^4      ;_uu_ 4         S! ^4       V P                  R4       RRR4       R#   \         d     L\i ; i  + '       g   i     K  ; i  \         d     L<i ; i  + '       g   i     R# ; i)c                 :   < V '       d   S! V ^,
          4       R# R# r  r   )depthrecursive_functions   &r   r  6TestSupport.test_recursion.<locals>.recursive_function  s    "519- r   zRecursionError was not raisedN)         i	  )r   infinite_recursionget_recursion_availablefailRecursionError)r   	max_depth	availabler  s   &  @r   test_recursionTestSupport.test_recursion  s    	. ,I++I66#;;=	 #9-
?&y1}5 II=> 76 ,$ ''**;"1% 		9: +* &  766( "  +**s_   C

B9C
C/CC/9C	C
C	C

CC,)C/+C,,C//D 	c           
        \         P                  pR pVR ,          pVR ,          pVR ,          pV P                  V! R4      ^ 4       V P                  V! R4      ^V,          4       V P                  V! R4      \        RV,          4      4       V P                  V! R4      \        ^V,          4      4       V P                  V! R4      V4       R	 FT  pV P	                  VR7      ;_uu_ 4        V P                  \        4      ;_uu_ 4        V! V4       RRR4       RRR4       KV  	  R#   + '       g   i     L; i  + '       g   i     K~  ; i)
i   0k3kz2.4mg333333@4g1t)limitN) 3z3.5.10k10x)r   _parse_memlimitrP   intr  rZ   
ValueError)r   parseKiBMiBGiBTiBr  s   &      r   test_parse_memlimitTestSupport.test_parse_memlimit  s    ''DjDjDjta(ta#g.vC#I7tc!c'l3tc*0EE**&&z22%L 3 +* 122 +**s$   ,D<
	D)D<)D94D<<Ec                L   RpRp\         P                  p\         P                  p \        P                  R8  d   \         P
                  ! R4       V P                  \         P                  V4       V P                  \         P                  V4       ^^d,          V,          p\         P
                  ! V R24       V P                  \         P                  \        P                  4       V P                  \         P                  WR,          4       Md\         P
                  ! R4       V P                  \         P                  \        P                  4       V P                  \         P                  V4       V\         n        V\         n        R#   T\         n        T\         n        i ; i)   r  tNl        l        )r   
max_memusereal_max_memuserj   maxsizeset_memlimitrP   )r   _4GiBr  old_max_memuseold_real_max_memusebigs   &     r   test_set_memlimitTestSupport.test_set_memlimit  s#    ++%55	:{{U"$$T*  !3!3U;  !8!8%@fm$$uAY/  !3!3S[[A  !8!8#)D$$T*  !3!3S[[A  !8!8%@!/G&9G# "0G&9G#s   F D8F F#c                   \         P                  ! R 4      pV'       g   \         P                  ! R4      p\        P                  P	                  V4      p\        P                  P                  V4      '       g   V P                  RV: 24       \        P                  P                  VR4      p\        P                  P                  V4      '       g   V P                  RV: R24       RR0p\        P                  ! V4      pV P                  \        P                  ! W4      VR0,          4       \        P                  P                  VR4      pV P                  \        P                  ! V\        P                  ! V4      4      VRR	0,          4       \        P                  P                  VR
4      pV P                  \        P                  ! V\        P                  ! V4      4      V4       R# )
abs_srcdirsrcdirz,cannot access Python source code directory: Modulesz landmark is missingz.gitr   buildDocvenvObjectsN)	sysconfigget_config_varr~   r   abspathr   skipTestr   listdirrP   r   copy_python_src_ignore)r   src_dirlandmarkignorednamesr   s   &     r   test_copy_python_src_ignore'TestSupport.test_copy_python_src_ignore  sv   **<8..x8G''//'* ww~~g&&MM %[* + 77<<3ww~~h''MM &\)=? @ =)

7#77G G9,	. ww||GU+77bjj>NO GV#44	6 ww||GY/77bjj>NO 	"r   c                   \        \        P                  4      ) R 3\        \        P                  4      ) R3^\        \        P                  4      ,           R3RR3 F,  w  rV P                  \        P                  ! V4      VV4       K.  	  R# )SIGINTSIGSEGVSIGABRTN)l       STATUS_ACCESS_VIOLATION)l       STATUS_STACK_OVERFLOW)r  signalr  r  r  rP   r   get_signal_name)r   exitcoder  s   &  r   test_get_signal_name TestSupport.test_get_signal_name  sw    &--  (+&..!!9-3v~~&&	231#
H W44X>%'#
r   c                   \         P                  ! 4       pV P                  V4       \         P                  '       d   V P	                  V4       V P                  V\         P                  ! 4       4       V'       dS   V P                  V\        4       V P                  ^\        V4      4       V F  pV P                  V\        4       K  	  R# R# )r	  N)r   linked_to_muslassertIsNotNone	is_wasm32r   assertIsrB  tuplerP   r:   r  )r   linkedvs   &  r   test_linked_to_muslTestSupport.test_linked_to_musl  s    '')V$OOF#fg4467!!&%0QF,%%a-  r   r   r   )Mr'   r(   r)   r*   classmethodrC   rG   rT   r^   rb   re   r[   skiprl   rt   r   r   r   r   requires_working_socketr   r   r   r   r   r   r   requires_forkr   r   r   r   r   r  r  r  r  r  r"  r'  r.  r3  r;  r?  rE  rP  rU  r]  rb  rf  rl  ry  
skipUnlesshasattrr~   r  requires_subprocessr  requires_resourcer  r  skipIfis_apple_mobileis_wasir  r  r  r  r  r  r  r  r  r$  r.  r+   r,   )r   s   @r   r7   r7   6   s    C C C C5>
4Q
 ]]&'D (D/!20," $$& ' $$& '
 $$& ')3  
0  444
0
(,4R:4
.
*7
7
,C("!  G	/P0 Y/JJGB	4J;=   =  D   "- #- u%## &##J
N __W,,.HI__W__&;<* = J*6A=)3V;@!":.""H	'. .r   r7   __main__)"
contextlibr  r   r   r/   r~   r   r!  r   r   r  rj   r  r   r   r[   r;   testr   test.supportr   r   r   r   r   r{   StreamHandlerr
   contextmanagerr5   TestCaser7   r'   mainr   r   r   <module>rC     s       	  	      
       & " & & (			--  + +f.(## f.~ zMMO r   