+
    Biz                        ^ 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 ]P                  R8w  d   ]	P                  ! R4      h^ RItRtRt]P&                  P)                  4       P+                  RP)                  4       4      '       d   R	tR
tRRRRRRRRRR]P,                  RR//RRRRR]P,                  RR//RRRRR]P,                  RRRR//RRRRR]P,                  ///RRR RRR!RR]P,                  R]P&                  ////t]! R"R#R$R%7      tR&P5                  R'.]P7                  4        U Uu. uF!  w  rV R(,          P9                  4        R)V 2NK#  	  upp O4      tR&P5                  R*R+.4      tR, tR- t R. t!R/ t"R0 t# ! R1 R24      t$ ! R3 R44      t% ! R5 R6]	PL                  ]%4      t'R# u upp i )7    N)Path)supportwin32ztest only applies to Windowspy.exeFz_d.exezpy_d.exeTPythonTestSuiteDisplayNamezPython Test Suite
SupportUrlzhttps://www.python.org/3.100zX.Y versionInstallPathExecutablePathX.Y.exe3.100-32zX.Y-32 version
X.Y-32.exe3.100-arm64zX.Y-arm64 versionzX.Y-arm64.exeExecutableArgumentsz-X fake_arg_for_testignoredz!Ignored because no ExecutablePathPythonTestSuite1zPython Test Suite SinglezSingle InterpreterPythonTestSuite/3.100zPythonTestSuite/3.100-32zPythonTestSuite/3.100-arm64)	PY_PYTHON
PY_PYTHON2
PY_PYTHON3

[defaults]:   NN=z
[commands]ztest-command=TEST_EXE.exec                 6    \        V 4      p R V 9   d   RV  R2# T # ) ")str)ss   &)/usr/lib/python3.14/test/test_launcher.pyquoter"   ^   s$    AAaxQqc8&Q&    c                 X   a V3R  loVP                  4        F  w  r#S! WV4       K  	  R# )c                   < \        V\        4      '       dL   \        P                  ! W4      ;_uu_ 4       pVP	                  4        F  w  rES! W4V4       K  	  R R R 4       R # \        V\
        4      '       d*   \        P                  ! WR \        P                  V4       R # \        RP                  V4      4      h  + '       g   i     R # ; i)Nz&don't know how to create data for '{}')

isinstancedictwinregCreateKeyExitemsr   
SetValueExREG_SZ	TypeErrorformat)rootkeyvaluehkeykv_create_registry_datas   &&&   r!   r5   3create_registry_data.<locals>._create_registry_datad   s    eT""##D..$!KKMDA)$15 * /. s##dv}}eDDKKERSS /..s   #B<<C	N)r*   )r/   datar3   r4   r5   s   &&  @r!   create_registry_datar8   c   s'    
T 

dq) r#   c              #      "   \         P                  ! 4        F  p \        P                  ! W4      x  K  	  R#   \         d   pTP
                  R 8X  d    Rp? R# h Rp?ii ; i5i)i  N)	itertoolscountr(   EnumKeyOSErrorwinerror)r/   iexs   &  r!   	enum_keysrA   t   sM     __	..))   	{{c!	s1   A&:A&A#AA&AA##A&c           	      B   \         P                  \         P                  ,          p\        V4       FW  p\         P                  ! WVR 7      ;_uu_ 4       p\        V\        V4      4       RRR4       \         P                  ! W4       KY  	  R#   + '       g   i     L,; i)accessN)r(   	KEY_WRITEKEY_ENUMERATE_SUB_KEYSlistOpenKeydelete_registry_datarA   	DeleteKey)r/   keysACCESSr0   r2   s   &&   r!   rI   rI   ~   sa     = ==FDz^^Df55 y7 6# 55s   BBc           	      p   R V  R2p\         P                  ^ 3\         P                  \         P                  3\         P                  \         P                  33 FH  w  r# \         P
                  ! \         P                  ! W!\         P                  V,          R7      4        R# 	  R#   \         d     K\  i ; i)zSoftware\Python\PythonCore\z\InstallPathrC   TF)	r(   HKEY_CURRENT_USERHKEY_LOCAL_MACHINEKEY_WOW64_64KEYKEY_WOW64_32KEYCloseKeyrH   KEY_READr=   )tagr0   r/   flags   &   r!   is_installedrV      s    (\
:C		!	!1%		"	"F$:$:;		"	"F$:$:;

	OOFNN4V__t=STU   		s   AB&&B54B5c                   2   a  ] tR t^t o R tR tR tRtV tR# )PreservePyInic                @    \        V4      V n        W n        R V n        R # N)r   pathcontent
_preserved)selfr[   r\   s   &&&r!   __init__PreservePyIni.__init__   s    J	r#   c                     V P                   P                  4       V n        V P                   P	                  V P
                  RR7       R #   \         d    R T n         L=i ; i)Nzutf-16encoding)r[   
read_bytesr]   FileNotFoundError
write_textr\   r^   s   &r!   	__enter__PreservePyIni.__enter__   sP    	#"ii224DO 			T\\H= ! 	#"DO	#s   A
 
AAc                    V P                   f   V P                  P                  4        R # V P                  P                  V P                   4       R # rZ   )r]   r[   unlinkwrite_bytes)r^   exc_infos   &*r!   __exit__PreservePyIni.__exit__   s2    ??"IIII!!$//2r#   )r]   r\   r[   N)	__name__
__module____qualname____firstlineno__r_   rh   rn   __static_attributes____classdictcell____classdict__s   @r!   rX   rX      s     
>3 3r#   rX   c                      a  ] tR t^t o Rt]R 4       tR tR	R ltR t	]
P                  R
R l4       t]
P                  R 4       tRtV tR# )
RunPyMixinNc           	     8   R p\         P                  ! 4       '       d0   \        \        P                  4      P
                  \        ,          pMf\        P                  ! R4      P                  R4       F;  pV'       g   K  \        V4      \        ,          pVP                  4       '       g   K;   M	  R pV'       Ed    \        P                  ! VR.\        P                  \        P                  \        P                  RRR7      ;_uu_ 4       pVP                  P                  4        \!        VP"                  R4      P%                  4       ^ ,          P'                  R4      ^,          pVP"                  P)                  4        VP+                  ^
4       R R R 4       \        P,                  P/                  X4      '       g   R pV'       g*   \2        P4                  ! R	P7                  \        4      4      hV#   + '       g   i     Lj; i  \0         d    R p LUi ; i)
NPATH;-hasciiignore)stdinstdoutstderrrc   errorsr   r   zcannot locate '{}' for test)	sysconfigis_python_buildr   sys
executableparentPY_EXEosgetenvsplitis_file
subprocessPopenPIPEr   closenextr   
splitlines
rpartitionreadwaitversion
startswithr=   unittestSkipTestr.   )clspy_exepr   s   &   r!   find_pyRunPyMixin.find_py   s   $$&&#..)0069FYYv&,,S11!!Wv-F~~''	 2  6%%TN$//%??%??$#  GGMMO"188T2==?BMMcRSTUGHHMMOFF2J {{--g66!F ##-44V<  +   s2   =AH	 BG6,H	 H	 6H	H	 	HHc                h    V P                   '       g   V P                  4       V n         V P                   # rZ   )r   r   rg   s   &r!   
get_py_exeRunPyMixin.get_py_exe   s"    {{{,,.DK{{r#   c           	        V P                   '       g   V P                  4       V n         0 Rmp/ \        P                  P	                  4        UUu/ uF-  w  rxVP                  4       V9  g   K  VP                  4       VbK/  	  uppCRRRRRR/CT;'       g    / P	                  4        UUu/ uF  w  rxVP                  4       VbK  	  uppCpV'       g   V P                   .VOp\        P                  ! VVV P                   \        P                  \        P                  \        P                  R7      ;_uu_ 4       p	V	P                  P                  4        V	P                  ^
4       V	P                  P                  4       P                  RR4      p
V	P                  P                  4       P                  R	R4      P!                  R
R4      pRRR4       X	P"                  V8w  dn   \$        P&                  '       dX   V'       gP   \)        R4       \)        V P                   .VO4       \)        R4       \)        X
4       \)        R4       \)        X4       V'       dB   V	P"                  V8w  d1   \        P*                  ! V	P"                  V P                   .VOX
X4      hV P-                  WIP"                  4       XP/                  4        Uu/ uFb  pVP1                  R4      '       d   K  RV9   g   K%  VP3                  R4      ^ ,          VP3                  R4      ^,          P5                  4       bKd  	  ppX
VR&   WR&   V# u uppi u uppi   + '       g   i     EL; iu upi )VIRTUAL_ENVPYLAUNCHER_DEBUG1PYLAUNCHER_DRYRUNPYLAUNCHER_LIMIT_TO_COMPANY )envr   r   r   r   utf-8replacer~   u   �?Nz++ COMMAND ++z++ STDOUT ++z++ STDERR ++#:r   r   >   r   r   r   r   )r   r   r   environr*   upperr   r   r   r   r   r   r   r   decoder   r   
returncoder   verboseprintCalledProcessErrorassertEqualr   r   	partitionlstrip)r^   argsr   
allow_failexpect_returncodeargvr   r3   r4   r   outerrr    r7   s   &&&&&&        r!   run_pyRunPyMixin.run_py   s   {{{,,.DKI
(*

(8(8(:V(:aggiv>U|qwwy!|(:V
)2	

 *-(9(9(;<(;qwwy!|(;<
 KK'$'D{{//????
 
 GGMMOFF2J((--/(()<C((--/(()<DDXsSC
 <<,,/"4;;&&'.!#J.!#J!,,*;;//t{{>RT>RTWY\]].= ^^%
%<<$ >), >AKKQS!1!!4!;!;!==% 	 

 XXM W =
 
 
.
s2   L;,L;*M:BMM$M-AMM	c                    \         P                  P                  R 4      pV'       g   \        P                  ! R4      h\        \        V4      R,          V4      # )LOCALAPPDATAz5LOCALAPPDATA environment variable is missing or emptyzpy.ini)r   r   getr   r   rX   r   )r^   r\   local_appdatas   && r!   py_iniRunPyMixin.py_ini  sF    

~6## %7 8 8T-08;WEEr#   c              #  J  "   \        \        P                  ! \        P                  ! 4       R 7      R,           4      p\        V\        4      '       d   VP                  V4       MVP                  WR7        Vx  VP                  4        R#   TP                  4        i ; i5i))dirz.pyrb   N)
r   tempfilemktempr   getcwdr&   bytesrl   rf   rk   )r^   r\   rc   files   &&& r!   scriptRunPyMixin.script  sh     HOO		4u<=gu%%W%OOGO7	JKKMDKKMs   A5B#8B <B#B  B#c              #  T  "   \         P                  ! 4       R ,          pVP                  RRR7       T\        '       d   RMR,          pVP	                  4         VR\        VP                  4      /3x  \        P                  ! V4       R#   \        P                  ! T4       i ; i5i)ScriptsT)exist_okparentszpython_d.exez
python.exer   N)	r   cwdmkdirDEBUG_BUILDtouchr   r   shutilrmtree)r^   venvvenv_exes   &  r!   	fake_venvRunPyMixin.fake_venv  su     xxzI%

D$
/kkN|L	 ]C,<===MM$FMM$s   AB(B 5B(B%%B()r   )NFr   N)r   )rp   rq   rr   rs   r   classmethodr   r   r   r   
contextlibcontextmanagerr   r   rt   ru   rv   s   @r!   ry   ry      sb     F& &P
,\F 	 	    r#   ry   c                   T  a  ] tR tRt o ]R 4       t]R 4       tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR tR t R t!R t"R  t#R! t$R" t%R# t&R$ t'R% t(R& t)R' t*R( t+R) t,R* t-R+ t.R, t/R- t0R. t1R/ t2R0 t3R1 t4R2t5V t6R3# )4TestLauncheri'  c                   \         P                  ! \         P                  R 4      ;_uu_ 4       p\        V\        4       RRR4       \
        P                  '       d   \        P                  ! R4      pR# R#   + '       g   i     L@; i)Software\PythonNz!reg query HKCU\Software\Python /s)	r(   	CreateKeyrN   r8   	TEST_DATAr   r   r   check_output)r   r0   r   s   &  r!   
setUpClassTestLauncher.setUpClass(  sY    f66?LLPS i0 M ???''(MNA  MLs   A77B	c                   \         P                  ! \         P                  R \         P                  \         P                  ,          R7      ;_uu_ 4       p\        V\        4       RRR4       R#   + '       g   i     R# ; i)r   rC   N)r(   rH   rN   rE   rF   rI   r   )r   r0   s   & r!   tearDownClassTestLauncher.tearDownClass2  sj    ^^F44RXRbRbek  fC  fC  SC  D  D  HK i0 D  D  D  Ds   A..A?	c                    V P                  R .4      pV P                  V P                  \        VR,          4      4       V P                  \        P
                  P                  R4      ^ ,          VR,          4       R# )-0argv0r   r   N)r   r   r   r   r   r   r   r^   r7   s   & r!   test_versionTestLauncher.test_version8  sW    {{D6"d4=&9:..s3A6YHr#   c                \    V P                  R .4      pV P                  RVR,          4       R# )r}   TruezSearchInfo.helpNr   r   r   s   & r!   test_help_optionTestLauncher.test_help_option=  s(    {{D6"&7!89r#   c                   R Fj  w  rpV P                  V4      ;_uu_ 4        V P                  V.4      pV P                  W$R,          4       V P                  W4R,          4       RRR4       Kl  	  R#   + '       g   i     K  ; i)r   zSearchInfo.listzSearchInfo.listPathsN))r   r   False)-0pr   r   )--listr   r   )--list-pathsr   r   )subTestr   r   )r^   optv1v2r7   s   &    r!   test_list_optionTestLauncher.test_list_optionA  so    
KCR c""{{C5)  *;%<=  *@%AB #"
 #""s   AA33Bc                   V P                  R .4      p/ p/ pVR,          P                  4        FF  p\        P                  ! RV4      pV'       g   K$  VP	                  ^4      W%P	                  ^4      &   KH  	  \
         Fw  p\
        V,          pV Uu. uF#  p\        Wx,          \        4      '       g   K!  VNK%  	  p	pV	 F  p
RV RV
 2pWz,          R,          W;&   K  	  VP                  RV R2R4       Ky  	  VP                  4        UUu/ uF  w  rW9   g   K  WbK  	  ppp V P                  W>4       R# u upi u uppi    \        P                  '       d   \        R4       \        TR,          4       h ; i)	r   r   \s*(.+?)\s+?(\*\s+)?(.+)$-V:/r   /ignoredN*** STDOUT ***)r   r   rematchgroupr   r&   r'   popr*   assertDictEqualr   r   r   )r^   r7   foundexpectlinemcompanycompany_datattagsrT   argr3   r4   actuals   &              r!   	test_listTestLauncher.test_listM  sI   {{H:&N--/D5t<Aq$%GGAJggaj! 0 !G$W-L+Q|!z,/4/PAA|DQG9AcU+*/>  JJWIX.5 ! $);;=@=41AK$!$=@	  0 R A	&'d8n%s$   D85D8
D=D=%E 6E9c           	     &   V P                  R .4      p/ p/ pVR,          P                  4        FF  p\        P                  ! RV4      pV'       g   K$  VP	                  ^4      W%P	                  ^4      &   KH  	  \
         F  p\
        V,          pV Uu. uF#  p\        Wx,          \        4      '       g   K!  VNK%  	  p	pV	 FI  p
RV RV
 2pWz,          R,          p VR,          W;&    W;;;,          RVR,          ,           ,          uu&   KK  	  VP                  RV R
2R	4       K  	  VP                  4        UUu/ uF  w  rW9   g   K  WbK  	  ppp V P!                  W?4       R	# u upi   \         d     K  i ; i  \         dK    \        \        TR	,          4      \        \        P                  4      P                  ,          4      Y;&    EK  i ; iu uppi    \"        P$                  '       d   \'        R4       \'        TR,          4       h ; i)r   r   r  r  r  r   r   r   r   Nr  r	  )r   r   r
  r  r  r   r&   r'   KeyErrorr   r   r   r   namer  r*   r  r   r   r   )r^   r7   r  r  r  r  r  r  r  r  rT   r  installr3   r4   r  s   &               r!   test_list_pathsTestLauncher.test_list_pathsf  s   {{N+,N--/D5t<Aq$%GGAJggaj! 0 !G$W-L+Q|!z,/4/PAA|DQG9AcU+&+M:W")*:";FKsW5J-K'KK  JJWIX.5 !" $);;=@=41AK$!$=@	  0# R $  W"%d74=&9D<P<U<U&U"VFKW
 A	&'d8n%sU   E%5E%E<&"E*9
GGG *E95E<8E99E<<AGG6Hc                    R pV P                  RV R2.4      pV P                  RVR,          4       V P                  WR,          4       V P                  RVR,          4       R# )	r   r  r  r   LaunchCommandenv.companyr
   env.tagNr   r^   r  r7   s   &  r!   test_filter_to_company#TestLauncher.test_filter_to_company  s]    #{{c'!,-.D$9:}"56$y/2r#   c                    R pV P                  RV R2.\        RR7      R7      pV P                  RVR,          4       V P                  WR,          4       V P                  R	VR
,          4       R# )r   r  r  z3.0)r   r   r   r"  r#  r
   r$  N)r   r'   r   r%  s   &  r!   #test_filter_to_company_with_default0TestLauncher.test_filter_to_company_with_default  sf    #{{c'!,-4%3H{ID$9:}"56$y/2r#   c                2   R pV P                  R.4      pV P                  RVR,          4       V P                  WR,          4       V P                  RVR,          4       V P                  R.4      pV P                  RVR,          4       V P                  WR,          4       V P                  R	VR,          4       V P                  R
.4      pV P                  RVR,          4       V P                  WR,          4       V P                  RVR,          4       R# )r   z-V:3.100r   r"  r#  r
   r$  z-V:3.100-32r   r   z-V:3.100-arm64z"X.Y-arm64.exe -X fake_arg_for_testr   Nr   r%  s   &  r!   test_filter_to_tagTestLauncher.test_filter_to_tag  s    #{{J<(D$9:}"56$y/2{{M?+tO'<=}"56T)_5{{,-.=tO?TU}"56Y8r#   c                    R pV P                  RV R2.^gR7      pV P                  RV R2.4      pV P                  RVR,          4       V P                  WR,          4       V P                  RVR	,          4       R
# )r   r  z/3.1r   z/3.100r   r"  r#  r
   r$  Nr   r%  s   &  r!   test_filter_to_company_and_tag+TestLauncher.test_filter_to_company_and_tag  s{    #{{c'$/0C{H{{c'&123D$9:}"56$y/2r#   c                8    R pV P                  R.RV/^gR7      pR# )r   z-V:Nonexistentr   r   r   N)r   r%  s   &  r!   test_filter_with_single_install,TestLauncher.test_filter_with_single_install  s+    ${{.8!  
r#   c                     V P                  R .RR7      pT P                  RTR,          4       T P                  TR,          R4       R#   \        P                   d    \        P                  ! R4      hi ; i)	-3Tr   z(requires at least one Python 3.x install
PythonCorer#  r$  3.N)r   r   r   r   r   r   assertStartsWithr   s   & r!   test_search_major_3 TestLauncher.test_search_major_3  sr    	P;;v$;7D 	tM':;d9ot4 ,, 	P##$NOO	Ps   A
 
,A6c                    V P                  R .RR7      pT P                  RTR,          4       T P                  TR,          R	4       T P                  TR,          R
4       R#   \        P                   dg    \        ;QJ d&    R \	        ^^4       4       F  '       g   K   RM	  RM! R \	        ^^4       4       4      '       g   \
        P                  ! R4      hh i ; i)z-3-32Tr9  c              3   @   "   T F  p\        R V R24      x  K  	  R# 5i)r;  -32N)rV   ).0r?   s   & r!   	<genexpr>6TestLauncher.test_search_major_3_32.<locals>.<genexpr>  s      G,Q|b3K00,s   Fz/requires at least one 32-bit Python 3.x installr:  r#  r$  r;  rA  N)
r   r   r   anyranger   r   r   r<  assertEndsWithr   s   & r!   test_search_major_3_32#TestLauncher.test_search_major_3_32  s    	;;yT;:D
 	tM':;d9ot4DOU3 ,, 	3G%2,G333G%2,GGG''(YZZ	s   A# #CC!$CCc                    V P                  R .RR7      pV P                  RXR,          4       V P                  VR,          R4       R	#   \        P                   d+    \        R4      '       g   \        P
                  ! R4      h Lri ; i)
-2Tr9  z2.7z(requires at least one Python 2.x installr:  r#  r$  z2.N)r   r   r   rV   r   r   r   r<  r   s   & r!   test_search_major_2 TestLauncher.test_search_major_2  s    	T;;v$;7D 	tM':;d9ot4	 ,, 	T&&''(RSS '	Ts   A
 
<B	B	c                N   V P                  \        4      ;_uu_ 4        V P                  R .4      pRRR4       V P                  RXR,          4       V P                  RVR,          4       V P                  RVR,          P	                  4       4       R#   + '       g   i     Lk; i)-argNr   SearchInfo.companyr
   SearchInfo.tagX.Y.exe -argr   r   TEST_PY_DEFAULTSr   r   stripr   s   & r!   test_py_defaultTestLauncher.test_py_default  sz    [[)**;;x(D +*D1E,FG$'7"89h)=)=)?@	 +*s   BB$	c                P   V P                  \        4      ;_uu_ 4        V P                  R R.4      pRRR4       V P                  RXR,          4       V P                  RVR,          4       V P                  RVR,          P	                  4       4       R#   + '       g   i     Lk; i)	rK  rO  Nr   rP  r   rQ  X.Y-32.exe -argr   rS  r   s   & r!   test_py2_defaultTestLauncher.test_py2_default  s}    [[)**;;f~.D +*D1E,FGT*:%;<*DN,@,@,BC	 +*   BB%	c                P   V P                  \        4      ;_uu_ 4        V P                  R R.4      pRRR4       V P                  RXR,          4       V P                  RVR,          4       V P                  RVR,          P	                  4       4       R#   + '       g   i     Lk; i)	r8  rO  Nr   rP  r   rQ  'X.Y-arm64.exe -X fake_arg_for_test -argr   rS  r   s   & r!   test_py3_defaultTestLauncher.test_py3_default  s}    [[)**;;f~.D +*D1E,FG-=(>?BDNDXDXDZ[	 +*r\  c                    V P                  R .\        R7      pV P                  RVR,          4       V P                  RVR,          4       V P                  RVR,          P                  4       4       R# )	rO  r)  r   rP  r
   rQ  rR  r   Nr   TEST_PY_ENVr   rU  r   s   & r!   test_py_default_env TestLauncher.test_py_default_env  s`    {{F8{5*D1E,FG$'7"89h)=)=)?@r#   c                    V P                  R R.\        R7      pV P                  RVR,          4       V P                  RVR,          4       V P                  RVR,          P                  4       4       R	# )
rK  rO  r)  r   rP  r   rQ  rY  r   Nrb  r   s   & r!   test_py2_default_env!TestLauncher.test_py2_default_env  sc    {{D&>{{;*D1E,FGT*:%;<*DN,@,@,BCr#   c                    V P                  R R.\        R7      pV P                  RVR,          4       V P                  RVR,          4       V P                  RVR,          P                  4       4       R	# )
r8  rO  r)  r   rP  r   rQ  r^  r   Nrb  r   s   & r!   test_py3_default_env!TestLauncher.test_py3_default_env  sc    {{D&>{{;*D1E,FG-=(>?BDNDXDXDZ[r#   c           
        V P                  \        4      ;_uu_ 4        R F  pV P                  V4      ;_uu_ 4        V P                  R.V R2R7      pV P	                  RVR,          4       V P	                  RVR,          4       V P	                  RVR	,          P                  4       4       R
R
R
4       K  	  R
R
R
4       R
#   + '       g   i     K  ; i  + '       g   i     R
# ; i)"py.exe"	--versionz
 --versionr   r   rP  r
   rQ  zX.Y.exe --versionr   N)rm  r   z"py"py)r   rT  r   r   r   rU  )r^   r   r7   s   &  r!   test_py_default_short_argv0(TestLauncher.test_py_default_short_argv0  s    [[)**=\\%((;;}eWJ;O;PD$$%6=Q8RS$$Wd3C.DE$$%8$x.:N:N:PQ	 )( > +*((( +**s#   CA1C.CC	CC)	c                    V P                  R .\        R7      pRpVR,          P                  4        F5  p\        P                  ! RV4      pV'       g   K$  VP                  ^4      p M	  V P                  RV4       R# )r   r)  Nr   z\s*-V:(.+?)\s+?\*\s+(.+)$r   )r   rc  r   r
  r  r  r   )r^   r7   defaultr  r  s   &    r!   test_py_default_in_list$TestLauncher.test_py_default_in_list  sk    {{D6{{3N--/D5t<Aq''!*	 0
 	0':r#   c           	        V P                  4       ;_uu_ 4       w  rV P                  R .VR7      pVR,          P                  4        FN  p\        P                  ! RV4      pV'       g   K$  V P                  \        V4      VP                  ^4      4        MM	  \        P                  '       d%   \        VR,          4       \        VR,          4       V P                  R4       V P                  R.VR7      pVR,          P                  4        FE  p\        P                  ! RV4      pV'       g   K$  V P                  RVP                  ^4      4        M	  V P                  R4       R	R	R	4       R	#   + '       g   i     R	# ; i)
r   r)  r   z\s*\*\s+(.+)$r   zdid not find active venv pathr   zActive venvzdid not find active venv entryN)r   r   r   r
  r  r   r   r  r   r   r   fail)r^   r   r   r7   r  r  s   &     r!   test_virtualenv_in_list$TestLauncher.test_virtualenv_in_list  s   ^^(;;wC;0DX113HH-t41$$S]AGGAJ?	 4 ???$x.)$x.)		9:;;v3;/DX113HH-t41$$]AGGAJ?	 4 		:;) s    AE3+AE3/A?E336E33F	c                   V P                  4       ;_uu_ 4       w  rV P                  . / VCR R/CR7      pV P                  R./ VCR R/CR7      pRRR4       V P                  XR,          P                  4       \	        X4      4       V P                  VR,          R4       V P                  XR,          P                  4       \	        V4      4       V P                  VR,          R4       R#   + '       g   i     L; i)r   zPythonTestSuite/3r)  z-V:PythonTestSuite/3Nr   zSearchInfo.lowPriorityTagr   )r   r   r   rU  r"   assertNotEqual)r^   r   r   data1data2s   &    r!   test_virtualenv_with_env%TestLauncher.test_virtualenv_with_env%  s    ^^(KK(Q3(Q=P(QKREKK!7 8>g>gkSf>gKhE  	x..0%/B:;VDE(O113U8_EE"=>G s   6C++C;	c           	        V P                  \        4      ;_uu_ 4        V P                  R 4      ;_uu_ 4       pV P                  VR.4      pRRR4       RRR4       V P	                  RXR,          4       V P	                  RVR,          4       V P	                  R\        X4       R2VR	,          P                  4       4       R#   + '       g   i     L; i  + '       g   i     L; i)
#! /usr/bin/python -prearg-postargNr   rP  r
   rQ  X.Y.exe -prearg 	 -postargr   r   rT  r   r   r   r"   rU  r^   r   r7   s   &  r!   test_py_shebangTestLauncher.test_py_shebang0  s    [[)**9::f{{FJ#78 ; + 	*D1E,FG$'7"89+E&M?)Dd8nFZFZF\]	 ;: +*"   CC	CCCC'	c           	        V P                  \        4      ;_uu_ 4        V P                  R 4      ;_uu_ 4       pV P                  VR.4      pRRR4       RRR4       V P	                  RXR,          4       V P	                  RVR,          4       V P	                  R\        X4       R2VR	,          P                  4       4       R#   + '       g   i     L; i  + '       g   i     L; i)
z#! python -preargr  Nr   rP  r
   rQ  r  r  r   r  r  s   &  r!   test_python_shebang TestLauncher.test_python_shebang8  s    [[)**011V{{FJ#78 2 + 	*D1E,FG$'7"89+E&M?)Dd8nFZFZF\]	 21 +*r  c           	        V P                  \        4      ;_uu_ 4        V P                  R 4      ;_uu_ 4       pV P                  VR.4      pRRR4       RRR4       V P	                  RXR,          4       V P	                  RVR,          4       V P	                  R\        X4       R2VR	,          P                  4       4       R#   + '       g   i     L; i  + '       g   i     L; i)
z#! /usr/bin/python2 -preargr  Nr   rP  r   rQ  X.Y-32.exe -prearg r  r   r  r  s   &  r!   test_py2_shebangTestLauncher.test_py2_shebang@  s    [[)**:;;v{{FJ#78 < + 	*D1E,FGT*:%;<.uV}oYGh--/	1	 <; +*r  c           	        V P                  \        4      ;_uu_ 4        V P                  R 4      ;_uu_ 4       pV P                  VR.4      pRRR4       RRR4       V P	                  RXR,          4       V P	                  RVR,          4       V P	                  R\        X4       R2VR	,          P                  4       4       R#   + '       g   i     L; i  + '       g   i     L; i)
#! /usr/bin/python3 -preargr  Nr   rP  r   rQ  +X.Y-arm64.exe -X fake_arg_for_test -prearg r  r   r  r  s   &  r!   test_py3_shebangTestLauncher.test_py3_shebangI  s    [[)**:;;v{{FJ#78 < + 	*D1E,FG-=(>?FuV}oU^_h--/	1	 <; +*r  c           	        V P                  \        4      ;_uu_ 4        V P                  R 4      ;_uu_ 4       pV P                  VR.4      pRRR4       RRR4       V P	                  RXR,          4       V P	                  RVR,          4       V P	                  R\        X4       R2VR	,          P                  4       4       R#   + '       g   i     L; i  + '       g   i     L; i)
z#! /usr/bin/python -prearg
r  Nr   rP  r
   rQ  r  r  r   r  r  s   &  r!   test_py_shebang_nlTestLauncher.test_py_shebang_nlR  s    [[)**;<<{{FJ#78 = + 	*D1E,FG$'7"89+E&M?)Dh--/	1	 =< +*r  c           	        V P                  \        4      ;_uu_ 4        V P                  R 4      ;_uu_ 4       pV P                  VR.4      pRRR4       RRR4       V P	                  RXR,          4       V P	                  RVR,          4       V P	                  R\        X4       R2VR	,          P                  4       4       R#   + '       g   i     L; i  + '       g   i     L; i)
z#! /usr/bin/python2 -prearg
r  Nr   rP  r   rQ  r  r  r   r  r  s   &  r!   test_py2_shebang_nl TestLauncher.test_py2_shebang_nl[  s    [[)**<=={{FJ#78 > + 	*D1E,FGT*:%;<.uV}oYGh--/	1	 >= +*r  c           	        V P                  \        4      ;_uu_ 4        V P                  R 4      ;_uu_ 4       pV P                  VR.4      pRRR4       RRR4       V P	                  RXR,          4       V P	                  RVR,          4       V P	                  R\        X4       R2VR	,          P                  4       4       R#   + '       g   i     L; i  + '       g   i     L; i)
z#! /usr/bin/python3 -prearg
r  Nr   rP  r   rQ  r  r  r   r  r  s   &  r!   test_py3_shebang_nl TestLauncher.test_py3_shebang_nld  s    [[)**<=={{FJ#78 > + 	*D1E,FG-=(>?FuV}oU^_h--/	1	 >= +*r  c           
        V P                  \        4      ;_uu_ 4        V P                  R 4      ;_uu_ 4       pV P                  VR.RV R2R7      pRRR4       RRR4       V P	                  RXR,          4       V P	                  RVR	,          4       V P	                  R
X R2VR,          P                  4       4       R#   + '       g   i     Lw; i  + '       g   i     L; i)r  r  z
"py.exe" "z
" -postargro  Nr   rP  r
   rQ  zX.Y.exe -prearg "r   )r   rT  r   r   r   rU  r  s   &  r!   test_py_shebang_short_argv0(TestLauncher.test_py_shebang_short_argv0m  s    [[)**9::f{{FJ#7
6(R\>]{^ ; + 	*D1E,FG$'7"89,VHJ?hAUAUAWX ;: +*s"   CC	CCCC$	c           	        V P                  \        4      ;_uu_ 4        R P                  R4      pV P                  RV,           4      ;_uu_ 4       pV P	                  VR.4      pRRR4       RRR4       V P                  RXR,          4       V P                  RVR,          4       V P                  R	\        X4       R
2VR,          P                  4       4       R#   + '       g   i     L; i  + '       g   i     L; i)r  r   s   ﻿r  Nr   rP  r
   rQ  r  r  r   )r   rT  encoder   r   r   r"   rU  r^   r\   r   r7   s   &   r!   test_py_shebang_valid_bom&TestLauncher.test_py_shebang_valid_bomv  s    [[)**299'BG_w6776{{FJ#78 8 + 	*D1E,FG$'7"89+E&M?)Dd8nFZFZF\]	 87 +*s#   2C/C	$C/C,'C//C?	c           	     6   V P                  \        4      ;_uu_ 4        R P                  R4      pV P                  RV,           4      ;_uu_ 4       pV P	                  VR.4      pRRR4       RRR4       V P                  RXR,          4       V P                  RVR,          4       V P                  R	VR
,          4       V P                  R\        X4       R2VR,          P                  4       4       R#   + '       g   i     L; i  + '       g   i     L; i)r  r   s   謹r  NzInvalid BOMr   r   rP  r
   rQ  X.Y.exe r  r   )	r   rT  r  r   r   assertInr   r"   rU  r  s   &   r!   test_py_shebang_invalid_bom(TestLauncher.test_py_shebang_invalid_bom  s    [[)**3::7CG_w6776{{FJ#78 8 + 	mT(^4*D1E,FG$'7"898E&M?)<d8n>R>R>TU 87 +*s#   2DC5	$D5D DD	c                   V P                  R P                  RR.4      4      ;_uu_ 4        V P                  . R^gR7      pRRR4       V P                  RXR,          4       V P                  RVR	,          4       R#   + '       g   i     LD; i)
r   r   zpython=3.999-64T)r   r   Nz3.999-64rQ  r   zSearchInfo.oldStyleTag)r   joinr   r   r   s   & r!   test_py_handle_64_in_ini%TestLauncher.test_py_handle_64_in_ini  sr    [[L2C#DEFF;;rdc;JD G 	T*:%;<&>!?@	 GFs   A<<B	c                x   \        R 4      P                  4       pVP                  4        V P                  VP                  4       V P                  \        4      ;_uu_ 4        V P                  RVP                   R24      ;_uu_ 4       pV P                  VR.RVP                   R\        P                  ! R4       2/R7      pRRR4       RRR4       V P                  \        V4       R\        X4       R	2XR
,          P                  4       4       R#   + '       g   i     LY; i  + '       g   i     Ld; izarbitrary-exe-name.exe#! /usr/bin/env z -preargr  r{   r|   r)  Nz	 -prearg r  r   )r   absoluter   
addCleanuprk   r   rT  r   stemr   r   r   r   r   r"   rU  r^   exer   r7   s   &   r!   test_search_pathTestLauncher.test_search_path  s    +,557		

#[[)**/zBCCv{{Z(CJJ<q61B0C!DE #  D + 	E#J<yvyIh--/	1 DC +*$   "(D)
;D	D)D&!D))D9	c                x   \        R 4      P                  4       pVP                  4        V P                  VP                  4       V P                  \        4      ;_uu_ 4        V P                  RVP                   R24      ;_uu_ 4       pV P                  VR.RVP                   R\        P                  ! R4       2/R7      pRRR4       RRR4       V P                  \        V4       R\        X4       R	2XR
,          P                  4       4       R#   + '       g   i     LY; i  + '       g   i     Ld; ir  )r   r  r   r  rk   r   rT  r   r  r   r   r   r   r   r"   rU  r  s   &   r!   test_search_path_exe!TestLauncher.test_search_path_exe  s    +,557		

#[[)**/zBCCv{{Z(CJJ<q61B0C!DE #  D + 	E#J<yvyIh--/	1 DC +*r  c                   V P                  4       P                  pV P                  \        4      ;_uu_ 4        V P	                  R V 24      ;_uu_ 4       pV P                  V.RV P                  4       P                   R\        P                  ! R4       2/R7      pRRR4       RRR4       V P                  R\        X4       2XR,          P                  4       4       R#   + '       g   i     LM; i  + '       g   i     LX; i)r  r{   r|   r)  Nr  r   )r   r  r   rT  r   r   r   r   r   r   r"   rU  )r^   r  r   r7   s   &   r!   test_recursive_search_path'TestLauncher.test_recursive_search_path  s     %%[[)**/v6776{{HDOO$5$<$<#=Qryy?P>Q!RS #  8 + 	8E&M?3T(^5I5I5KL 87 +*s$   C5AC"	C5"C2-C55D	c                `   V P                  R .RR/^oR7      pVR,          P                  4       p \        P                  ! RR.\        P                  \        P
                  R7       V P                  RV4       V P                  R	V4       R
#   \         d    T P                  RT4        L3i ; i)z-V:3.10PYLAUNCHER_ALWAYS_INSTALLr   r4  r   z
winget.exern  )r   r   zms-windows-store://9PJPW5LDXLZ5N)r   rU  r   
check_callr   STDOUTr  re   )r^   r7   cmds   &  r!   test_installTestLauncher.test_install  s    {{I;-H#,Nbe{f8n""$	-!!<"=joo^h^o^op MM,,nc* ! 	6MM/5	6s   7B B-,B-c                    V P                  R 4      ;_uu_ 4       pV P                  V.4      pRRR4       V P                  R\        X4       2XR,          P	                  4       4       R#   + '       g   i     LE; i)z#! C:/some_random_app -withargNzC:\some_random_app -witharg r   )r   r   r   r"   rU  r  s   &  r!   test_literal_shebang_absolute*TestLauncher.test_literal_shebang_absolute  s^    [[9::f;;x(D ;+E&M?;N  "	
 ;:s   A**A:	c                F   V P                  R 4      ;_uu_ 4       pV P                  V.4      pRRR4       V P                  \        XP                  P                  R,          4       R\        V4       2XR,          P                  4       4       R#   + '       g   i     Lk; i)z#! ..\some_random_app -withargNsome_random_app
 -witharg r   r   r   r   r"   r   rU  r  s   &  r!   test_literal_shebang_relative*TestLauncher.test_literal_shebang_relative  sy    [[:;;v;;x(D <V]])),==>?z%PV-YN  "	
 <;s   BB 	c                ^   V P                  R 4      ;_uu_ 4       pV P                  V.4      pRRR4       V P                  \        XP                  R,          4       R\        V4       2XR,          P                  4       4       V P                  R4      ;_uu_ 4       pV P                  V.4      pRRR4       V P                  \        VP                  R,          4       R\        V4       2VR,          P                  4       4       R#   + '       g   i     L; i  + '       g   i     Lt; i)z#! "some random app" -withargNzsome random appr  r   z#! some" random "app -withargr  r  s   &  r!   test_literal_shebang_quoted(TestLauncher.test_literal_shebang_quoted  s    [[899V;;x(D :V]]%6678
5=/RN  "	

 [[899V;;x(D :V]]%6678
5=/RN  "	
 :9 :9s   D	D	D	D,	c                2   V P                  R 4      ;_uu_ 4       pV P                  V.4      pRRR4       V P                  \        XP                  R,          4       R\        V4       2XR,          P                  4       4       R#   + '       g   i     La; i)z#! some\" random "app -withargNzsome/ random appr  r   r  r  s   &  r!   "test_literal_shebang_quoted_escape/TestLauncher.test_literal_shebang_quoted_escape  sr    [[:;;v;;x(D <V]]%7789E&M?SN  "	
 <;s   BB	c           	     l   V P                  \        4      ;_uu_ 4        V P                  R 4      ;_uu_ 4       pV P                  V.4      pRRR4       RRR4       V P	                  R\        X4       2XR,          P                  4       4       R#   + '       g   i     LM; i  + '       g   i     LX; i)z#! test-command arg1NzTEST_EXE.exe arg1 r   )r   TEST_PY_COMMANDSr   r   r   r"   rU  r  s   &  r!   test_literal_shebang_command)TestLauncher.test_literal_shebang_command  s~    [[)**344{{F8, 5 + 	 v0N  "	
 54 +*s"   B#B	B#B B##B3	c                6   V P                  R 4      ;_uu_ 4       pV P                  V.4      pRRR4       XP                  R,          pV P                  \	        V4       R\	        V4       2XR,          P                  4       4       R#   + '       g   i     Lc; i)z#! /usr/bin/not-python arg1Nz/usr/bin/not-python arg1 r   )r   r   r   r   r"   rU  )r^   r   r7   r  s   &   r!   %test_literal_shebang_invalid_template2TestLauncher.test_literal_shebang_invalid_template  su    [[6776;;x(D 8!66V}oVE&M?3N  "	
 87s   BB	c           
     T   R pV P                  RV R24      ;_uu_ 4       pV P                  V.^gR7      pRRR4       V P                  4       ;_uu_ 4       w  rE\        \        V4      P                  4      P                  4       pVP                  4        V P                  VP                  4       VP                   R\        P                  R,           2VR&   V P                  RV R24      ;_uu_ 4       pV P                  V.VR7      pRRR4       V P                  XR,          P                  4       \        V4       R	\        X4       24       V P                  RVP                   R24      ;_uu_ 4       pV P                  V.VR7      pRRR4       V P                  VR,          P                  4       \        V4       R	\        V4       24       RRR4       R#   + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)
zpython-that-is-not-on-pathr  z arg1r0  Nr|   r{   r)  r   r  )r   r   r   r   r  r  r   r  rk   r   r   r   r   rU  r"   r  )r^   r  r   r7   r   r   r  s   &      r!   test_shebang_command_in_venv)TestLauncher.test_shebang_command_in_venv  s   + [[+D6788F;;x3;?D 9 ^^( tH~**+446CIIKOOCJJ' ZZL"**V*<)=>CK/vU;<<{{F8{5 =T(^113h7HuU[}o5^_/z?@@F{{F8{5 AT(^113c
|6%PV-5YZ  988 =< A@ sJ   GB H5G0	
A-H7H	AHG-	0H ;HHHH'	c                f   V P                  R 4      ;_uu_ 4       pV P                  V.^gR7      pRRR4       RpXR,          P                  4        Uu. uF,  pVP                  R4      '       g   K  VP	                  4       NK.  	  ppV P                  V.V4       R#   + '       g   i     Lt; iu upi )z#! /usr/bin/env python3.99r0  Nz # Search PATH for python3.99.exer   z# Search PATH)r   r   r   r   rU  r   )r^   r   r7   r  r  r  s   &     r!   !test_shebang_executable_extension.TestLauncher.test_shebang_executable_extension  s    [[566&;;x3;?D 73+/>+D+D+F 7+F4___5 $**,+F 7&6* 767s   BB.0B.B+	 N)7rp   rq   rr   rs   r   r   r   r   r   r  r  r  r&  r*  r-  r1  r5  r=  rH  rL  rV  rZ  r_  rd  rg  rj  rq  ru  ry  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  rt   ru   rv   s   @r!   r   r   '  s+    O O 1 1
I
:
C2 D339"3
5	45AD\AD\R;<.	H^^11111Y^VA11	M+





[2+ +r#   r   )(r   r:   r   r
  r   r   r   r   r   r   pathlibr   testr   platformr   r(   r   r   r   casefoldendswithprefixr   r'   rc  r  r*   lowerrT  r  r"   r8   rA   rI   rV   rX   ry   TestCaser   )r3   r4   s   00r!   <module>r     sF     	 	   
     <<7


:
;;  
>>%%h&7&7&9::FK
 */=cjj )
 	+cjj ,
 	.cjj /%'=
 	>cjj
3@ 1/cjj #..
	C+	\ %), 99)4):):)<=)<2q)<=   99  '
*"$3 3({  { |u+8$$j u+g >s   'G