+
    Bi$              	       `   ^ RI t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	t	^ RI
t
^ RIt^ RIt^ RIt^ RIt^ RIHtHt  ^ RIHt ^ RIHt ^ RIHt ]! 4        Rt^ RIHt ^ R	IHt ^ R
IHt ^ RI H!t! ^ RI H"t" ^ RI#H$t$ R t%R t&R t' ! R R4      t( ! R R](]PR                  ]"RR7      t* ! R R](]PR                  ]"RR7      t+]PX                  ! ]PZ                  R4       ! R R]PR                  4      4       t. ! R R4      t/ ! R R]/]PR                  ]"RR7      t0 ! R R ]/]PR                  ]"RR7      t1]Pd                   ! R! R"4      4       t3 ! R# R$]3]PR                  ]"RR7      t4 ! R% R&]3]PR                  ]"RR7      t5]6R'8X  d   ]Pn                  ! 4        R# R#   ]]3 d    Rt ELOi ; i)(    N)mock
skipUnless)_cleanup_tests)ProcessPoolExecutor)_check_system_limitsTF)support)	os_helper)script_helper)without_source_date_epoch)SourceDateEpochTestMeta)FakePathc                 V    V'       g   R p\         P                  P                  WR7      # ) optimization)	importlibutilcache_from_sourcescriptopts   &&+/usr/lib/python3.14/test/test_compileall.pyget_pycr   $   s"    >>++F+EE    c                 B    R Uu. uF  p\        W4      NK  	  up# u upi )r   r         )r   r   s   & r   get_pycsr   +   s    ,56ISGF I666s   c                    \         P                  ! V 4      P                  p\         P                  ! V4      P                  pW#8H  # )z8Returns True if two files have the same inode (hardlink))osstatst_ino)	filename1	filename2inode1inode2s   &&  r   is_hardlinkr(   /   s3    WWY&&FWWY&&Fr   c                     a  ] tR t^6t o 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4      ]P6                  ! R4      R 4       4       tR t]! ]R4      ]P6                  ! R4      R 4       4       t]! ]R4      ]P6                  ! R4      ]P6                  ! R4      R 4       4       4       t]! ]R4      ]P6                  ! RRR7      ]P6                  ! R4      R 4       4       4       t R t!R R!/R" lt"R# t#]! ]R4      R$ 4       t$R% t%]! ]R4      R& 4       t&R' t'R( t(R) t)R* t*R+ t+R, t,]-P\                  R- 4       t/R.t0V t1R# )/CompileallTestsBasec                F   \         P                  ! 4       V n        V P                  \        P
                  V P                  4       \        P                  P                  V P                  R 4      V n	        \        P                  P                  V P                  4      V n        \        V P                  RRR7      ;_uu_ 4       pVP                  R4       RRR4       \        P                  P                  V P                  R4      V n        \        P                  P                  V P                   4      V n        \        P$                  ! V P                  V P                   4       \        P                  P                  V P                  R4      V n        \        P(                  ! V P&                  4       \        P                  P                  V P&                  R4      V n        \        P$                  ! V P                  V P*                  4       R#   + '       g   i     ELD; i)	_test.pywutf-8encodingzx = 123
Nz	_test2.py_subdirz	_test3.py)tempfilemkdtemp	directory
addCleanupshutilrmtreer!   pathjoinsource_pathr   r   r   bc_pathopenwritesource_path2bc_path2copyfilesubdirectorymkdirsource_path3selffiles   & r   setUpCompileallTestsBase.setUp8   sH   !))+t~~677<<
C ~~778H8HI$""C'::dJJ{# ;GGLLE!889J9JK(($*;*;<GGLLC
""#GGLL):):KH(($*;*;< ;::s   HH 	c                    \         P                  P                  V P                  R 4      V n        \        V P                  RRR7      ;_uu_ 4       pVP                  R4       RRR4       R#   + '       g   i     R# ; i)z_test_bad.pyr-   r.   r/   zx (
N)r!   r8   r9   r4   bad_source_pathr<   r=   rD   s   & r   add_bad_source_file'CompileallTestsBase.add_bad_source_fileH   sO    !ww||DNNNK$&&g>>$JJw ?>>>s   A,,A=	c                v   \        V P                  R 4      ;_uu_ 4       pVP                  ^4      pRRR4       \        \        P
                  ! V P                  4      P                  4      p\        P                  ! R\        P                  P                  ^ VR,          4      pXV3#   + '       g   i     L; i)rbN<4sLL    )r<   r;   readintr!   r"   r:   st_mtimestructpackr   r   MAGIC_NUMBER)rE   rF   datamtimecompares   &    r   timestamp_metadata&CompileallTestsBase.timestamp_metadataM   s    $,,%%99R=D &BGGD,,-667++gy~~'B'BA#k13W} &%s   B((B8	c                    \         P                  ! V P                  R4       \        P                  ! \        P                  ! 4       4      ;_uu_ 4        V P                  \        P                  ! V P                  4      4       RRR4       R#   \        \        3 d    T P                  R4        Li ; i  + '       g   i     R# ; i)r   z0filesystem doesn't support timestamps near 2**32N)rP   rP   r!   utimer:   OverflowErrorOSErrorskipTest
contextlibredirect_stdoutioStringIO
assertTrue
compileallcompile_filerE   s   &r    test_year_2038_mtime_compilation4CompileallTestsBase.test_year_2038_mtime_compilationU   s    	NHHT%%'=> ''66OOJ33D4D4DEF 76 w' 	NMMLM	N666   !B 0B6"B32B36C	c                    \         P                  ! V P                  R4       \        P                  ! \        P                  ! 4       4      ;_uu_ 4        V P                  \        P                  ! V P                  4      4       RRR4       R#   \        \        3 d    T P                  R4        Li ; i  + '       g   i     R# ; i)r   z+filesystem doesn't support large timestampsN)         rn   r]   ri   s   &r   test_larger_than_32_bit_times1CompileallTestsBase.test_larger_than_32_bit_times_   s    	IHHT%%~6 ''66OOJ33D4D4DEF 76 w' 	IMMGH	I666rl   c                   \         P                  P                  R4      '       d   \        P                  ! R4      h\
        P                  ! V P                  4       V P                  ! V P                  4       !   \        V P                  R4      ;_uu_ 4       pVP                  4       \        V4      R pRRR4       \        V P                  R4      ;_uu_ 4       pVP                  V4       VP                  X4       RRR4       V P                  ! V P                  4       !   \         P"                  ! V P$                  RRR7       V P&                  ! V P                  4       !   R#   + '       g   i     L; i  + '       g   i     L; i)	zGCheck that compileall recreates bytecode when the new metadata is
used.SOURCE_DATE_EPOCHzSOURCE_DATE_EPOCH is setrN   NwbFTforcequiet)r!   environgetunittestSkipTest
py_compilecompiler:   assertEqualrZ   r<   r;   rQ   lenr=   assertNotEqualrg   compile_dirr4   rf   )rE   metadatarF   bcs   &&  r   recreation_check$CompileallTestsBase.recreation_checki   s    ::>>-..##$>??4++,$1134$,,%%S]^,B &$,,%%JJx JJrN & 	T4467t~~U$G0023 &%%%s   E'#E:'E7	:F
	c                    V P                  \        P                  ! R \        P                  P
                  ^ ^4      4       R# )rO   N)r   rT   rU   r   r   rV   ri   s   &r   
test_mtimeCompileallTestsBase.test_mtimey   s.    fkk'9>>3N3N*+Q0 	1r   c                (    V P                  R 4       R# )s       N)r   ri   s   &r   test_magic_number%CompileallTestsBase.test_magic_number~   s    k*r   c                   V P                   V P                  3 F  p \        P                  ! V4       K  	  V P	                  \
        P                  ! V P                  R RR7      4       T P	                  \        P                  P                  V P                   4      ;'       d/    \        P                  P                  V P                  4      '       * 4       \        P                  ! V P                   4       V P	                  \
        P                  ! V P                  R RR7      4       T P	                  \        P                  P                  V P                   4      ;'       d*    \        P                  P                  V P                  4      4       \        P                  ! V P                   4       \        P                  ! V P                  4       V P                  4        V P                  \
        P                  ! V P                  R ^R7      4       V P                  \
        P                  ! V P                  R ^R7      4       R#     EK5  ; i)FTrt   N)r;   r?   r!   unlinkrf   rg   rh   r:   r8   isfiler   r4   rK   assertFalserJ   )rE   fns   & r   test_compile_files&CompileallTestsBase.test_compile_files   s   <</B		" 0
 	
//0@0@6;4I 	Jt||4 : :GGNN4==99	;
		$,,
..t~~U59; 	<t||4 6 6t}}5	7
		$,,
		$--   "001E1E7<AG 	H//6;1F 	G#s   IIc           	        V P                  \        P                  P                  V P                  4      4       \
        P                  ! 4       ;_uu_ 4       pV P                  \        P                  ! \        V P                  4      4      4       R R R 4       V P                  XP                  4       R4       V P                  \        P                  P                  V P                  4      4       R #   + '       g   i     Lj; i)Nz&Compiling ([^WindowsPath|PosixPath].*))r   r!   r8   r   r;   r   captured_stdoutrf   rg   rh   r   r:   assertRegexgetvalue)rE   stdouts   & r   test_compile_file_pathlike.CompileallTestsBase.test_compile_file_pathlike   s    56$$&&&OOJ33HT=M=M4NOP '*,UVt||45 '&s   9C11D	c                n   V P                  \        P                  P                  V P                  4      4       V P                  \        P                  ! \        V P                  4      \        R 4      ^R7      4       V P                  \        P                  P                  V P                  4      4       R# )	ddir_path)ddirrv   N
r   r!   r8   r   r;   rf   rg   rh   r   r:   ri   s   &r   test_compile_file_pathlike_ddir3CompileallTestsBase.test_compile_file_pathlike_ddir   sq    56
//9I9I0J5=k5J679 	: 	t||45r   c                n   V P                  \        P                  P                  V P                  4      4       V P                  \        P                  ! \        V P                  4      \        R 4      ^R7      4       V P                  \        P                  P                  V P                  4      4       R# stripdir_path)stripdirrv   Nr   ri   s   &r   #test_compile_file_pathlike_stripdir7CompileallTestsBase.test_compile_file_pathlike_stripdir   sq    56
//9I9I0J9A/9R679 	: 	t||45r   c                n   V P                  \        P                  P                  V P                  4      4       V P                  \        P                  ! \        V P                  4      \        R 4      ^R7      4       V P                  \        P                  P                  V P                  4      4       R# prependdir_path)
prependdirrv   Nr   ri   s   &r   %test_compile_file_pathlike_prependdir9CompileallTestsBase.test_compile_file_pathlike_prependdir   sr    56
//9I9I0J;CDU;V679 	: 	t||45r   c           
     (   \         P                  P                  P                  V P                  .R 7      ;_uu_ 4        V P                  \        P                  ! ^R7      4       RRR4       \         P                  P                  P                  V P                  .R 7      ;_uu_ 4        V P                  4        V P                  \        P                  ! RR^R7      4       RRR4       R#   + '       g   i     L; i  + '       g   i     R# ; i)r8   rv   NFT)skip_curdirru   rv   )
testtest_importlibr   import_stater4   rf   rg   compile_pathrK   r   ri   s   &r   test_compile_path%CompileallTestsBase.test_compile_path   s      %%228H2IIOOJ33!<= J   %%228H2II$$&Z44;?qJ K JI JI JIIs   'C-*9D -C=	 D	c                   \         P                  P                  V P                  R 4      p\         P                  P                  VR4      p\         P                  ! V4       \        VR4      ;_uu_ 4         RRR4       \        P                  ! V4       V P                  \         P                  P                  \         P                  P                  VR4      4      4       R#   + '       g   i     Lt; i)rW   rF   rs   N__pycache__)
r!   r8   r9   r4   rB   r<   rg   rh   r   exists)rE   data_dir	data_files   &  r   test_no_pycache_in_non_package2CompileallTestsBase.test_no_pycache_in_non_package   s     77<<7GGLL62	
)T"" #	*X}(MNO #"s   5C##C3	c                    V P                  4        \        P                  ! \        P                  ! 4       4      ;_uu_ 4        V P                  \        P                  ! V P                  4      4       R R R 4       R #   + '       g   i     R # ; iN)	rK   rb   rc   rd   re   r   rg   rh   rJ   ri   s   &r   #test_compile_file_encoding_fallback7CompileallTestsBase.test_compile_file_encoding_fallback   sS      "''66Z44T5I5IJK 7666s   0A<<B	c                j   Rw  r\         P                  ! T P                  RTR7       \        P                  P                  T P                  TR7      pT P                  \        P                  P                  T4      4       \        P                  P                  T P                  TR7      pT P                  \        P                  P                  T4      4       \        P                  P                  T P                  TR7      pT P                  \        P                  P                  T4      4       R# )FTrv   optimizer   N)r   r   )rg   r   r4   r   r   r   r:   rf   r!   r8   r   r>   rC   )rE   r   r   cachedcached2cached3s   &     r   test_optimize!CompileallTestsBase.test_optimize   s     29t~~THM11$2B2B?B 2 Dv./..2243D3D@C 3 Ew/0..2243D3D@C 3 Ew/0r   c                   V P                  \        P                  P                  V P                  4      4       \
        P                  ! 4       ;_uu_ 4       p\        P                  ! \        V P                  4      4       R R R 4       XP                  4       P                  4       ^ ,          pV P                  VR4       V P                  \        P                  P                  V P                  4      4       R #   + '       g   i     L; i)Nz$Listing ([^WindowsPath|PosixPath].*))r   r!   r8   r   r;   r   r   rg   r   r   r4   r   
splitlinesr   rf   )rE   r   lines   &  r   test_compile_dir_pathlike-CompileallTestsBase.test_compile_dir_pathlike   s    56$$&&&""8DNN#;< ' ++-a0FGt||45	 '&s   *C99D		c                n   V P                  \        P                  P                  V P                  4      4       V P                  \        P                  ! \        V P                  4      \        R 4      ^R7      4       V P                  \        P                  P                  V P                  4      4       R# r   
r   r!   r8   r   r;   rf   rg   r   r   r4   ri   s   &r   "test_compile_dir_pathlike_stripdir6CompileallTestsBase.test_compile_dir_pathlike_stripdir   so    56
..x/G8@8Q568 	9 	t||45r   c                n   V P                  \        P                  P                  V P                  4      4       V P                  \        P                  ! \        V P                  4      \        R 4      ^R7      4       V P                  \        P                  P                  V P                  4      4       R# r   r   ri   s   &r   $test_compile_dir_pathlike_prependdir8CompileallTestsBase.test_compile_dir_pathlike_prependdir   sp    56
..x/G:BCT:U568 	9 	t||45r   requires multiprocessingz&concurrent.futures.ProcessPoolExecutorc                    \         P                  ! V P                  R ^R7       V P                  VP                  4       R# Trv   workersNrg   r   r4   rf   calledrE   	pool_mocks   &&r   test_compile_pool_called,CompileallTestsBase.test_compile_pool_called   s,     	t~~T1E	(()r   c                    V P                  \        R 4      ;_uu_ 4        \        P                  ! V P                  RR7       RRR4       R#   + '       g   i     R# ; i)z%workers must be greater or equal to 0)r   N)assertRaisesRegex
ValueErrorrg   r   r4   ri   s   &r   !test_compile_workers_non_positive5CompileallTestsBase.test_compile_workers_non_positive   sI    ##J$KM M""4>>2>M M M Ms   #AA	c                    \         P                  ! V P                  R ^ R7       V P                  VP                  ^,          R,          R4       R# )Tr   max_workersN)rg   r   r4   r}   	call_argsr   s   &&r   test_compile_workers_cpu_count2CompileallTestsBase.test_compile_workers_cpu_count  s:     	t~~T1E,,Q/>Er   zcompileall.compile_filec                    \         P                  ! V P                  R R7       V P                  VP                  4       V P                  VP                  4       R# )Tr   N)rg   r   r4   r   r   rf   )rE   compile_file_mockr   s   &&&r   test_compile_one_worker+CompileallTestsBase.test_compile_one_worker  s?     	t~~T:))*)001r   Nnewc                    \         P                  ! V P                  R ^R7       V P                  VP                  4       R# r   r   )rE   r   s   &&r   $test_compile_missing_multiprocessing8CompileallTestsBase.test_compile_missing_multiprocessing  s-     	t~~T1E)001r   c                   ^pV P                   p\        ^V^,           4       F}  p\        P                  P	                  VRV 24      p\        P                  P	                  VR4      p\        P
                  ! V4       \        P                  ! V P                  V4       K  	  \        P                  P                  X4      p\        P                  ! V P                   RV^,
          R7       V P                  \        P                  P                  V4      4       \        P                  ! V P                   RVR7       V P!                  \        P                  P                  V4      4       R# )   dir_z	script.pyT)rv   	maxlevelsN)r4   ranger!   r8   r9   rB   r6   r@   r:   r   r   r   rg   r   r   r   rf   )rE   depthr8   isourcepyc_filenames   &     r   test_compile_dir_maxlevels.CompileallTestsBase.test_compile_dir_maxlevels  s    ~~q%!)$A77<<QCj1DWW\\$4FHHTNOOD,,f5	 %
 !~~77?t~~TUQYO56t~~TUK|45r   parallelTc                  RR.pV P                   p. pV Fw  p\        P                  P                  WF4      p\        P                  ! V4       \
        P                  ! VRR4       VP                  \
        P                  ! VRR4      4       Ky  	  V'       d   V P                  \        4       \        P                  ! V P                   RTV'       d   ^M^R7       V P                  V4       V EF  pV P                  WpP                   4       \        P                  P!                  V4      pV\#        V P                   \        P$                  ,           4      R	 p	\
        P&                  ! V4      w   r\        P                  P                  W4      p\(        P*                  P                  P-                  V4      pV P/                  VP0                  V4       V P3                  R
V R
2\        P4                  ! V4      4       EK  	  R	# )z@Recursive compile_dir ddir must contain package paths; bpo39769.r   foo__init__r   modzdef fn(): 1/0
fn()
T)rv   r   r   N")r4   r!   r8   r9   rB   r
   make_scriptappendr5   multiprocessing_cleanup_testsrg   r   rf   assertStartsWithr   r   r   r~   sepassert_python_failurer   r   get_code_from_pycr}   co_filenameassertInfsdecode)rE   r   r   fullpathr8   modssubdirr  modcodemodpath_errexpected_inmod_code_objs   &$$           r   _test_ddir_only#CompileallTestsBase._test_ddir_only+  s{   E?~~F77<<-DHHTN%%dJ;KK11$2IK L	  OO9:d%1	. 	C!!#~~6nn66s;G#dnnRVV3456G%;;GDIAq'',,t5K..33EEgNL\55{CMMAk]!,bkk#.>? r   c                (    V P                  RRR7      # )=Recursive compile_dir ddir= contains package paths; bpo39769.
<a prefix>Fr   r   r  ri   s   &r   test_ddir_only_one_worker-CompileallTestsBase.test_ddir_only_one_workerH  s    ###FFr   c                (    V P                  RRR7      # )r  r  Tr  r  ri   s   &r   test_ddir_multiple_workers.CompileallTestsBase.test_ddir_multiple_workersL  s     ###EEr   c                (    V P                  RRR7      # )?Recursive compile_dir ddir='' contains package paths; bpo39769.r   Fr  r  ri   s   &r   test_ddir_empty_only_one_worker3CompileallTestsBase.test_ddir_empty_only_one_workerQ  s    ##e#<<r   c                (    V P                  RRR7      # )r$  r   Tr  r  ri   s   &r    test_ddir_empty_multiple_workers4CompileallTestsBase.test_ddir_empty_multiple_workersU  s     ##d#;;r   c                   . ROp\         P                  P                  ! V P                  .VO5!  p\         P                  ! V4       \
        P                  ! VR R4      p\        P                  P                  V4      p\         P                  P                  ! V P                  .VR,          O5!  p\        P                  ! VRVR7       \
        P                  ! V4      w  rgp\         P                  P                  ! VR,          !  p	V P                  V	\        V\        P                   ! 4       R7      4       V P#                  V\        V\        P                   ! 4       R7      4       R# )	r   1 / 0Nr   NTrv   r   r   NNr/   Nr   buildrealr8   r!   r8   r9   r4   makedirsr
   r  r   r   r   rg   r   r	  r  strsysgetdefaultencodingassertNotIn)
rE   r  r8   r   r   r   rcoutr  r  s
   &         r   test_strip_only#CompileallTestsBase.test_strip_onlyZ  s    4ww||DNN6X6
D**4A^^--f577<<>">t4(C$::2>ggllHRL1c4467	
 	c4467	
r   c                   . R
Op\         P                  P                  ! V P                  .VO5!  p\         P                  ! V4       \
        P                  ! VR R4      p\        P                  P                  V4      p\         P                  P                  ! V P                  .VR,          R.,           O5!  p\        P                  ! 4       ;_uu_ 4       p\        P                  ! VRVR7       RRR4       V P                  RXP                  4       4       \
        P                   ! V4      w  rvp\         P                  P                  ! V P                  .VR,          O5!  p	V P                  V\#        V\$        P&                  ! 4       R	7      4       V P)                  V	\#        V\$        P&                  ! 4       R	7      4       V P)                  V\#        V\$        P&                  ! 4       R	7      4       R#   + '       g   i     EL; i)r   r+  r,  fakeTr-  Nznot a valid prefixr.  r/   r/  )r!   r8   r9   r4   r3  r
   r  r   r   r   r   r   rg   r   r  r   r	  r4  r5  r6  r7  )
rE   r  r8   r   r   r   r9  r8  r  expected_not_ins
   &         r   test_strip_only_invalid+CompileallTestsBase.test_strip_only_invalidm  sf   4ww||DNN6X6
D**4A^^--f577<<K(2,&2IK$$&&#""4thG '*CLLN;$::2>'',,t~~EEc4467	
 	c4467	
 	c4467	
 '&&s   G66H	c                    . ROp\         P                  P                  ! V P                  .VO5!  p\         P                  ! V4       \
        P                  ! VR R4      p\        P                  P                  V4      pRp\        P                  ! VRVR7       \
        P                  ! V4      w  rgp\         P                  P                  ! WPP                  .VO5!  p	V P                  V	\        V\        P                   ! 4       R7      4       R# )r   r+  /fooT)rv   r   r/   Nr/  )r!   r8   r9   r4   r3  r
   r  r   r   r   rg   r   r	  r  r4  r5  r6  )
rE   r  r8   r   r   r   r8  r9  r  r  s
   &         r   test_prepend_only%CompileallTestsBase.test_prepend_only  s    4ww||DNN6X6
D**4A^^--f5
t4JG$::2>ggll:~~IIc4467	
r   c                   . R	Op\         P                  P                  ! V P                  .VO5!  p\         P                  ! V4       \
        P                  ! VR R4      p\        P                  P                  V4      p\         P                  P                  ! V P                  .VR,          O5!  pRp\        P                  ! VRWVR7       \
        P                  ! V4      w  rxp	\         P                  P                  ! V.VR,          O5!  p
V P                  V
\        V	\        P                   ! 4       R7      4       V P#                  V\        V	\        P                   ! 4       R7      4       R# )
r   r+  r,  rB  T)rv   r   r   r.  r/   Nr/  r2  rE   r  r8   r   r   r   r   r8  r9  r  r  s   &          r   test_strip_and_prepend*CompileallTestsBase.test_strip_and_prepend  s   4ww||DNN6X6
D**4A^^--f577<<>">
t4(0	I$::2>ggll:==c4467	
 	c4467	
r   c           
     l   . ROp\         P                  P                  ! V P                  .VO5!  p\         P                  ! V4       \
        P                  ! VR R4       V P                  \        4      ;_uu_ 4        \        P                  ! VRRRRR7       RRR4       R#   + '       g   i     R# ; i)r   r+  Tz/barrB  )rv   r   r   r   N)r   r0  r1  r8   r   )r!   r8   r9   r4   r3  r
   r  assertRaisesr   rg   r   )rE   r  r8   s   &  r   test_strip_prepend_and_ddir/CompileallTestsBase.test_strip_prepend_and_ddir  sz    <ww||DNN6X6
D!!$8z**""4t&,2vG +***s   <B""B3	c                   \         P                  ! V P                  R R4      p. pR F3  pVP                  \        P
                  P                  VVR7      4       K5  	  ^ ^.^^.^ ^.. RO.pV Fv  p\        P                  ! VRVR7       V FT  pV P                  \        P                  P                  W#,          4      4        \        P                  ! W#,          4       KV  	  Kx  	  R#   \         d     Kl  i ; i)test_optimizationa = 0r   Tr   Nr   r   r   r   r   )r
   r  r4   r  r   r   r   rg   rh   rf   r!   r8   r   r   	Exception)rE   r   r   	opt_leveltest_combinationsopt_combinations   &     r   !test_multiple_optimization_levels5CompileallTestsBase.test_multiple_optimization_levels  s    **4>>+>+24 $IIIinn66vDM 7 O P %  VaVaVY?0O##F$-<>,	r} =>IIbm, -  1 ! s   C**C98C9c                0   \         P                  P                  V P                  R RR4      p\         P                  P                  V P                  R RR4      p\         P                  P                  V P                  R RR4      p\         P                  ! V4       \         P                  ! V4       \         P                  ! V4       \
        P                  ! VRR4      p\
        P                  ! VRR4      p\         P                  P                  VR4      p\         P                  P                  VR	4      p\         P                  ! WF4       \         P                  ! WW4       \        P                  P                  V4      p\        P                  P                  V4      p	\        P                  ! VR
VR7       V P                  \         P                  P                  V4      4       V P                  \         P                  P                  V	4      4       R# )r   dirallowedsymlinks
prohibitedtest_allowedrO  test_prohibitedtest_allowed.pytest_prohibited.pyT)rv   limit_sl_destN)r!   r8   r9   r4   r3  r
   r  symlinkr   r   r   rg   r   rf   r   r   
rE   allowed_pathsymlinks_pathprohibited_pathallowed_scriptprohibited_scriptallowed_symlinkprohibited_symlink
allowed_bcprohibited_bcs
   &         r   test_ignore_symlink_destination3CompileallTestsBase.test_ignore_symlink_destination  s]    ww||DNNFE9MT^^VUJO'',,t~~vulS
L!
M"
O$ '22<QXY)55oGXZab'',,}6GHWW\\-9MN


>3


$9^^55oF
!889KL}DUz2367r   )rJ   r;   r?   r4   r:   r>   rC   rA   )2__name__
__module____qualname____firstlineno__rG   rK   rZ   rj   ro   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   _have_multiprocessingr   patchr   r   r   r   r   r   r  r  r!  r%  r(  r:  r?  rC  rG  rK  rU  r	   skip_unless_symlinkrl  __static_attributes____classdictcell____classdict__s   @r   r*   r*   6   s    =  
GG4 1
+G26666K
PL1666 %'AB	ZZ89* : C*?
 %'AB	ZZ89F : CF %'AB	ZZ89	ZZ)*2 + : C2
 %'AB	ZZ8dC	ZZ)*2 + D C26"@ @:G %'ABF CF= %'AB< C<
&
2

*G& ""8 #8r   r*   c                       ] tR tRtRtR# )CompileallTestsWithSourceEpochi   Nrn  ro  rp  rq  ru  r{  r   r   rz  rz         	r   rz  )	metaclasssource_date_epochc                       ] tR tRtRtR# )!CompileallTestsWithoutSourceEpochi  r{  Nr|  r{  r   r   r  r    r}  r   r  z tempdir is not encodable on WASIc                   6   a  ] tR tRt o RtR tR tR tRtV t	R# )EncodingTesti  zPIssue 6716: compileall should escape source code when printing errors
to stdout.c                4   \         P                  ! 4       V n        \        P                  P                  V P                  R 4      V n        \        V P                  RRR7      ;_uu_ 4       pVP                  R4       RRR4       R#   + '       g   i     R# ; i)r,   r-   r.   r/   u   b"€"N)	r2   r3   r4   r!   r8   r9   r:   r<   r=   rD   s   & r   rG   EncodingTest.setUp  sa    !))+77<<
C$""C'::d JJ{# ;:::s   *BB	c                F    \         P                  ! V P                  4       R # r   )r6   r7   r4   ri   s   &r   tearDownEncodingTest.tearDown  s    dnn%r   c                   \         P                  ! \         P                  ! 4       R R7      p\        P                  ! V4      ;_uu_ 4        \
        P                  ! V P                  4      pRRR4       V P                  X4       VP                  ^ 4       VP                  4       pV P                  RV4       V P                  RV4       R#   + '       g   i     Lh; i)asciir/   Nz<SyntaxError: bytes can only contain ASCII literal charactersUnicodeEncodeError)rd   TextIOWrapperBytesIOrb   rc   rg   r   r4   r   seekrQ   r  r7  )rE   buffercompiledress   &   r   
test_errorEncodingTest.test_error   s    !!"**,A''//!--dnn=H 0"AkkmJ	
 	-s3 0/s   
!CC	)r4   r:   N)
rn  ro  rp  rq  __doc__rG   r  r  ru  rv  rw  s   @r   r  r    s     $&4 4r   r  c                     a  ] tR tRt o RtR t]P                  R 4       tR t	R t
R tR tR	 tR
 t]]P"                  ! R4      R 4       4       t]P"                  ! R4      R 4       tRR. 3RRR.3RRR.33 F  w  ttt]]3R lt]]! 4       R],           &   K!  	  R tR t]R 4       tR tR t]P>                  R 4       t R t!R t"R  t#R! t$R" t%]PL                  R# 4       t'R$ t(R% t)R& t*R' t+R( t,R) t-R* t.]/! ]0R+4      R, 4       t1]2Pf                  ! R-4      R. 4       t4R/ t5R0 t6]P>                  R1 4       t7R2 t8R3 t9R4t:V t;R5# )6CommandLineTestsBasei  zTest compileall's CLI.c                &   \         P                  ! 4       V n        V P                  \        P
                  V P                  4       \        P                  P                  V P                  R 4      V n	        \        P                  ! V P                  4       \        P                  P                  V P                  R4      V n        \        P                  ! V P                  RR4      V n        \        P                  ! V P                  RR4      V n        R# )r   r   r  r   barN)r2   r3   r4   r5   r	   r7   r!   r8   r9   pkgdirrB   pkgdir_cachedirr
   r  initfnbarfnri   s   &r   rG   CommandLineTestsBase.setUp  s    !))+	(($..9ggll4>>59
!ww||DKKG#//ZL"..t{{E2F
r   c              #     "   \         P                  p\        P                  P	                  V P
                  R4      p V\         n        RV P
                  RV/x  V\         n        R#   T\         n        i ; i5i)z&Adjust and restore sys.pycache_prefix.__testcache__
PYTHONPATHPYTHONPYCACHEPREFIXN)r5  pycache_prefixr!   r8   r9   r4   )rE   
old_prefix
new_prefixs   &  r   temporary_pycache_prefix-CommandLineTestsBase.temporary_pycache_prefix  sa      ''
WW\\$../B
	,!+Cdnn%z 
 ",CCs   ;A8A( A8(A55A8c                @    . \         P                  ! 4       OR NRNRNVO# )z-S-mrg   )r   !optim_args_from_interpreter_flags)rE   argss   &&r   _get_run_args"CommandLineTestsBase._get_run_args)  s<    ::< ( 	r   c                    \         P                  ! V P                  V4      / VBR R/B w  r4pV P                  RV4       V# )PYTHONIOENCODINGr.   r   )r
   assert_python_okr  r}   rE   r  env_varsr8  r9  r  s   &*,   r   assertRunOK CommandLineTestsBase.assertRunOK.  sK    $55,,T236>3*13 	c"
r   c                b    \         P                  ! V P                  V4      / VBR R/B w  r4pW4V3# )r  r.   )r
   r	  r  r  s   &*,   r   assertRunNotOK#CommandLineTestsBase.assertRunNotOK5  s@    $::++D125=2)02 |r   c                    \         P                  P                  V4      pV P                  \        P
                  P                  V4      4       R # r   )r   r   r   rf   r!   r8   r   rE   r   r8   s   && r   assertCompiled#CommandLineTestsBase.assertCompiled;  s/    ~~//3t,-r   c                    \         P                  P                  V4      pV P                  \        P
                  P                  V4      4       R # r   )r   r   r   r   r!   r8   r   r  s   && r   assertNotCompiled&CommandLineTestsBase.assertNotCompiled?  s1    ~~//3-.r   c                f   \         P                  ! V P                  R R4      pV P                  4       ;_uu_ 4       pV P                  ! R/ VB  V P                  V4       V P                  V P                  4       V P                  V P                  4       RRR4       R#   + '       g   i     R# ; i)bazr   Nr{  )	r
   r  r4   r  r  r  r  r  r  )rE   bazfnenvs   &  r   test_no_args_compiles_path/CommandLineTestsBase.test_no_args_compiles_pathC  s}    ))$..%D**,,#s#&""4;;/""4::.	 -,,,s   ABB0	cpuc                   \         P                  ! V P                  R R4      pV P                  4       ;_uu_ 4       pV P                  ! R/ VB  \
        P                  P                  V4      pRRR4       \        P                  ! X\        P                  ! 4       ^<,
          3^,          4       \        P                  ! V4      P                  pV P                  ! R/ XB  \        P                  ! V4      P                  pV P                  WE4       V P                  ! R/ VB  \        P                  ! V4      P                  pV P                  WE4       R#   + '       g   i     L; i)r  r   Nr{  )-f)r
   r  r4   r  r  r   r   r   r!   r^   timer"   rS   r}   r   )rE   r  r  pycpathrX   mtime2s   &     r    test_no_args_respects_force_flag5CommandLineTestsBase.test_no_args_respects_force_flagL  s     ))$..%D**,,#s#nn66u=G - 	499;r>+A-. ))3!**'%%!**E* -,s   2EE&	c                B   \         P                  ! V P                  R R4       V P                  4       ;_uu_ 4       pV P                  ! R/ VB pRRR4       V P                  RX4       V P                  ! R/ XB pV P                  RV4       R#   + '       g   i     LH; i)r  r   Ns   Listing r{  )-q)r
   r  r4   r  r  r  r7  )rE   r  noisyrv   s   &   r    test_no_args_respects_quiet_flag5CommandLineTestsBase.test_no_args_respects_quiet_flag_  s{    !!$..%<**,,$$+s+E -k5)  --e,	 -,s   BB	normalpycr   z	opt-1.pyc-Odoubleoptimizez	opt-2.pycz-OOc                   a \         P                  ! VR RRV P                  .,           !   V P                  \        P
                  P                  V P                  4      4       \        V3R lR 4       4      pV P                  \        \        P                  ! V P                  4      4      V4       T P                  \        P                  ! V P                  4       Uu. uF  pVP                  S4      '       g   K  VNK   	  up4       R# u upi )r  rg   r  c              3   x   <"   T F/  pVP                  \        P                  P                  S4      x  K1  	  R # 5ir   )formatr5  implementation	cache_tag).0baseexts   & r   	<genexpr>)CommandLineTestsBase.f.<locals>.<genexpr>t  s3      K*I$ #kk#*<*<*F*FLL*Is   7:N)z__init__.{}.{}z	bar.{}.{})r
   r  r  rf   r!   r8   r   r  sortedr}   listdirr   endswith)rE   r  switchexpectedr   s   &f&  r   fCommandLineTestsBase.fo  s    **V|T4;;7.8 : OOBGGNN4+?+?@A K*IK KHVBJJt/C/C$DExP2::dkk+B 3+BR!#S!1 !b+B 3 4 3s   D<Dtest_pep3147_paths_c                <   V P                  R RV P                  4       V P                  \        P                  P                  V P                  4      4       \        . RO4      pV P                  \        \        P                  ! V P                  4      4      V4       R# )z-br  N)__init__.pyz__init__.pyczbar.pyzbar.pyc)
r  r  r   r!   r8   r   r  r  r}   r  )rE   r  s   & r   test_legacy_paths&CommandLineTestsBase.test_legacy_paths|  sl     	tT[[1(<(<=> & '

4;; 78(Cr   c                b   V P                  R V P                  4       V P                  \        P                  P                  V P                  4      4       \        P                  P                  V P                  R4      pV P                  \        P                  P                  V4      4       V P                  R V P                  4       V P                  \        P                  P                  V P                  4      4       V P                  \        P                  P                  V4      4       R# )r  r   N)	r  r  rf   r!   r8   r   r  r9   r   )rE   cachecachedirs   & r   test_multiple_runs'CommandLineTestsBase.test_multiple_runs  s     	t{{+t';';<=T%9%9=I67t{{+t';';<=67r   c                x   V P                  R V P                  4       \        P                  P	                  V P
                  4      p\        P                  ! V\        P                  ! 4       ^<,
          3^,          4       \        P                  ! V4      P                  pV P                  R V P                  4       \        P                  ! V4      P                  pV P                  W#4       V P                  R RV P                  4       \        P                  ! V4      P                  pV P                  W#4       R# )r  r  N)r  r  r   r   r   r  r!   r^   r  r"   rS   r}   r   )rE   r  rX   r  s   &   r   
test_forceCommandLineTestsBase.test_force  s    t{{+..224::>
499;r>+A-. ))t{{+!**'tT[[1!**E*r   c                V   \         P                  P                  V P                  R 4      p\         P                  ! V4       \
        P                  ! VRR4      p\
        P                  ! VRR4      pV P                  RRV P                  4       V P                  V4       V P                  \         P                  P                  \         P                  P                  VR4      4      4       V P                  RV P                  4       V P                  V4       V P                  V4       R# )spamr  r   hamr  z-lr   N)r!   r8   r9   r  rB   r
   r  r  r  r   r   r  )rE   
subpackage	subinitfnhamfns   &   r   test_recursion_control+CommandLineTestsBase.test_recursion_control  s    WW\\$++v6

!--j*bI	))*eR@tT[[1y)Z(OPQt{{+I&E"r   c                   \         P                  P                  V P                  R 4      p\         P                  P                  VR4      p\         P                  P                  VR4      pWV3 F  p\        P
                  ! V4       K  	  \         P                  P                  VR4      p\        P                  ! VRR4      p\        P                  ! VR R4      p\        P                  ! VRR4      pV P                  RRV P                  4       V P                  V4       V P                  \         P                  P                  \         P                  P                  VR4      4      4       V P                  RR	V P                  4       V P                  V4       V P                  V4       V P                  V4       V P                  RR
V P                  4       V P                  V4       V P                  V4       V P                  V4       V P                  V4       V P                  RRV P                  4       V P                  V4       V P                  V4       V P                  V4       V P                  V4       R# )r  r  eggsr  r   eggr  z-r 0r   z-r 1z-r 2z-r 5N)r!   r8   r9   r  r
   make_pkgr  r  r  r   r   r  )	rE   r  subpackage2subpackage3pkgr  r  spamfneggfns	   &        r   test_recursion_limit)CommandLineTestsBase.test_recursion_limit  s   WW\\$++v6
ggll:u5ggll;7[9C""3' : GGLL];	))*eR@**;C))+ubAvt{{3y)GGNN277<<
MBC	E 	vt{{3I&E"v&vt{{3I&E"F#u%vt{{3I&E"F#E"r   c           	     
   \         P                  P                  V P                  R 4      p\        P
                  ! V4       \         P                  ! R\         P                  P                  VR4      4       \         P                  ! R\         P                  P                  VR4      4       V P                  RV P                  4       V P                  \         P                  P                  V P                  R RRR4      4       R# )r  .evilevil2r  r  N)	r!   r8   r9   r  r
   r  ra  r  r  )rE   r   s   & r   test_symlink_loop&CommandLineTestsBase.test_symlink_loop  s    
 ggll4;;/s#


3S&12


3S'23t{{+BGGLLKK-
 	r   c                    V P                  V P                  4      pV P                  R V P                  4      pV P                  RV4       V P                  RV4       R# )r  r   N)r  r  r   r}   )rE   r  rv   s   &  r   
test_quietCommandLineTestsBase.test_quiet  sL      -  t{{3C'e$r   c                   \         P                  ! V P                  R R4       V P                  RV P                  4      w  rpV P                  RV P                  4      w  rpV P	                  RV4       V P                  RV4       R# )crunchyfrog
bad(syntaxr  z-qqr   N)r
   r  r  r  r   r}   )rE   r  rv   silents   &   r   test_silent CommandLineTestsBase.test_silent  sl    !!$++}lK))$<!**5$++>1C'f%r   c                    V P                  R RRV P                  4       V P                  V P                  4       V P	                  V P
                  4       R# )r  z-xz
ba[^\\/]*$N)r  r  r  r  r  r  ri   s   &r   test_regexp CommandLineTestsBase.test_regexp  s>    t]DKK@tzz*DKK(r   c                   \         P                  P                  V P                  R 4      p\         P                  ! V4       \
        P                  ! VRR4      p\
        P                  ! VRR4      pV P                  RV P                  V4       V P                  V P                  4       V P                  V P                  4       V P                  V4       V P                  V4       R# )foo2r  r   bar2r  N)r!   r8   r9   r4   rB   r
   r  r  r  r  r  r  )rE   pkgdir2init2fnbar2fns   &   r   test_multiple_dirs'CommandLineTestsBase.test_multiple_dirs  s    '',,t~~v6
++GZD**7FB?t{{G4DKK(DJJ'G$F#r   c                    \         P                  ! V P                  R R4       V P                  RRRV P                  4      w  rpV P	                  VR4       R# )r  r  r  -ddinsdale   File "dinsdaleN)r
   r  r  r  r   rE   r8  r9  r  s   &   r   test_d_compile_error)CommandLineTestsBase.test_d_compile_error  sG    !!$++}lK**4z4;;O/0r   c                   \         P                  ! V P                  R R4      pV P                  RRRV P                  4       \         P                  ! V P                  RR4      p\        P
                  P                  V4      p\        P                  ! V\        P                  P                  V P                  R4      4       \        P                  ! V4       \         P                  ! VRR	7      w  rEpV P                  VR
4       R# )r  zraise Exceptionr  r   r!  bingz
import bazzbaz.pycF)
__isolatedr"  N)r
   r  r  r  r   r   r   r!   renamer8   r9   remover	  r   )rE   r  r   r  r8  r9  r  s   &      r   test_d_runtime_error)CommandLineTestsBase.test_d_runtime_error  s    ))$++u>OPtZ=&&t{{FLInn..u5
		#rww||DKK;<
		%$::2%P/0r   c                   V P                  R \        P                  P                  V P                  R4      V P
                  4      w  rpV P                  VR4       V P                  VR4       V P                  \        P                  P                  \        P                  P                  V P                  4      4      4       R# )-i
nosuchfiles   rror.*nosuchfiles	   TracebackN)r  r!   r8   r9   r4   r  r   assertNotRegexr   r   r   r   r   r  r#  s   &   r   test_include_bad_file*CommandLineTestsBase.test_include_bad_file  s    **"'',,t~~|<dkkK12C.	(H(H,0,@,@)B C 	Dr   c                    \         P                  ! V P                  R R4      p\         P                  ! V P                  RR4      p\         P                  ! V P                  RR4      p\         P                  ! V P                  RR4      p\        \        P
                  P                  V P                  R4      RRR7      ;_uu_ 4       pVP                  \        P
                  P                  V P                  R	4      \        P                  ,           4       VP                  \        P
                  P                  V P                  R
4      \        P                  ,           4       RRR4       V P                  R\        P
                  P                  V P                  R4      V4       V P                  V4       V P                  V4       V P                  V4       V P                  V4       R#   + '       g   i     L; i)f1r   f2f3f4l1r-   r.   r/   f1.pyf2.pyNr.  )r
   r  r  r<   r!   r8   r9   r4   r=   linesepr  r  r  rE   r4  r5  r6  r7  r8  s   &     r   test_include_file_with_arg/CommandLineTestsBase.test_include_file_with_arg  sF   &&t{{D"=&&t{{D"=&&t{{D"=&&t{{D"="'',,t~~t4cGLLPRHHRWW\\$++w7

BCHHRWW\\$++w7

BC M 	rww||DNNDA2FBBr"B MLs   BG--G=	c                b   \         P                  ! V P                  R R4      p\         P                  ! V P                  RR4      p\         P                  ! V P                  RR4      p\         P                  ! V P                  RR4      p\        \        P
                  P                  V P                  R4      RRR7      ;_uu_ 4       pVP                  \        P
                  P                  V P                  R	4      \        P                  ,           4       R
R
R
4       V P                  R\        P
                  P                  V P                  R4      4       V P                  V4       V P                  V4       V P                  V4       V P                  V4       R
#   + '       g   i     L; i)r4  r   r5  r6  r7  r8  r-   r.   r/   r:  Nr.  )r
   r  r  r<   r!   r8   r9   r4   r=   r;  r  r  r  r<  s   &     r   test_include_file_no_arg-CommandLineTestsBase.test_include_file_no_arg"  s   &&t{{D"=&&t{{D"=&&t{{D"=&&t{{D"="'',,t~~t4cGLLPRHHRWW\\$++w7

BC Mrww||DNNDABr"Br"r" MLs   AFF.	c                   \         P                  ! V P                  R R4      p\         P                  ! V P                  RR4      p\         P                  ! V P                  RR4      p\         P                  ! V P                  RR4      p\         P                  ! V P	                  R	4      RR.,           !  pVP
                  P                  V\        P                  ,           P                  R4      4       \         P                  ! V4       V P                  V4       V P                  V4       V P                  V4       V P                  V4       R# )
r4  r   r5  r6  r7  r.  -r  Nr{  )r
   r  r  spawn_pythonr  stdinr=   r!   r;  encodekill_pythonr  r  )rE   r4  r5  r6  r7  ps   &     r   test_include_on_stdin*CommandLineTestsBase.test_include_on_stdin/  s    &&t{{D"=&&t{{D"=&&t{{D"=&&t{{D"=&&););B)?4+)MO	r"**},,W56!!!$r"r"Br"r   c                P   \         P                  ! V P                  R R4      pV P                  RV P                  WP
                  4      w  r#pV P                  VR4       V P                  V4       V P                  V P                  4       V P                  V P
                  4       R# )r'  zsyntax(errorr/  s   rrorN)	r
   r  r  r  r  r  r   r  r  )rE   bingfnr8  r9  r  s   &    r   !test_compiles_as_much_as_possible6CommandLineTestsBase.test_compiles_as_much_as_possible<  s    **4;;O**<+1::?g&v&DKK(DJJ'r   c                L    V P                  R 4      pV P                  VR4       R# )badfilenames   Can't list 'badfilename'N)r  r   )rE   r9  s   & r   !test_invalid_arg_produces_message6CommandLineTestsBase.test_invalid_arg_produces_messageE  s#    }-9:r   c                   \         P                  ! V P                  R R4       \        P                  P                  \        P                  P                  V P                  R4      4      pV P                  RV P                  4       \        VR4      ;_uu_ 4       pVP                  4       pRRR4       V P                  \        P                  XR,          R4      ^4       V P                  RV P                  4       \        VR4      ;_uu_ 4       pVP                  4       pRRR4       V P                  \        P                  VR,          R4      ^4       R#   + '       g   i     L; i  + '       g   i     LR; i)	r4  r   r9  z --invalidation-mode=checked-hashrN   N:      Nlittlez"--invalidation-mode=unchecked-hash)r
   r  r  r   r   r   r!   r8   r9   r  r<   rQ   r}   rR   
from_bytes)rE   r  fprW   s   &   r   test_pyc_invalidation_mode/CommandLineTestsBase.test_pyc_invalidation_modeI  s    !!$++tR8nn..GGLLg.0;T[[I#t__779D S	8<dC=t{{K#t__779D S	8<dC _ _s   EE+E(	+E;	r   c                   \         P                  ! V P                  R R4      p. p\        ^4       F  p\        P
                  P                  V P                  RP                  V4      4      p\        P                  ! V4       \         P                  ! VRR4      pVP                  \         P                  ! VR R4      4       K  	  V P                  V P                  RR4       V P                  V4       V F  pV P                  V4       K  	  R# )r  r   zfoo{}r  z-j0N)r
   r  r4   r   r!   r8   r9   r  rB   r  r  r  )rE   r  filessuffixr  r   rF   s   &      r   test_workers!CommandLineTestsBase.test_workersV  s    **4>>62FAhFWW\\$..'..2HIFHHV**6:rBBLL22662FG	  	s3F#D% r   zcompileall.compile_dirc                j   \         P                  ! R \        P                  V P                  R.R7      ;_uu_ 4        \
        P                  ! 4        V P                  VP                  4       V P                  VP                  R,          R,          ^ 4       RRR4       R#   + '       g   i     R# ; i)zsys.argvz-j0r   r   Nr   )r   rs  r5  
executabler4   rg   mainrf   r   r}   r   )rE   r   s   &&r   test_workers_available_cores1CommandLineTestsBase.test_workers_available_corese  s~    ZZ
 ^^T^^UCE EOOOOK../[2226yA1E	E E E Es   AB!!B2	c                   . R	Op\         P                  P                  ! V P                  .VO5!  p\         P                  ! V4       \
        P                  ! VR R4      p\        P                  P                  V4      p\         P                  P                  ! V P                  .VR,          O5!  pRpV P                  RVRWb4       \
        P                  ! V4      w  rxp	\         P                  P                  ! V.VR,          O5!  p
V P                  V
\        V	\        P                  ! 4       R7      4       V P!                  V\        V	\        P                  ! 4       R7      4       R# )
r   r+  r,  rB  z-sz-pr.  r/   Nr/  )r!   r8   r9   r4   r3  r
   r  r   r   r   r  r	  r  r4  r5  r6  r7  rF  s   &          r   rG  +CommandLineTestsBase.test_strip_and_prependm  s   4ww||DNN6X6
D**4A^^--f577<<>">
xz@$::2>ggll:==c4467	
 	c4467	
r   c           
     |   \         P                  P                  V P                  R 4      p\         P                  ! V4       \
        P                  ! VRR4      p. pR	 F3  pVP                  \        P                  P                  VVR7      4       K5  	  RR.RR.RR.. R
O.pV F  pV P                  ! V.R V 4       O5!   V F^  pV P                  \         P                  P                  V\        V4      ,          4      4        \         P                  ! W4,          4       K`  	  K  	  R#   \          d     Kv  i ; i)optimizationsrN  rO  r   r\  12c              3   F   "   T F  pR \        V4      ,           x  K  	  R# 5i)z-oN)r4  )r  ns   & r   r  ICommandLineTestsBase.test_multiple_optimization_levels.<locals>.<genexpr>  s     $LOqTCF]]Os   !NrP  )r\  rj  rk  )r!   r8   r9   r4   r3  r
   r  r  r   r   r   r  rf   r   rR   r   rQ  )rE   r8   r   r   rR  rS  rT  s   &      r   rU  6CommandLineTestsBase.test_multiple_optimization_levels  s   ww||DNNO<
D**4+>+24 $IIIinn66vDM 7 O P % "3Z!3Z!3Z,.  1OTM$LO$LM,	r#i./A BCIIbm, -  1 ! s   D,,D;:D;c                $   \         P                  P                  V P                  R RR4      p\         P                  P                  V P                  R RR4      p\         P                  P                  V P                  R RR4      p\         P                  ! V4       \         P                  ! V4       \         P                  ! V4       \
        P                  ! VRR4      p\
        P                  ! VRR4      p\         P                  P                  VR4      p\         P                  P                  VR	4      p\         P                  ! WF4       \         P                  ! WW4       \        P                  P                  V4      p\        P                  P                  V4      p	V P                  VR
V4       V P                  \         P                  P                  V4      4       V P                  \         P                  P                  V	4      4       R# )r   rX  rY  rZ  r[  r\  rO  r]  r^  r_  z-eN)r!   r8   r9   r4   r3  r
   r  ra  r   r   r   r  rf   r   r   rb  s
   &         r   rl  4CommandLineTestsBase.test_ignore_symlink_destination  s]    ww||DNNFE9MT^^VUJO'',,t~~vulS
L!
M"
O$ '22<QXY)55oGXZab'',,}6GHWW\\-9MN


>3


$9^^55oF
!889KLl;z2367r   c                @    V P                  V P                  R R4       R# )-o 1--hardlink-dupesN)r  r4   ri   s   &r   test_hardlink_bad_args+CommandLineTestsBase.test_hardlink_bad_args  s     	DNNF4FGr   c                   R EF  p\         P                  ! 4       ;_uu_ 4       pV P                  VR7      ;_uu_ 4        \        P                  ! VRR4      p\        V4      p. ROpV'       d   VP                  R4       V P                  ! V.VO5!   V P                  \        V^ ,          V^,          4      V4       V P                  \        V^,          V^,          4      V4       V P                  \        V^ ,          V^,          4      V4       RRR4       RRR4       EK"  	  R#   + '       g   i     L; i  + '       g   i     EKK  ; i)Tdedupr   rO  rt  N)TF)r  z-o 0rs  z-o 2)
r2   TemporaryDirectorysubTestr
   r  r   r  r  r}   r(   )rE   ry  r8   r   pycsr  s   &     r   test_hardlink"CommandLineTestsBase.test_hardlink  s     #E,,..$\\\..*66tXwOF#F+D9D$67$$T1D1$$[a$q'%BEJ$$[a$q'%BEJ$$[a$q'%BEJ / /. #.. /..s#   D<CD)D<)D94D<<E)r  r4   r  r  r  N)<rn  ro  rp  rq  r  rG   rb   contextmanagerr  r  r  r  r  r  r  r   r   requires_resourcer  r  namer  r  r  localsr  r  r  r  r  r	   rt  r	  r  r  r  r  r$  force_not_colorizedr+  r1  r=  r@  rI  rM  rQ  rY  r   rr  r_  r   rs  rd  rG  rU  rl  ru  r}  ru  rv  rw  s   @r   r  r    s     G , ,
.// u%+ & +" u%- &- 
5"	[4&)	;0c6
 F 
	4 23&-.!$D8 + +
# #D "" #%&)
	$1
   1 !1D ##(;D %'AB& C& 
ZZ()F *F
(. ""8 #80H
K Kr   r  c                       ] tR tRtRtR# )CommandLineTestsWithSourceEpochi  r{  Nr|  r{  r   r   r  r    r}  r   r  c                       ] tR tRtRtR# )CommandLineTestsNoSourceEpochi  r{  Nr|  r{  r   r   r  r    r}  r   r  c                      a  ] tR tRt o R t]P                  R 4       tRR ltRRRRRR	/R
 lt	R t
RR ltR tR tRR ltR tR tR tR tR tRtV tR# )HardlinkDedupTestsBasei  c                    R V n         R # r   r   ri   s   &r   rG   HardlinkDedupTestsBase.setUp  s	    	r   c              #     "   \         P                  ! 4       ;_uu_ 4       pWn        Vx  R V n        R R R 4       R #   + '       g   i     R # ; i5ir   )r2   rz  r8   )rE   r8   s   & r   temporary_directory*HardlinkDedupTestsBase.temporary_directory  s5     ((**dIJDI +***s   A<
AA		Ac                D    \         P                  ! V P                  W!4      # r   )r
   r  r8   )rE   coder  s   &&&r   r  "HardlinkDedupTestsBase.make_script  s    ((D??r   ry  Tr   ru   Fc               N    \         P                  ! V P                  R VWR7       R# )T)rv   r   hardlink_dupesru   N)rg   r   r8   )rE   ry  r   ru   s   &$$$r   r   "HardlinkDedupTestsBase.compile_dir  s    tyyx.3	Br   c                
   V P                  4       ;_uu_ 4        V P                  R 4       V P                  \        4      ;_uu_ 4        \        P
                  ! V P                  R^ RR7       RRR4       V P                  \        4      ;_uu_ 4        \        P
                  ! V P                  R^ ^ .RR7       RRR4       RRR4       R#   + '       g   i     Lf; i  + '       g   i     L-; i  + '       g   i     R# ; i)passT)rv   r   r  N)r  r  rJ  r   rg   r   r8   ri   s   &r   test_bad_args$HardlinkDedupTestsBase.test_bad_args  s     %%''V$"":..&&tyyq6:< / "":.. &&tyy1v6:< / ('.. /. (''s;   /C1%C	-%C1'C	9C1CC1C.)C11D	c                    . pV'       d   VP                  R 4       VP                  R4       V'       d   VP                  R4       RP                  V4      # )z'module docstring'zx = 1zassert x == 1
)r  r9   )rE   	docstring	assertionliness   &&& r   create_code"HardlinkDedupTestsBase.create_code  sA    LL-.WLL)yyr   c              #  b   "   R F$  pR F  pV P                  WR7      pW1V3x  K  	  K&  	  R# 5i)Fr  r  N)FT)r  )rE   r  r  r  s   &   r   
iter_codes!HardlinkDedupTestsBase.iter_codes  s7     &I*	'')'Q	22 + 's   -/c                d   V P                  4        F  w  rpV P                  W#R 7      ;_uu_ 4        V P                  4       ;_uu_ 4        V P                  V4      p\	        V4      pV P                  RR7       V P                  \        V^ ,          V^,          4      4       V P                  \        V^ ,          V^,          4      4       V P                  \        V^,          V^,          4      4       RRR4       RRR4       K  	  R#   + '       g   i     L; i  + '       g   i     EK  ; i)r  Frx  N)r  r{  r  r  r   r   r   r(   )rE   r  r  r  r   r|  s   &     r   test_disabled$HardlinkDedupTestsBase.test_disabled  s    *.//*;&DY	GG--//!--d3F#F+D$$5$1$$[a$q'%BC$$[a$q'%BC$$[a$q'%BC 0 HG +<// HGGs$   D
B*D
4D
DDD/c                T   \        V4      pV P                  \        V^ ,          V^,          4      V'       * 4       T P                  \        V^ ,          V^,          4      V'       * ;'       d    V'       * 4       V P                  \        V^,          V^,          4      V'       * 4       R# )r   N)r   r}   r(   )rE   r   r  r  r|  s   &&&& r   check_hardlinks&HardlinkDedupTestsBase.check_hardlinks  s    T!Wd1g6&	(T!Wd1g6&88y=	:T!Wd1g6&	(r   c           
     v   V P                  4        F}  w  rpV P                  W#R 7      ;_uu_ 4        V P                  4       ;_uu_ 4        V P                  V4      pV P	                  4        V P                  WBV4       RRR4       RRR4       K  	  R#   + '       g   i     L; i  + '       g   i     K  ; i)r  N)r  r{  r  r  r   r  )rE   r  r  r  r   s   &    r   r}  $HardlinkDedupTestsBase.test_hardlink"  s    *.//*;&DY	GG--//!--d3F$$&((IF 0 HG +<// HGGs#   B'
4B>B'B$B''B8c                   R F  pV P                  VR7      ;_uu_ 4        V P                  4       ;_uu_ 4        V P                  V P                  4       4      pV P	                  VR7       \        W!^ ,          4      p\        W!^,          4      pV P                  \        W44      4       RRR4       RRR4       K  	  R#   + '       g   i     L; i  + '       g   i     K  ; i)r   )optsr   N))r   r   )r   r   )r   r   )r{  r  r  r  r   r   rf   r(   )rE   r  r   pyc1pyc2s   &    r   test_only_two_levels+HardlinkDedupTestsBase.test_only_two_levels+  s    ,D4((--// "--d.>.>.@AF$$d$3"673D"673DOOK$;< 0 )( -// )((s#   CA0B?)C?C
CC#c                :   V P                  4       ;_uu_ 4        V P                  V P                  4       4      pV P                  . ROR7       \	        V^ 4      p\	        V^4      pV P                  \        W#4      4       RRR4       R#   + '       g   i     R# ; i)r   r  N)r   r   r   r   )r  r  r  r   r   rf   r(   )rE   r   r  r  s   &   r   test_duplicated_levels-HardlinkDedupTestsBase.test_duplicated_levels8  sw     %%'' %%d&6&6&89Fl361%D61%DOOK34 ('''s   A&B		B	c           
        V P                  4       ;_uu_ 4        V P                  R 4      pV P                  4        V P                  V4       \	        V4      p\
        P                  ! V^ ,          4      P                  pV P                  R4      pV P                  ^ ^.RR7       V P                  V\
        P                  ! V^,          4      P                  4       V P                  \        V^ ,          V^,          4      4       V P                  V\
        P                  ! V^,          4      P                  4       V P                  \        P                  ! V^,          V^,          RR7      4       RRR4       R#   + '       g   i     R# ; i)rO  print(0)T)r   ru   shallowN)r  r  r   r  r   r!   r"   r#   r}   rf   r(   r   r   filecmpcmprE   r   r|  inodes   &   r   test_recompilation)HardlinkDedupTestsBase.test_recompilationD  s    %%''%%g.F  (F#DGGDG$++E %%j1F q!fD9 UBGGDG$4$;$;<OOKQa9:rwwtAw'7'>'>?W[[a$q'4HI) ('''s   EE;;F	c           
     b   V P                  4       ;_uu_ 4        V P                  V P                  4       R R7      pV P                  4        V P	                  V4       \        V4      p\        P                  ! V^ ,          4      P                  pV P                  RR R7      p\        P                  ! RRRRV P                  R7       V P                  V\        P                  ! V^ ,          4      P                  4       V P                  V\        P                  ! V^,          4      P                  4       V P                  \        V^,          V^,          4      4       V P                  \        P                   ! V^,          V^,          RR	7      4       R
R
R
4       R
#   + '       g   i     R
# ; i)module)r  r  r  z-czimport moduleF)r(  r  Tr  N)r  r  r  r   r  r   r!   r"   r#   r
   r  r8   r}   r   r(   r  r  r  s   &   r   test_import"HardlinkDedupTestsBase.test_import]  s:    %%''%%d&6&6&8x%HF  (F#DGGDG$++E %%jx%@F **dO$))
 UBGGDG$4$;$;<UBGGDG$4$;$;<[a$q':;W[[a$q'4HI- ('''s   E:FF.	r   N)r   r   )FF)rn  ro  rp  rq  rG   rb   r  r  r  r   r  r  r  r  r  r}  r  r  r  r  ru  rv  rw  s   @r   r  r    s       @B4 B) B5 B< 3
D(G=
5J2J Jr   r  c                       ] tR tRtRtR# )!HardlinkDedupTestsWithSourceEpochiy  r{  Nr|  r{  r   r   r  r  y  r}  r   r  c                       ] tR tRtRtR# )HardlinkDedupTestsNoSourceEpochi  r{  Nr|  r{  r   r   r  r    r}  r   r  __main__)8rg   rb   r  importlib.utilr   rd   r!   r{   r6   rT   r5  r2   test.test_importlib.utilr   r  ry   r   r   multiprocessing.utilr   r  concurrent.futuresr   concurrent.futures.processr   rr  NotImplementedErrorModuleNotFoundErrorr   test.supportr	   r
   test.test_py_compiler   r   test.support.os_helperr   r   r   r(   r*   TestCaserz  r  skipIfis_wasir  r  r  r  skip_unless_hardlinkr  r  r  rn  rc  r{  r   r   <module>r     s       	 	    
     %	" U6?   " & : 8 +F7g8 g8T	%8%-%6%6/F7;		(;(0(9(92I:?	 
"DE48$$ 4 F4:{K {K|	&:'/'8'81H9=		$8%-%6%6/F7<	 ZJ ZJ  ZJz	(>(0(9(92I:>		&<&.&7&70G8=	 zMMO ]# 	01 "!"s   F F-,F-