+
    Bi                     T   ^ RI t ^ RIt^ RIt^ RIHt ^ RIt^ RIt^ RIHt ^ RI	H
t
 ^ RI	Ht ^ RI	Ht ]
P                  ! R4      t^ RIHt R	 tR
 tR)R lt] P&                  R 4       tR t ! R R]P,                  4      t ! R R]P,                  4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R  R!]4      t  ! R" R#]4      t! ! R$ R%]4      t" ! R& R']4      t#]$R(8X  d   ]PJ                  ! 4        R# R# )*    N)dedent)support)import_helper)	os_helper)script_helper_interpreters)InterpreterNotFoundErrorc                     \         P                  ! 4       w  rV P                  R R4      p\        RV RV R24      pV\	        VRR7      3# )

                z-
        import contextlib
        with open(zg, 'w', encoding="utf-8") as spipe:
            with contextlib.redirect_stdout(spipe):
                z	
        utf-8encoding)ospipereplacer   open)scriptrwindentedwrappeds   &    ./usr/lib/python3.14/test/test__interpreters.py_captured_scriptr      s\    779DA~~d$89H # 
 		 G DW---    c                     \        V4      w  r#V;_uu_ 4        \        P                  W4       VP                  4       uuR R R 4       #   + '       g   i     R # ; iN)r   r   
run_stringread)interprequestr   rpipes   &&  r   _run_outputr#   !   s6    $W-MF	  0zz| 
s   %AA	c                     Vf   \         P                  p\         P                  ! VRR7       F!  p\        P	                  V 4      '       g   K    R # 	  \        R4      h)NF)errorzinterp is not running)r   SHORT_TIMEOUTsleeping_retryr   
is_runningRuntimeError)r    timeout_s   && r   _wait_for_interp_to_runr,   (   sM     ''##G59##F++ : 233r   c              #   b  a a"   \         P                  ! 4       w  opV V3R  lp\        P                  ! VR7      pVP	                  4        \        S 4       Rx  \        VRRR7      ;_uu_ 4       pVP                  R4       RRR4       VP                  4        R#   + '       g   i     L"; i5i)c                  N   < \         P                  S \        R S R24      4       R# )z7
            # wait for "signal"
            with open(zG, encoding="utf-8") as rpipe:
                rpipe.read()
            N)r   r   r   )r    r   s   r   run_running.<locals>.run8   s.       5c 1 * 	r   targetNr   r   r   done)	r   r   	threadingThreadstartr,   r   writejoin)r    r   r/   tspiper   s   f    @r   _runningr;   5   ss     779DAq 	$AGGIF#		aw	'	'5F 
(FFH 
(	's   A,B/0BB/B,	'B/c                      \         P                  4        F#  vrV ^ 8X  d   K   \         P                  V 4       K%  	  R#   \         P                   d     KA  i ; i)r   N)r   list_alldestroyInterpreterError)idr+   s     r   clean_up_interpretersrA   J   sN    ((*7	!!"%	 +
 -- 		s   >AAc                   &   a  ] tR t^Tt o R tRtV tR# )TestBasec                    \        4        R # r   )rA   selfs   &r   tearDownTestBase.tearDownV   s    r    N)__name__
__module____qualname____firstlineno__rG   __static_attributes____classdictcell____classdict__s   @r   rC   rC   T   s        r   rC   c                   ,   a  ] tR t^]t o R tR tRtV tR# )IsShareableTestsc                    . ROpV FI  pV P                  V4      ;_uu_ 4        V P                  \        P                  V4      4       R R R 4       KK  	  R #   + '       g   i     K`  ; i)N)	N   spamspam
   iTFg      Y@)   )rV   eggs)subTest
assertTruer   is_shareable)rF   
shareablesobjs   &  r   test_default_shareables(IsShareableTests.test_default_shareables_   sP    
 Cc""!..s35 #" """s   %AA'c                v    ! R  R4      p ! R R\         4      p\        R\        \        \        4       \	        4       VV! R4      V! R4      .	pV FR  pV P                  \        V4      4      ;_uu_ 4        V P                  \        P                  V4      4       RRR4       KT  	  R#   + '       g   i     Ki  ; i)c                   ,   a  ] tR t^st o R tR tRtV tR# )3IsShareableTests.test_not_shareable.<locals>.Cheesec                    Wn         R # r   name)rF   rf   s   &&r   __init__<IsShareableTests.test_not_shareable.<locals>.Cheese.__init__t   s     	r   c                    V P                   # r   re   rE   s   &r   __str__;IsShareableTests.test_not_shareable.<locals>.Cheese.__str__v   s    yy r   re   N)rJ   rK   rL   rM   rg   rj   rN   rO   rP   s   @r   Cheeserc   s   s     !! !r   rl   c                       ] tR t^ytRtRtR# )5IsShareableTests.test_not_shareable.<locals>.SubByteszA subclass of a shareable type.rI   N)rJ   rK   rL   rM   __doc__rN   rI   r   r   SubBytesrn   y   s    1r   rp   .WensleydalerU   N)
bytesNotImplementedtypeobject	ExceptionrZ   reprassertFalser   r\   )rF   rl   rp   not_shareablesr^   s   &    r   test_not_shareable#IsShareableTests.test_not_shareabler   s    	! 	!	2u 	2
 }%! "Cd3i((  !..s35 )( "(((s   4%B''B8rI   N)rJ   rK   rL   rM   r_   rz   rN   rO   rP   s   @r   rS   rS   ]   s     5&5 5r   rS   c                   &   a  ] tR t^t o R tRtV tR# )ModuleTestsc                B    \        \        P                  4       R 4       R# )zimport _interpretersN)r#   r   createrE   s   &r   test_import_in_interpreter&ModuleTests.test_import_in_interpreter   s      ""	
r   rI   N)rJ   rK   rL   rM   r   rN   rO   rP   s   @r   r}   r}      s     
 
r   r}   c                   2   a  ] tR t^t o R tR tR tRtV tR# )ListAllTestsc                    \         P                  4       vr\         P                  4        UUu. uF  vr2VNK  	  pppV P                  WA.4       R # u uppi r   )r   get_mainr=   assertEqual)rF   mainr+   r@   idss   &    r   test_initialListAllTests.test_initial   sH     ))+ - 6 6 89 8fbr 89f% :s   Ac                    \         P                  4       vr\         P                  4       p\         P                  4       p\         P                  4        UUu. uF  vrRVNK  	  pppV P	                  WaW4.4       R # u uppi r   )r   r   r   r=   r   rF   r   r+   firstsecondr@   r   s   &      r   test_after_creating ListAllTests.test_after_creating   sg     ))+$$&%%' - 6 6 89 8fbr 89U34 :s   A9c                (   \         P                  4       vr\         P                  4       p\         P                  4       p\         P                  V4       \         P	                  4        UUu. uF  vrRVNK  	  pppV P                  WaV.4       R # u uppi r   )r   r   r   r>   r=   r   r   s   &      r   test_after_destroying"ListAllTests.test_after_destroying   st     ))+$$&%%'e$ - 6 6 89 8fbr 89Vn- :s   *BrI   N)	rJ   rK   rL   rM   r   r   r   rN   rO   rP   s   @r   r   r      s     &
5. .r   r   c                   ,   a  ] tR t^t o R tR tRtV tR# )GetCurrentTestsc                    \         P                  4       vr\         P                  4       vr2V P                  W14       V P	                  V\
        4       R # r   )r   r   get_currentr   assertIsInstanceint)rF   r   r+   curs   &   r   	test_mainGetCurrentTests.test_main   s@     ))+++-#c3'r   c                V   \         P                  4       vr\         P                  4       p\        V\	        R 4      4      p\        VP                  4       4      p\         P                  4        UUu. uF  vrbVNK  	  uppw  r'V P                  WW4       V P                  WQ4       R# u uppi )z
            import _interpreters
            cur, *_ = _interpreters.get_current()
            print(cur)
            assert isinstance(cur, int)
            N)
r   r   r   r#   r   r   stripr=   r   assertNotEqual)rF   r   r+   r    outr   r@   expecteds   &       r   test_subinterpreter#GetCurrentTests.test_subinterpreter   s     ))+%%'&& * #  #))+(5(>(>(@A(@fbr(@A'C& Bs   /B%rI   N)rJ   rK   rL   rM   r   r   rN   rO   rP   s   @r   r   r      s     (' 'r   r   c                   ,   a  ] tR t^t o R tR tRtV tR# )GetMainTestsc                    \         P                  4        UUu. uF  vrVNK  	  uppw  p\         P                  4       vrBV P                  WC4       V P	                  V\
        4       R # u uppi r   )r   r=   r   r   r   r   )rF   r@   r+   r   r   s   &    r   test_from_mainGetMainTests.test_from_main   sY    '4'='='?@'?VRb'?@
 ))+(dC( As   A(c                
   \         P                  4        UUu. uF  vrVNK  	  uppw  p\         P                  4       p\        V\	        R 4      4      p\        VP                  4       4      pV P                  Wc4       R# u uppi )z
            import _interpreters
            main, *_ = _interpreters.get_main()
            print(main)
            assert isinstance(main, int)
            N)r   r=   r   r#   r   r   r   r   )rF   r@   r+   r   r    r   r   s   &      r   test_from_subinterpreter%GetMainTests.test_from_subinterpreter   sq    '4'='='?@'?VRb'?@
%%'&& * #  399;( As   A?rI   N)rJ   rK   rL   rM   r   r   rN   rO   rP   s   @r   r   r      s     )
) 
)r   r   c                   n   a  ] tR t^t o R t]P                  ! R4      R 4       tR tR t	R t
R tRtV tR	# )
IsRunningTestsc                x    \         P                  4       vrV P                  \         P                  V4      4       R # r   )r   r   r[   r(   )rF   r   r+   s   &  r   r   IsRunningTests.test_main   s)     ))+0067r   zFails on FreeBSDc                d   \         P                  4       pV P                  \         P                  V4      4       \	        V4      ;_uu_ 4        V P                  \         P                  V4      4       R R R 4       V P                  \         P                  V4      4       R #   + '       g   i     L6; ir   )r   r   rx   r(   r;   r[   rF   r    s   & r   r   "IsRunningTests.test_subinterpreter   sr    %%'11&9:fOOM44V<= 11&9: s   %BB/	c                    \         P                  4       p\        V\        R V R24      4      pV P	                  VP                  4       R4       R# )zJ
            import _interpreters
            if _interpreters.is_running(zZ):
                print(True)
            else:
                print(False)
            TrueN)r   r   r#   r   r   r   )rF   r    r   s   &  r   r   'IsRunningTests.test_from_subinterpreter   sO    %%'&& .))/ 1* #  	f-r   c                    \         P                  4       p\         P                  V4       V P                  \        4      ;_uu_ 4        \         P                  V4       R R R 4       R #   + '       g   i     R # ; ir   )r   r   r>   assertRaisesr	   r(   r   s   & r   test_already_destroyed%IsRunningTests.test_already_destroyed   sM    %%'f%788$$V, 9888   A''A8	c                    V P                  \        4      ;_uu_ 4        \        P                  R 4       RRR4       R#   + '       g   i     R# ; ii@B N)r   r	   r   r(   rE   s   &r   test_does_not_exist"IsRunningTests.test_does_not_exist   s1    788$$Y/ 9888	   >A	c                    V P                  \        4      ;_uu_ 4        \        P                  R4       RRR4       R#   + '       g   i     R# ; irX   N)r   
ValueErrorr   r(   rE   s   &r   test_bad_idIsRunningTests.test_bad_id  s0    z**$$R( +***r   rI   N)rJ   rK   rL   rM   r   unittestskipr   r   r   r   r   rN   rO   rP   s   @r   r   r      sA     8 ]]%&; ';	.-0) )r   r   c                      a  ] tR tRt o R t]P                  ! R4      R 4       t]P                  ! RRR7      R 4       t
R	 tR
 tR tR tRtV tR# )CreateTestsi  c                    \         P                  4       pV P                  V\        4       \         P	                  4        UUu. uF  vrVNK  	  pppV P                  XV4       R # u uppi r   )r   r   r   r   r=   assertIn)rF   r@   r+   afters   &   r   test_in_mainCreateTests.test_in_main
  sT    !!#b#&"/"8"8":;":":;b%  <s   A%z*enable this test when working on pystate.cc                    \        4       p\        ^d4       F=  p\        P                  4       p\        P	                  V4       VP                  V4       K?  	  V P                  \        V4      ^d4       R# )d   N)setranger   r   r>   addr   len)rF   seenr+   r@   s   &   r   test_unique_idCreateTests.test_unique_id  sT    usA%%'B!!"%HHRL 
 	TC(r   zgh-129824: race on tp_flagsT)threadc                l  aa \         P                  ! 4       oR oVV3R lp\         P                  ! VR7      pS;_uu_ 4        VP                  4        R R R 4       VP	                  4        \        R \        P                  4        4       4      pV P                  SV4       R #   + '       g   i     LX; i)Nc                  p   < \         P                  4       o SP                  4        SP                  4        R # r   )r   r   acquirerelease)r@   locks   r   f%CreateTests.test_in_thread.<locals>.f  s#    %%'BLLNLLNr   r1   c              3   (   "   T F  vrVx  K
  	  R # 5ir   rI   .0r@   r+   s   &  r   	<genexpr>-CreateTests.test_in_thread.<locals>.<genexpr>)       >%=62B%=   )	r4   Lockr5   r6   r8   r   r   r=   r   )rF   r   r9   r   r@   r   s   &   @@r   test_in_threadCreateTests.test_in_thread  sv    ~~	 A&TGGI 	>]%;%;%=>>b% 	 Ts   B##B3	c                V   \         P                  4        UUu. uF  vrVNK  	  uppw  p\         P                  4       p\        V\	        R 4      4      p\        VP                  4       4      p\        R \         P                  4        4       4      pV P                  WsWF04       R# u uppi )z
            import _interpreters
            id = _interpreters.create()
            print(id)
            assert isinstance(id, int)
            c              3   (   "   T F  vrVx  K
  	  R # 5ir   rI   r   s   &  r   r   5CreateTests.test_in_subinterpreter.<locals>.<genexpr>7  r   r   N)	r   r=   r   r#   r   r   r   r   r   )rF   r@   r+   r   id1r   id2r   s   &       r   test_in_subinterpreter"CreateTests.test_in_subinterpreter,  s    "/"8"8":;":":;""$#v '    #))+>]%;%;%=>>s 01 <s   B%c                  aa \         P                  4        UUu. uF  vrVNK  	  uppw  p\         P                  4       oR oVV3R lp\        P                  ! VR7      pVP                  4        VP                  4        \        R \         P                  4        4       4      pV P                  WcSS04       R # u uppi )Nc                  d   < \        S\        R 4      4      p \        V P                  4       4      oR# )z|
                import _interpreters
                id = _interpreters.create()
                print(id)
                N)r#   r   r   r   )r   r   r   s    r   r   6CreateTests.test_in_threaded_subinterpreter.<locals>.f>  s-    c6 + $ C
 ciik"Cr   r1   c              3   (   "   T F  vrVx  K
  	  R # 5ir   rI   r   s   &  r   r   >CreateTests.test_in_threaded_subinterpreter.<locals>.<genexpr>K  r   r   )	r   r=   r   r4   r5   r6   r8   r   r   )	rF   r@   r+   r   r   r9   r   r   r   s	   &      @@r   test_in_threaded_subinterpreter+CreateTests.test_in_threaded_subinterpreter:  s    "/"8"8":;":":;""$	# A&			>]%;%;%=>>sC 01# <s   B:c                   \        R  \        P                  4        4       4      p. p\        ^4       F(  p\        P	                  4       pVP                  V4       K*  	  V F  p\        P                  V4       K  	  \        P	                  4       p\        R \        P                  4        4       4      pV P                  WQV0,          4       R# )c              3   (   "   T F  vrVx  K
  	  R # 5ir   rI   r   s   &  r   r   5CreateTests.test_after_destroy_all.<locals>.<genexpr>O       ?&>FBR&>r   c              3   (   "   T F  vrVx  K
  	  R # 5ir   rI   r   s   &  r   r   r   Z  r   r   N)r   r   r=   r   r   appendr>   r   )rF   beforer   r+   r@   r   s   &     r   test_after_destroy_all"CreateTests.test_after_destroy_allN  s    ?m&<&<&>??qA%%'BJJrN  B!!"%  !!#>]%;%;%=>>".r   c                   \        R  \        P                  4        4       4      p\        P                  4       p\        P                  4       p\        P                  4       p\        P	                  V4       \        P	                  V4       \        P                  4       p\        R \        P                  4        4       4      pV P                  WaWS0,          4       R# )c              3   (   "   T F  vrVx  K
  	  R # 5ir   rI   r   s   &  r   r   6CreateTests.test_after_destroy_some.<locals>.<genexpr>^  r   r   c              3   (   "   T F  vrVx  K
  	  R # 5ir   rI   r   s   &  r   r   r  h  r   r   N)r   r   r=   r   r>   r   )rF   r   r   r   id3r@   r   s   &      r   test_after_destroy_some#CreateTests.test_after_destroy_some]  s    ?m&<&<&>??""$""$""$c"c"!!#>]%;%;%=>>" 23r   rI   N)rJ   rK   rL   rM   r   r   r   r   r   skip_if_sanitizerr   r   r   r   r  rN   rO   rP   s   @r   r   r     se     ! ]]?@) A) <TJ! K! 22(/4 4r   r   c                   \   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tRtV tR# )DestroyTestsil  c                   \         P                  4       p\         P                  4       p\         P                  4       p\        R  \         P                  4        4       4      pV P	                  W$4       \         P                  V4       \        R \         P                  4        4       4      pV P                  W%4       V P	                  W4       V P	                  W54       R# )c              3   (   "   T F  vrVx  K
  	  R # 5ir   rI   r   s   &  r   r   (DestroyTests.test_one.<locals>.<genexpr>r  r   r   c              3   (   "   T F  vrVx  K
  	  R # 5ir   rI   r   s   &  r   r   r  w  r   r   N)r   r   r   r=   r   r>   assertNotIn)rF   r   r   r  r   r   s   &     r   test_oneDestroyTests.test_onen  s    ""$""$""$?m&<&<&>??c"c">]%;%;%=>>$c!c!r   c                   \        R  \        P                  4        4       4      p\        4       p\        ^4       F(  p\        P	                  4       pVP                  V4       K*  	  \        R \        P                  4        4       4      pV P                  WQV,          4       V F  p\        P                  V4       K  	  \        R \        P                  4        4       4      pV P                  Wa4       R# )c              3   (   "   T F  vrVx  K
  	  R # 5ir   rI   r   s   &  r   r   (DestroyTests.test_all.<locals>.<genexpr>}  s     @'?VRb'?r   c              3   (   "   T F  vrVx  K
  	  R # 5ir   rI   r   s   &  r   r   r    r   r   c              3   (   "   T F  vrVx  K
  	  R # 5ir   rI   r   s   &  r   r   r    r   r   N)r   r   r=   r   r   r   r   r>   )rF   initialr   r+   r@   r   r   s   &      r   test_allDestroyTests.test_all|  s    @}'='='?@@eqA%%'BGGBK  ?m&<&<&>??3/B!!"% >]%;%;%=>>(r   c                  a a \         P                  4        UUu. uF  vrVNK  	  uppw  oS P                  \         P                  4      ;_uu_ 4        \         P	                  S4       R R R 4       VV 3R lp\
        P                  ! VR7      pVP                  4        VP                  4        R # u uppi   + '       g   i     LV; i)Nc                     < SP                  \        P                  4      ;_uu_ 4        \        P                  S 4       R R R 4       R #   + '       g   i     R # ; ir   )r   r   r?   r>   )r   rF   s   r   r   !DestroyTests.test_main.<locals>.f  s8    ""=#A#ABB%%d+ CBBBs   A		A	r1   )	r   r=   r   r?   r>   r4   r5   r6   r8   )rF   r@   r+   r   r9   r   s   f    @r   r   DestroyTests.test_main  s    "/"8"8":;":":;}==>>!!$' ?	, A&			 <>>s   B1B77C	c                    \         P                  4       p\         P                  V4       V P                  \        4      ;_uu_ 4        \         P                  V4       R R R 4       R #   + '       g   i     R # ; ir   )r   r   r>   r   r	   rF   r@   s   & r   r   #DestroyTests.test_already_destroyed  sM    !!#b!788!!"% 9888r   c                    V P                  \        4      ;_uu_ 4        \        P                  R 4       RRR4       R#   + '       g   i     R# ; ir   )r   r	   r   r>   rE   s   &r   r    DestroyTests.test_does_not_exist  s1    788!!), 9888r   c                    V P                  \        4      ;_uu_ 4        \        P                  R4       RRR4       R#   + '       g   i     R# ; ir   )r   r   r   r>   rE   s   &r   r   DestroyTests.test_bad_id  s0    z**!!"% +***r   c                B   \         P                  4        UUu. uF  vrVNK  	  uppw  p\         P                  4       p\        R V R24      p\         P	                  W4       \        R \         P                  4        4       4      pV P                  WSV04       R# u uppi )zY
            import _interpreters
            try:
                _interpreters.destroy(zV)
            except _interpreters.InterpreterError:
                pass
            c              3   (   "   T F  vrVx  K
  	  R # 5ir   rI   r   s   &  r   r   1DestroyTests.test_from_current.<locals>.<genexpr>  r   r   Nr   r=   r   r   r   r   r   )rF   r@   r+   r   r   r   s   &     r   test_from_currentDestroyTests.test_from_current  s    "/"8"8":;":":;!!# ' (*d +  	  ,>]%;%;%=>>r
+ <s   Bc                j   \         P                  4        UUu. uF  vrVNK  	  uppw  p\         P                  4       p\         P                  4       p\        R V R24      p\         P	                  WF4       \        R \         P                  4        4       4      pV P                  WsV04       R# u uppi )zD
            import _interpreters
            _interpreters.destroy()
            c              3   (   "   T F  vrVx  K
  	  R # 5ir   rI   r   s   &  r   r   1DestroyTests.test_from_sibling.<locals>.<genexpr>  r   r   Nr(  )rF   r@   r+   r   r   r   r   r   s   &       r   test_from_siblingDestroyTests.test_from_sibling  s    "/"8"8":;":":;""$""$ ##&% (  	  ->]%;%;%=>>s, <s   B/c                   a \         P                  4       oV3R  lp\        P                  ! VR7      pVP	                  4        VP                  4        R# )c                  2   < \         P                  S 4       R # r   )r   r>   r@   s   r   r   .DestroyTests.test_from_other_thread.<locals>.f  s    !!"%r   r1   N)r   r   r4   r5   r6   r8   )rF   r   r9   r@   s   &  @r   test_from_other_thread#DestroyTests.test_from_other_thread  s:    !!#	& A&			r   c           	     D   \         P                  4        UUu. uF  vrVNK  	  uppw  p\         P                  4       p\        V4      ;_uu_ 4        V P	                  \         P                  V4      R V R2R7       V P                  \         P                  RV R2R7      ;_uu_ 4        \         P                  V4       RRR4       V P	                  \         P                  V4      4       RRR4       R# u uppi   + '       g   i     LD; i  + '       g   i     R# ; i)zInterp z& should be running before destruction.)msgz%Should not be able to destroy interp z while it's still running.N)	r   r=   r   r;   r[   r(   r   r?   r>   )rF   r@   r+   r   r    s   &    r   test_still_runningDestroyTests.test_still_running  s    "/"8"8":;":":;%%'fOOM44V<")&1W X  Z ""=#A#A)NvhVp'q # s s%%f-s OOM44V<=  <s s	 s*   C5AD)C;	?,D;DDD	rI   N)rJ   rK   rL   rM   r  r  r   r   r   r   r)  r/  r5  r9  rN   rO   rP   s   @r   r
  r
  l  s<     ")&-&,-
> 
>r   r
  c                   D   a a ] tR tRt oV 3R ltR tR tR tRtVt	V ;t
# )CommonTestsi  c                V   < \         SV `  4        \        P                  4       V n        R # r   supersetUpr   r   r@   rF   	__class__s   &r   r@  CommonTests.setUp      &&(r   c                   R pV P                  \        V4      ;_uu_ 4        \        P                  V P                  R^4       RRR4       V P                  \        V4      ;_uu_ 4        \        P                  V P                  R^R7       RRR4       RpV P                  \        V4      ;_uu_ 4        \        P                  V P                  R^R7       RRR4       RpV P                  \        V4      ;_uu_ 4        \        P                  V P                  R ^R7       RRR4       RpV P                  \        V4      ;_uu_ 4        \        P                  V P                  ^4       RRR4       R#   + '       g   i     EL<; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)z7_interpreters.exec\(\) argument 3 must be dict, not intaNsharedz=_interpreters.run_string\(\) argument 3 must be dict, not intz;_interpreters.run_func\(\) argument 3 must be dict, not intc                      R # r   rI   rI   r   r   <lambda>-CommonTests.test_signatures.<locals>.<lambda>      Dr   zE_interpreters.set___main___attrs\(\) argument 2 must be dict, not intassertRaisesRegex	TypeErrorr   execr@   r   run_funcset___main___attrsrF   r8  s   & r   test_signaturesCommonTests.test_signatures  s=   H##Is33twwQ/ 4##Is33twwA6 4N##Is33$$TWWc!$< 4L##Is33""477L"C 4 W##Is33,,TWWa8 43 433333 43 43 433s;   "E6)#F
4#F?$F1!G6F	
F	F.	1G	G	c                   R pV P                  \        V4      ;_uu_ 4        \        P                  V P                  RRR7       RRR4       V P                  \        V4      ;_uu_ 4        \        P                  V P                  RRR7       RRR4       V P                  \        V4      ;_uu_ 4        \        P                  V P                  R RR7       RRR4       V P                  \        V4      ;_uu_ 4        \        P                  V P                  R4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)zmust be dict, not NonerF  NrG  c                      R # r   rI   rI   r   r   rJ  6CommonTests.test_invalid_shared_none.<locals>.<lambda>  rL  r   rM  rS  s   & r   test_invalid_shared_none$CommonTests.test_invalid_shared_none  s    '##Is33twwD9 4##Is33$$TWWc$$? 4##Is33""477L"F 4##Is33,,TWWd; 43 433333333s/   #D(*#D;3$E=!E!(D8	;E	E	!E2	c                >   R ^ /pRpV P                  \        V4      ;_uu_ 4        \        P                  V P                  RVR7       RRR4       V P                  \        V4      ;_uu_ 4        \        P                  V P                  RVR7       RRR4       V P                  \        V4      ;_uu_ 4        \        P                  V P                  R VR7       RRR4       R#   + '       g   i     L; i  + '       g   i     Lo; i  + '       g   i     R# ; i)u   zsurrogates not allowedrF  rG  Nc                      R # r   rI   rI   r   r   rJ  :CommonTests.test_invalid_shared_encoding.<locals>.<lambda>  rL  r   )rN  UnicodeEncodeErrorr   rP  r@   r   rQ  )rF   
bad_sharedr8  s   &  r   test_invalid_shared_encoding(CommonTests.test_invalid_shared_encoding  s    ]
&##$6<<twwJ? =##$6<<$$TWWc*$E =##$6<<""477L"L =<	 =<<<<<<s#   #C%.#C87$D%C5	8D	D	r3  )rJ   rK   rL   rM   r@  rT  rY  r`  rN   rO   __classcell__rB  rQ   s   @@r   r<  r<    s      )9$	<	M 	Mr   r<  c                      a a ] tR tRt oV 3R ltR tR tR tR tR t	R t
]P                  ! 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]P6                  ! R4      R 4       tRtVtV ;t# )RunStringTestsi  c                V   < \         SV `  4        \        P                  4       V n        R # r   r>  rA  s   &r   r@  RunStringTests.setUp  rD  r   c                    \        R 4      w  rV;_uu_ 4        \        P                  V P                  V4       VP	                  4       pRRR4       V P                  XR4       R#   + '       g   i     L$; i)print("it worked!", end="")N
it worked!)r   r   r   r@   r   r   )rF   r   filer   s   &   r   test_successRunStringTests.test_success
  sR    '(EFT$$TWWf5))+C  	l+	 Ts   1A%%A5	c                2  a a \        R 4      w  opV;_uu_ 4        VV 3R lp\        P                  ! VR7      pVP                  4        VP	                  4        VP                  4       pRRR4       S P                  XR4       R#   + '       g   i     L$; i)ri  c                  H   < \         P                  SP                  S 4       R # r   )r   r   r@   )r   rF   s   r   r   (RunStringTests.test_in_thread.<locals>.f  s    ((&9r   r1   Nrj  )r   r4   r5   r6   r8   r   r   )rF   rk  r   r9   r   r   s   f    @r   r   RunStringTests.test_in_thread  sj    '(EFT:   *AGGIFFH))+C  	l+ Ts   ABB	c                   \         P                  4       p\        R 4      w  r#V;_uu_ 4        \         P                  W4       VP	                  4       pRRR4       V P                  XR4       R#   + '       g   i     L$; i)z
            import threading
            def f():
                print('it worked!', end='')

            t = threading.Thread(target=f)
            t.start()
            t.join()
            Nrj  r   r   r   r   r   r   )rF   	subinterpr   rk  r   s   &    r   test_create_thread!RunStringTests.test_create_thread  s`    !((*	' )  T$$Y7))+C  	l+	 Ts   &A..A>	c           	        V P                  R 4      ;_uu_ 4        Rp\        P                  R 4      p\        RV R24      w  r4V;_uu_ 4        \        P	                  W#4       VP                  4       pRRR4       V P                  XV4       RRR4       V P                  R4      ;_uu_ 4        \        P                  R4      p\        R4      w  r4V;_uu_ 4        \        P	                  W#4       VP                  4       pRRR4       V P                  XR4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     LR; i  + '       g   i     R# ; i)	isolatedspam spam spam spam spama<  
                import threading
                def f():
                    print('it worked!', end='')

                try:
                    t = threading.Thread(target=f, daemon=True)
                    t.start()
                    t.join()
                except RuntimeError:
                    print('z', end='')
                Nznot isolatedlegacyz
                import threading
                def f():
                    print('it worked!', end='')

                t = threading.Thread(target=f, daemon=True)
                t.start()
                t.join()
                rj  )rZ   r   r   r   r   r   r   rF   r   rt  r   rk  r   s   &     r   test_create_daemon_thread(RunStringTests.test_create_daemon_thread0  s   \\*%%1H%,,Z8I+ 
1 %: &- LF ((;iik  S(+' &* \\.))%,,X6I+ - LF ((;iik  S,/ *)  &%@  *))sG   3D8&D%	3D8.-E&E	E%D50D88E	EEE/	c           
     *   \         P                  4       p. ROpV F`  pV P                  V4      ;_uu_ 4        \         P                  V\	        VR7      4       \         P                  VRV: R24       R R R 4       Kb  	  R #   + '       g   i     Kw  ; i)N)r^   zassert(obj == ))NrV   rU   *   )r   r   rZ   rR  dictr   )rF   r    objectsr^   s   &   r   test_shareable_types#RunStringTests.test_shareable_typesW  su    %%'
 Cc""00#G(($SG1- #" """s   <BBc                   R p\         P                  4       p\        RV R24      w  r4V;_uu_ 4        \         P                  W#4       VP	                  4       pRRR4       V P                  XV4       R#   + '       g   i     L$; i)ry  z
            import os, sys
            try:
                os.execl(sys.executable)
            except RuntimeError:
                print('z', end='')
            Nrs  r{  s   &     r   test_os_execRunStringTests.test_os_execg  sv    -!((*	' -
 !z ")  T$$Y7))+C  	h'	 Ts   &A44B	c           	        ^ RI pVP                  RRR7      ;_uu_ 4       pVP                  R4       VP                  4        Rp\	        RVP
                   RV R	24      p\        P                  V P                  V4       VP                  ^ 4       VP                  4       pV P                  WS4       RRR4       R#   + '       g   i     R# ; i)
r   Nzw+r   r    ry  z
                import os
                try:
                    os.fork()
                except RuntimeError:
                    with open('zE', 'w', encoding='utf-8') as out:
                        out.write('z')
                )tempfileNamedTemporaryFiler7   flushr   rf   r   r   r@   seekr   r   )rF   r  rk  r   r   contents   &     r   	test_forkRunStringTests.test_forkw  s    (((@@DJJrNJJL1H ! 
 !%		{ +$$,: . F $$TWWf5IIaLiikGW/# A@@@s   BB<<C	c           	     @   \        V P                  4      ;_uu_ 4        V P                  \        P                  4      ;_uu_ 4        \        P                  V P                  R 4       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)print("spam")N)r;   r@   r   r   r?   r   rE   s   &r   test_already_running#RunStringTests.test_already_running  s]    dgg""=#A#ABB((/B C BB s#   (B!A9	'B9B	BB	c                   ^ pV\        R \        P                  4        4       4      9   d   V^,          pK4  V P                  \        4      ;_uu_ 4        \        P                  VR4       RRR4       R#   + '       g   i     R# ; i)r   c              3   (   "   T F  vrVx  K
  	  R # 5ir   rI   r   s   &  r   r   5RunStringTests.test_does_not_exist.<locals>.<genexpr>  s     B)Avr)Ar   r  N)r   r   r=   r   r	   r   r  s   & r   r   "RunStringTests.test_does_not_exist  s]    CB)?)?)ABBB!GB788$$R9 9888s   A55B	c                    V P                  \        4      ;_uu_ 4        \        P                  RR4       RRR4       R#   + '       g   i     R# ; i)rX   r  Nr   )r   r   r   r   rE   s   &r   test_error_idRunStringTests.test_error_id  s2    z**$$R9 +***	   ?A	c                    V P                  \        4      ;_uu_ 4        \        P                  R R4       RRR4       R#   + '       g   i     R# ; i)rV   r  N)r   rO  r   r   rE   s   &r   r   RunStringTests.test_bad_id  s2    y))$$V_= *)))r  c                    V P                  \        4      ;_uu_ 4        \        P                  V P                  ^
4       RRR4       R#   + '       g   i     R# ; i)rW   Nr   rO  r   r   r@   rE   s   &r   test_bad_scriptRunStringTests.test_bad_script  s6    y))$$TWWb1 *)))   !A		A	c                    V P                  \        4      ;_uu_ 4        \        P                  V P                  R 4       RRR4       R#   + '       g   i     R# ; i)s   print("spam")Nr  rE   s   &r   test_bytes_for_script$RunStringTests.test_bytes_for_script  s7    y))$$TWW.>? *)))r  c                     ! R  R\         4      p\        V P                  V! R4      4      pV P                  VR4       R# )c                       ] tR tRtRtR# )<RunStringTests.test_str_subclass_string.<locals>.StrSubclassi  rI   N)rJ   rK   rL   rM   rN   rI   r   r   StrSubclassr    s    r   r  zprint(1 + 2)z3
N)strr#   r@   r   )rF   r  outputs   &  r   test_str_subclass_string'RunStringTests.test_str_subclass_string  s/    $#$TWWk.&AB'r   c                4   \         P                  ! 4       w  rR RRRRR/p\        RV R24      p\        P	                  V P
                  V4       \        P                  V P
                  V4       \        VR4      ;_uu_ 4       p\        P                  ! V4      pRRR4       V P                  XR ,          ^*4       V P                  VR,          R
4       V P                  VR	,          ^)4       V P                  VR,          4       R#   + '       g   i     Lu; i)rV      hamrY   s   -1cheddarNz
            eggs = int(eggs)
            spam = 42
            result = spam + eggs

            ns = dict(vars())
            del ns['__builtins__']
            import pickle
            with open(C, 'wb') as chan:
                pickle.dump(ns, chan)
            rbresultr   )r   r   r   r   rR  r@   r   r   pickleloadr   assertIsNonerF   r   r   rH  r   channss   &      r   test_with_sharedRunStringTests.test_with_shared  s    wwy 4
   c 
 
 	((&9  &1!T]]dT"B  	FR(FR(Hr*"Y-( ]s   DD	c                   \         P                  V P                  \        R 4      4       RR/p\        R4      p\         P	                  V P                  V4       \         P                  V P                  V4       \
        P                  ! 4       w  r4\        RV R24      p\         P                  V P                  V4       \        VR4      ;_uu_ 4       p\        P                  ! V4      pRRR4       V P                  XR,          R,          R	4       V P                  VR
,          R,          R4       V P                  VR,          R4       R#   + '       g   i     Lk; i)zj
            spam = 'eggs'
            ns1 = dict(vars())
            del ns1['__builtins__']
            rV   r  zL
            ns2 = dict(vars())
            del ns2['__builtins__']
        zr
            ns = dict(vars())
            del ns['__builtins__']
            import pickle
            with open(r  r  Nns1rY   ns2)r   r   r@   r   rR  r   r   r   r  r  r   )rF   rH  r   r   r   r  r  s   &      r   test_shared_overwrites%RunStringTests.test_shared_overwrites  s     & 2 + 	 &!   	((&9  &1wwy  c 	  	  &1!T]]dT"B  	E6*F3E6*F3FV, ]s   EE	c                   \         P                  ! 4       w  rR R/p\        RV R24      p\        P	                  V P
                  V4       \        P                  V P
                  V4       \        VR4      ;_uu_ 4       p\        P                  ! V4      pRRR4       V P                  XR ,          R4       R#   + '       g   i     L+; i)rJ   s   not __main__z
            spam = 42

            ns = dict(vars())
            del ns['__builtins__']
            import pickle
            with open(r  r  N)r   r   r   r   rR  r@   r   r   r  r  r   r  s   &      r   #test_shared_overwrites_default_vars2RunStringTests.test_shared_overwrites_default_vars  s    wwyo.  c   	((&9  &1!T]]dT"B  	J9 ]s   ?B99C		c                   \         P                  ! 4       w  r\        P                  V P                  \        R V R24      4       \        VR4      ;_uu_ 4       p\        P                  ! V4      pRRR4       \         P                  ! 4       w  r\        P                  V P                  \        RV R24      4       \        VR4      ;_uu_ 4       p\        P                  ! V4      pRRR4       V P                  RX4       V P                  RV4       V P                  RX4       V P                  RV4       R#   + '       g   i     L; i  + '       g   i     Lm; i)z
            spam = True

            ns = dict(vars())
            del ns['__builtins__']
            import pickle
            with open(zd, 'wb') as chan:
                pickle.dump(ns, chan)
            del ns, pickle, chan
            r  Nz
            eggs = False

            ns = dict(vars())
            del ns['__builtins__']
            import pickle
            with open(r  rV   rY   )r   r   r   r   r@   r   r   r  r  r   r  )rF   r   r   r  r  r  s   &     r   test_main_reusedRunStringTests.test_main_reused  s   wwy  & 6 c 	2 	+ 		 !T]]d++d#C  wwy  & 6 c 2 + 	 !T]]d++d#C  	fc"%fc"fc"' ] ]s   D9E9E		E	c                   \         P                  ! 4       w  r\        R V R24      p\        P	                  V P
                  V4       \        VR4      ;_uu_ 4       p\        P                  ! V4      pRRR4       XP                  R4       VP                  R4       V P                  VRRRRR	RR
RR^*/4       R#   + '       g   i     LP; i)z
            spam = 42

            ns = dict(vars())
            ns['__builtins__'] = str(ns['__builtins__'])
            import pickle
            with open(r  r  N__builtins__
__loader__rJ   __main__ro   __package____spec__rV   )r   r   r   r   r   r@   r   r  r  popr   )rF   r   r   r   r  r  s   &     r    test_execution_namespace_is_main/RunStringTests.test_execution_namespace_is_main   s    wwy  c   	  &1!T]]dT"B  	~
|
t4B 	 ]s   B::C
	zblocking foreverc           	     v   \        R 4      p\        P                  ! 4       ;_uu_ 4       p\        P                  ! VRV4      p\        P
                  ! V4      ;_uu_ 4       pVP                  4       pRRR4       RRR4       V P                  X^ 4       R#   + '       g   i     L,; i  + '       g   i     L7; i)a  
        from textwrap import dedent
        import threading
        import _interpreters
        id = _interpreters.create()
        def f():
            _interpreters.run_string(id, dedent('''
                import time
                # Give plenty of time for the main interpreter to finish.
                time.sleep(1_000_000)
                '''))

        t = threading.Thread(target=f)
        t.start()
        r    N)r   r   temp_dirr   make_scriptspawn_pythonwaitr   )rF   r   dirnamefilenameprocretcodes   &     r   test_still_running_at_exit)RunStringTests.test_still_running_at_exit;  s       7$00(FKH++H55))+ 6  
 	!$ 65  s#   7B( B	1B(B% B((B8	r3  ) rJ   rK   rL   rM   r@  rl  r   ru  r|  r  r  r   requires_forkr  r  r   r  r   r  r  r  r  r  r  r  r  r   r   r  rN   rO   rb  rc  s   @@r   re  re    s     ),,,"%0N (  0 0*C
::>2@():->:(#B6 ]]%&% '% %r   re  c                      a a ] tR tRt oV 3R ltR tRR/R ltR tR tR	 t	R
 t
R tR tR tR tR tR tRtVtV ;t# )RunFailedTestsiT  c                V   < \         SV `  4        \        P                  4       V n        R # r   r>  rA  s   &r   r@  RunFailedTests.setUpV  rD  r   c                   a ^ RI pVP                  4       oV P                  V3R l4       \        P	                  V P
                  \        RS: R24      4       \        P                  ! SW4      # )r   Nc                  0   < \         P                  ! S 4      # r   )r   rmtree)tempdirs   r   rJ  +RunFailedTests.add_module.<locals>.<lambda>]  s    	 0 0 9r   z7
            import sys
            sys.path.insert(0, r,  )	r  mkdtemp
addCleanupr   r   r@   r   r   r  )rF   modnametextr  r  s   &&& @r   
add_moduleRunFailedTests.add_moduleZ  se    ""$9:  & 6  '{ +2 + 	 (('@@r   failsFc                  \         P                  ! 4       w  r4 \        R V RV R24      P                  \        V4      4      pV'       da   \        P                  V P                  V4      pV P                  VR4       V\         P                  ! V4       \         P                  ! V4       # \        P                  V P                  V4      pV P                  VR4        \         P                  ! V4       \         P                  ! V4       R#    h ; i  \         P                  ! T4       \         P                  ! T4       i ; i)z9
                import os, sys
                os.write(z, b'0')

                # This raises an exception:
                {}

                # Nothing from here down should ever run.
                os.write(z{, b'1')
                class NeverError(Exception): pass
                raise NeverError  # never raised
                N)r   r   r   formatr   r   r@   assertIsNotcloseassertIsr   r   )rF   r  r  r   r   r   errr8  s   &&$     r   
run_scriptRunFailedTests.run_scriptd  s    wwy	 !     VF4L)  #..tww?  d+ HHQKHHQK $..tww?c4( HHQKHHQK	
 HHQKHHQKs   A%D +2D DD .E c                   \        V\        4      '       d   TpR pMVP                  pV P                  VRR7      pV P	                  VP
                  P                  V4       Vf5   V P	                  VP                  P                  R4      ^ ,          V4       V# V P	                  VP                  RP                  WB4      4       V# )NT)r  :z{}: {})	
isinstancer  rJ   r  r   rt   	formattedsplitr  )rF   exctyper8  r   exctype_nameexcinfos   &&&&  r   _assert_run_failed!RunFailedTests._assert_run_failed  s    gs##"LG"++L //&/5 	..=;W..44S9!<)+  W..%__\?A r   c                ,    V P                  VR V4       R # r   r  )rF   r  r   s   &&&r   assert_run_failed RunFailedTests.assert_run_failed  s    v6r   c                *    V P                  WV4       R # r   r   )rF   r  r8  r   s   &&&&r   assert_run_failed_msg$RunFailedTests.assert_run_failed_msg  s    f5r   c                d   V P                  R 4      ;_uu_ 4        V P                  \        R4       RRR4       V P                  R4      ;_uu_ 4        V P                  \        R4       RRR4       V P                  R4      ;_uu_ 4        V P                  \        RR4       RRR4       V P                  R4      ;_uu_ 4        V P                  \        RR	4       RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     Lq; i  + '       g   i     R# ; i)
zsys.exit(0)z-
                sys.exit(0)
                Nz
sys.exit()zG
                import sys
                sys.exit()
                zsys.exit(42)42zI
                import sys
                sys.exit(42)
                
SystemExitz6
                raise SystemExit(42)
                )rZ   r  r  r  rE   s   &r   	test_exitRunFailedTests.test_exit  s    \\-(("": 0  ) \\,''"": 0  ( \\.))&&z4 :  * \\,''&&z4 :  ('% )( (' *) (''s/   C%C8
DD%C5	8D	D	D/	c                4    V P                  \        R R4       R# )rV   z1
            raise Exception("spam")
            N)r  rv   rE   s   &r   test_plain_exception#RunFailedTests.test_plain_exception  s    ""9f 7 	r   c           	        \        R 4      pV P                  R4      ;_uu_ 4        V P                  \        4      ;_uu_ 4        \        P                  V P                  V4       RRR4       RRR4       V P                  R4      ;_uu_ 4        RpV P                  W!4      pV P                  \        RV R24       RRR4       R#   + '       g   i     Li; i  + '       g   i     Lt; i  + '       g   i     R# ; i)z
            x = 1 + 2
            y = 2 + 4
            z = 4 + 8

            # missing close paren
            print("spam"

            if x + y + z < 20:
                ...
            r   Nmodulespam_spam_spamz
                import r   )	r   rZ   r   SyntaxErrorr   r   r@   r  r  )rF   r   r  r  s   &   r   test_invalid_syntax"RunFailedTests.test_invalid_syntax  s     
 
 \\(##"";//((&9 0 $ \\(##&Gw7H""; 5y !1  $# 0/ $# $##s/   C!C	$C.C+CCC(	+C<	c                2    V P                  \        R 4       R# )z+
            res = spam + eggs
            N)r  	NameErrorrE   s   &r   test_NameErrorRunFailedTests.test_NameError  s    y + 	r   c                2    V P                  \        R 4       R# )z'
            object().spam
            N)r  AttributeErrorrE   s   &r   test_AttributeError"RunFailedTests.test_AttributeError  s    ~ 0 	r   c                2    V P                  \        R 4       R# )z
            raise ExceptionGroup('exceptions', [
                Exception('spam'),
                ImportError('eggs'),
            ])
            N)r  ExceptionGrouprE   s   &r   test_ExceptionGroup"RunFailedTests.test_ExceptionGroup  s    ~ 0 	r   c                ,    V P                  R RR4       R# )MyErrorrV   zj
            class MyError(Exception):
                pass
            raise MyError('spam')
            N)r  rE   s   &r   test_user_defined_exception*RunFailedTests.test_user_defined_exception  s    ""9f 7 	r   r3  )rJ   rK   rL   rM   r@  r  r  r  r  r  r	  r  r  r  r  r  r"  rN   rO   rb  rc  s   @@r   r  r  T  sT     )A @*764
0 r   r  c                   V   a a ] tR tRt oV 3R ltR tR tR tR tR t	R t
R	tVtV ;t# )
RunFuncTestsi  c                V   < \         SV `  4        \        P                  4       V n        R # r   r>  rA  s   &r   r@  RunFuncTests.setUp  rD  r   c                t   \         P                  ! 4       w  rR  p\        P                  V P                  \        VR7      4       \        P                  V P                  V4       \        VRR7      ;_uu_ 4       pVP                  4       pRRR4       V P                  XR4       R#   + '       g   i     L$; i)c            	         ^ RI p \        \        RRR7      ;_uu_ 4       pV P                  ! V4      ;_uu_ 4        \	        RRR7       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; ir   Nr   r   r   rj  r  )end
contextlibr   r   redirect_stdoutprintr-  r:   s     r   r   )RunFuncTests.test_success.<locals>.script  Q    aw//5//66,B/ 7 0/66 0//"   A-A	A-A*%A--A>	r   r   r   Nrj  )
r   r   r   rR  r@   r  rQ  r   r   r   )rF   r   r   r   outfiler   s   &     r   rl  RunFuncTests.test_success  s|    wwy	0 	(($)<tww/!g&&',,.C ' 	l+ '&s   :B''B7	c                  a aaa \         P                  ! 4       w  poR  oRoVVV V3R lp\        P                  ! VR7      pVP	                  4        VP                  4        S'       d   \        Sh\        VRR7      ;_uu_ 4       pVP                  4       pRRR4       S P                  XR4       R#   + '       g   i     L$; i)c            	         ^ RI p \        \        RRR7      ;_uu_ 4       pV P                  ! V4      ;_uu_ 4        \	        RRR7       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; ir*  r,  r0  s     r   r   +RunFuncTests.test_in_thread.<locals>.script
  r2  r3  Nc                     <  \         P                  SP                  \        SR 7      4       \         P	                  SP                  S4       R#   \
         d   p T o Rp ? R# Rp ? ii ; i)r4  N)r   rR  r@   r  rQ  rv   )excfailedr   rF   r   s    r   r   &RunFuncTests.test_in_thread.<locals>.f  sI    00$)D&&tww7 s   A
A A'A""A'r1   r   r   rj  )
r   r   r4   r5   r6   r8   rv   r   r   r   )	rF   r   r   r9   r5  r   r<  r   r   s	   f     @@@r   r   RunFuncTests.test_in_thread  s    wwy1	0 	 	 A&			'!g&&',,.C ' 	l+ '&   B33C	c                   \         P                  ! 4       w  rR  pVP                  p\        P	                  V P
                  \        VR7      4       \        P                  V P
                  V4       \        VRR7      ;_uu_ 4       pVP                  4       pRRR4       V P                  XR4       R#   + '       g   i     L$; i)c            	         ^ RI p \        \        RRR7      ;_uu_ 4       pV P                  ! V4      ;_uu_ 4        \	        RRR7       RRR4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; ir*  r,  r0  s     r   r   -RunFuncTests.test_code_object.<locals>.script&  r2  r3  r4  r   r   Nrj  )r   r   __code__r   rR  r@   r  rQ  r   r   r   )rF   r   r   r   coder5  r   s   &      r   test_code_objectRunFuncTests.test_code_object#  s    wwy	0 (($)<tww-!g&&',,.C ' 	l+ '&r?  c                   a R oV3R lpV P                  \        4      ;_uu_ 4        \        P                  V P                  V4       RRR4       R#   + '       g   i     R# ; i)Tc                     < S '       g   Q hR # r   rI   rV   s   r   r   )RunFuncTests.test_closure.<locals>.script7  s
    K4r   Nr   r   r   rQ  r@   )rF   r   rV   s   & @r   test_closureRunFuncTests.test_closure5  sA    	z**""477F3 +***s   !AA#	c                    R  pV P                  \        4      ;_uu_ 4        \        P                  V P                  V4       RRR4       R#   + '       g   i     R# ; i)c                      R # rI  rI   rI   r   r   r   .RunFuncTests.test_return_value.<locals>.script=  s    r   NrK  rF   r   s   & r   test_return_valueRunFuncTests.test_return_value<  s;    	z**""477F3 +***s   !AA	c           	        V P                  R 4      ;_uu_ 4        RR lpV P                  \        4      ;_uu_ 4        \        P	                  V P
                  V4       RRR4       RRR4       V P                  R4      ;_uu_ 4        R pV P                  \        4      ;_uu_ 4        \        P	                  V P
                  V4       RRR4       RRR4       V P                  R4      ;_uu_ 4        R pV P                  \        4      ;_uu_ 4        \        P	                  V P
                  V4       RRR4       RRR4       V P                  R4      ;_uu_ 4        RR	/R
 lpV P                  \        4      ;_uu_ 4        \        P	                  V P
                  V4       RRR4       RRR4       V P                  R4      ;_uu_ 4        R pV P                  \        4      ;_uu_ 4        \        P	                  V P
                  V4       RRR4       RRR4       R#   + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELE; i  + '       g   i     ELQ; i  + '       g   i     L; i  + '       g   i     EL	; i  + '       g   i     L; i  + '       g   i     R# ; i)argsc                     W8X  g   Q hR # r   rI   )rF  bs   &&r   r   &RunFuncTests.test_args.<locals>.scriptE  s    vvr   Nz*argsc                      V '       d   Q hR # r   rI   )rU  s   *r   r   rX  K  s    x4r   z**kwargsc                      V '       d   Q hR # r   rI   )kwargss   ,r   r   rX  Q  s    !!z6r   kwonlyrV   Tc                     V '       g   Q hR # r   rI   rI  s   $r   r   rX  W  	    tr   posonlyc                    V '       g   Q hR # r   rI   rI  s   "r   r   rX  ]  r^  r   )r   )rZ   r   r   r   rQ  r@   rQ  s   & r   	test_argsRunFuncTests.test_argsC  s   \\&!!"":..&&tww7 / " \\'"" "":..&&tww7 / # \\*%%""":..&&tww7 / & \\(##t "":..&&tww7 / $ \\)$$"":..&&tww7 / %$+ /.. "!! /.. #"" /.. &%% /. $## /. %$$s   #H4!H 	H4!I(!I		I2!J!I0	4J%J+!J	#J+!K-!J?	K H1+	H44I	I	II-	0J;	JJ	J(#J++J<	?K
KK#	r3  )rJ   rK   rL   rM   r@  rl  r   rE  rL  rR  ra  rN   rO   rb  rc  s   @@r   r%  r%    s-     ), ,6,$448 8r   r%  r  r   )&r-  r   r  textwrapr   r4   r   testr   test.supportr   r   r   import_moduler   r	   r   r#   r,   contextmanagerr;   rA   TestCaserC   rS   r}   r   r   r   r   r   r
  r<  re  r  r%  rJ   r   rI   r   r   <module>ri     s:    	      & " & ++O< 2	.
4  ( x    05x(( 05f
( 
.8 ..'h '.)8 )*&)X &)Ra4( a4Hg>8 g>T+M( +M\M%X M%`
[X [|n88 n8b zMMO r   