python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_compileall.cpython-312.opt-1.pyc

͑elddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
ZddlZddlZddlmZmZ	ddlmZddlmZddlmZedZddlmZdd	lmZdd
lm Z ddl!m"Z"ddl!m#Z#d
Z$dZ%dZ&GddZ'Gdde'ejPe#dZ)Gdde'ejPe#dZ*ejVejXdGddejPZ-GddZ.Gdde.ejPe#dZ/Gdde.ejPe#dZ0ej$e1ed d!Gd"d#Z2Gd$d%e2ejPe#dZ3Gd&d'e2ejPe#dZ4e5d(k(rejlyy#eef$rdZYQwxYw))N)mock
skipUnless)_cleanup_tests)ProcessPoolExecutor)_check_system_limitsTF)support)	os_helper)
script_helper)without_source_date_epoch)SourceDateEpochTestMetacL|sd}tjj||S)Noptimization)	importlibutilcache_from_sourcescriptopts  H/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_compileall.pyget_pycr$s$>>++F+EEc@dDcgc]}t||c}Scc}w)Nr)rrs  rget_pycsr+s,56SGFC 666sctj|j}tj|j}||k(S)z8Returns True if two files have the same inode (hardlink))osstatst_ino)	filename1	filename2inode1inode2s    ris_hardlinkr'/s5
WWY

&
&F
WWY

&
&FVrceZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZdZdZdZdZdZdZeedej4ddZdZeedej4ddZeedej4dej4ddZeedej4ddej4ddZdZ d d!d"Z!d#Z"eedd$Z#d%Z$eedd&Z%d'Z&d(Z'd)Z(d*Z)d+Z*e+jXd,Z-y)-CompileallTestsBasectj|_|jtj
|jtjj|jd|_	tjj|j|_
t|jdd5}|jddddtjj|jd|_tjj|j |_t	j$|j|j tjj|jd|_t
j(|j&tjj|j&d|_t	j$|j|j*y#1swY9xYw)	N_test.pywutf-8encodingzx = 123
z	_test2.py_subdirz	_test3.py)tempfilemkdtemp	directory
addCleanupshutilrmtreer pathjoinsource_pathrrrbc_pathopenwritesource_path2bc_path2copyfilesubdirectorymkdirsource_path3selffiles  rsetUpzCompileallTestsBase.setUp8sI!))+

t~~677<<
C ~~778H8HI
$""C'
:	$dJJ{#	$GGLLE!889J9JK
(($*;*;<GGLLC
""#GGLL):):KH(($*;*;<	$	$s9HHctjj|jd|_t|jdd5}|j
ddddy#1swYyxYw)Nz_test_bad.pyr,r-r.zx (
)r r7r8r3bad_source_pathr;r<rCs  radd_bad_source_filez'CompileallTestsBase.add_bad_source_fileHsR!ww||DNNNK
$&&g
>	 $JJw	 	 	 sA##A,cLt|jd5}|jd}dddtt	j
|jj}tjdtjjd|dz}|fS#1swYrxYw)Nrb<4sLLr)
r;r:readintr r!r9st_mtimestructpackrrMAGIC_NUMBER)rDrEdatamtimecompares     rtimestamp_metadataz&CompileallTestsBase.timestamp_metadataMs
$,,
%	!99R=D	!BGGD,,-667++gy~~'B'BA#k13W}	!	!sBB#cf	tj|jdt
jtj5|jtj|jdddy#ttf$r|jdYwxYw#1swYyxYw)N)rNrNz0filesystem doesn't support timestamps near 2**32
r utimer9
OverflowErrorOSErrorskipTest
contextlibredirect_stdoutioStringIO
assertTrue
compileallcompile_filerDs r test_year_2038_mtime_compilationz4CompileallTestsBase.test_year_2038_mtime_compilationUs	NHHT%%'=>
'
'

6	GOOJ33D4D4DEF	G	Gw'	NMMLM	N	G	G B	/B' B$#B$'B0cf	tj|jdt
jtj5|jtj|jdddy#ttf$r|jdYwxYw#1swYyxYw)N) rjz+filesystem doesn't support large timestampsrZrfs rtest_larger_than_32_bit_timesz1CompileallTestsBase.test_larger_than_32_bit_times_s	IHHT%%~6
'
'

6	GOOJ33D4D4DEF	G	Gw'	IMMGH	I	G	Grhctjjdrtjdtj|j|j|jt|jd5}|jt|d}dddt|jd5}|j||jddd|j|jt!j"|j$dd|j&|jy#1swYxYw#1swYrxYw)	zOCheck that compileall recreates bytecode when the new metadata is
        used.SOURCE_DATE_EPOCHzSOURCE_DATE_EPOCH is setrKNwbFTforcequiet)r environgetunittestSkipTest
py_compilecompiler9assertEqualrXr;r:rOlenr<assertNotEqualrdcompile_dirr3rc)rDmetadatarEbcs    rrecreation_checkz$CompileallTestsBase.recreation_checkis::>>-.##$>??4++,$1134
$,,
%	-S]^,B	-
$,,
%	JJx JJrN		T4467t~~U$G0023	-	-		sE
#E
EEc|jtjdtjj
ddy)NrMrr)r~rRrSrrrTrfs r
test_mtimezCompileallTestsBase.test_mtimeys.fkk'9>>3N3N*+Q0	1rc&|jdy)Ns)r~rfs rtest_magic_numberz%CompileallTestsBase.test_magic_number~sk*rcj|j|jfD]}	tj||j	tj|jdd|j	tjj|jxr*tjj|jtj|j|j	tj|jdd|j	tjj|jxr)tjj|jtj|jtj|j|j|jtj|jdd|jtj|jddy#YxYw)NFTror)r:r>r unlinkrcrdrer9r7isfiler{r3rIassertFalserH)rDfns  rtest_compile_filesz&CompileallTestsBase.test_compile_filess<</	B
		"
	
	

//0@0@6;4I	Jt||4:GGNN4==99	;
		$,,
..t~~U59;	<t||46t}}5	7
		$,,
		$--   "001E1E7<AG	H//6;1F	G#
sH--H2c|jtjj|jtj5}|jtjtj|jddd|jjd|jtjj|jy#1swYbxYw)Nz&Compiling ([^WindowsPath|PosixPath].*))rr r7rr:rcaptured_stdoutrcrdrepathlibPathr9assertRegexgetvalue)rDstdouts  rtest_compile_file_pathlikez.CompileallTestsBase.test_compile_file_pathlikes56

$
$
&	U&OOJ33GLLAQAQ4RST	U*,UVt||45	U	Us

AC00C9c|jtjj|j|jt
jtj|jtjdd|jtjj|jy)N	ddir_pathr)ddirrqrr r7rr:rcrdrerrr9rfs rtest_compile_file_pathlike_ddirz3CompileallTestsBase.test_compile_file_pathlike_ddirsy56
//T=M=M0N5<\\+5N679	:	
t||45rc|jtjj|j|jt
jtj|jtjdd|jtjj|jyN
stripdir_pathr)stripdirrqrrfs r#test_compile_file_pathlike_stripdirz7CompileallTestsBase.test_compile_file_pathlike_stripdirsy56
//T=M=M0N9@o9V679	:	
t||45rc|jtjj|j|jt
jtj|jtjdd|jtjj|jyNprependdir_pathr)
prependdirrqrrfs r%test_compile_file_pathlike_prependdirz9CompileallTestsBase.test_compile_file_pathlike_prependdirsz56
//T=M=M0N;B<<HY;Z679	:	
t||45rctjjj|jg5|jt
jddddtjjj|jg5|j|jt
jddddddy#1swYxYw#1swYyxYw)Nr7rrqFT)skip_curdirrprq)
testtest_importlibrimport_stater3rcrdcompile_pathrIrrfs rtest_compile_pathz%CompileallTestsBase.test_compile_paths

 
 
%
%
2
28H
2
I	>OOJ33!<=	>
 
 
%
%
2
28H
2
I	K$$&Z44;?qJ
K	K	K	>	>	K	Ks&C8C&C#&C/ctjj|jd}tjj|d}tj|t|d5	dddt
j||jtjjtjj|dy#1swYkxYw)NrUrErn__pycache__)
r r7r8r3rAr;rdrerexists)rDdata_dir	data_files   rtest_no_pycache_in_non_packagez2CompileallTestsBase.test_no_pycache_in_non_packages77<<7GGLL62	

)T
"			*X}(MNO		s,CC!c|jtjtj5|jt
j|jdddy#1swYyxYwN)	rIr_r`rarbrrdrerHrfs r#test_compile_file_encoding_fallbackz7CompileallTestsBase.test_compile_file_encoding_fallbacksZ  "

'
'

6	LZ44T5I5IJK	L	L	Ls/A00A9chd\}}tj|jd|tjj|j|}|jtjj|tjj|j|}|jtjj|tjj|j|}|jtjj|y)N)rrTrqoptimizer)
rdr{r3rrrr9rcr r7rr=rB)rDrrcachedcached2cached3s      r
test_optimizez!CompileallTestsBase.test_optimizes29
#t~~THM11$2B2B?B2Dv./..2243D3D@C3Ew/0..2243D3D@C3Ew/0rc|jtjj|jtj5}tjtj|jdddjjd}|j|d|jtjj|jy#1swYuxYw)Nrz$Listing ([^WindowsPath|PosixPath].*))rr r7rr:rrrdr{rrr3r
splitlinesrrc)rDrlines   rtest_compile_dir_pathlikez-CompileallTestsBase.test_compile_dir_pathlikes56

$
$
&	A&""7<<#?@	A ++-a0FGt||45		A	As
3C44C=c|jtjj|j|jt
jtj|jtjdd|jtjj|jyrrr r7rr:rcrdr{rrr3rfs r"test_compile_dir_pathlike_stripdirz6CompileallTestsBase.test_compile_dir_pathlike_stripdirsw56
..w||DNN/K8?_8U568	9	
t||45rc|jtjj|j|jt
jtj|jtjdd|jtjj|jyrrrfs r$test_compile_dir_pathlike_prependdirz8CompileallTestsBase.test_compile_dir_pathlike_prependdirsx56
..w||DNN/K:A,,GX:Y568	9	
t||45rrequires multiprocessingz&concurrent.futures.ProcessPoolExecutorc~tj|jdd|j|jyNTrqworkersrdr{r3rccalledrD	pool_mocks  rtest_compile_pool_calledz,CompileallTestsBase.test_compile_pool_calleds,	t~~T1E	(()rc|jtd5tj|jddddy#1swYyxYw)Nz%workers must be greater or equal to 0)r)assertRaisesRegex
ValueErrorrdr{r3rfs r!test_compile_workers_non_positivez5CompileallTestsBase.test_compile_workers_non_positives?

#
#J$KM	?""4>>2>	?	?	?s"AActj|jdd|j|jdddy)NTrrrmax_workers)rdr{r3rx	call_argsrs  rtest_compile_workers_cpu_countz2CompileallTestsBase.test_compile_workers_cpu_counts:	t~~T1E,,Q/
>Erzcompileall.compile_filectj|jd|j|j|j|jy)NTr)rdr{r3rrrc)rDcompile_file_mockrs   rtest_compile_one_workerz+CompileallTestsBase.test_compile_one_workers?	t~~T:))*)001rNnewc~tj|jdd|j|jyrr)rDrs  r$test_compile_missing_multiprocessingz8CompileallTestsBase.test_compile_missing_multiprocessings-	t~~T1E)001rcd}|j}td|dzD]z}tjj	|d|}tjj	|d}tj
|t
j|j||tjj}tj|jd|dz
|jtjj|tj|jd||j!tjj|y)Nrdir_z	script.pyT)rq	maxlevels)r3ranger r7r8rAr5r?r9rrrrdr{rrrc)rDdepthr7isourcepyc_filenames      rtest_compile_dir_maxlevelsz.CompileallTestsBase.test_compile_dir_maxlevelss~~q%!)$	6A77<<QCj1DWW\\$4FHHTNOOD,,f5		6
!~~77?t~~TUQYO56t~~TUK|45rT)parallelcddg}|j}g}|D]t}tjj||}tj|tj|dd|jtj|ddv|r|jttj|jd||rdnd	
|j||D]}|j|j|j|tjj!|}|t#|jtj$zd}	tj&|\}
}
}tjj||	}t(j*jj-|}
|j/|
j0||j3d|dtj4| y)
z@Recursive compile_dir ddir must contain package paths; bpo39769.rfoo__init__rmodzdef fn(): 1/0
fn()
Trr)rqrrN")r3r r7r8rAr
make_scriptappendr4multiprocessing_cleanup_testsrdr{rc
startswithrrrrysepassert_python_failurerrget_code_from_pycrxco_filenameassertInfsdecode)rDrrfullpathr7modssubdirrmodcodemodpath_errexpected_inmod_code_objs              r_test_ddir_onlyz#CompileallTestsBase._test_ddir_only+sE?~~	LF77<<f-DHHTN%%dJ;KK
11$2IK
L		LOO9:d%1	.	
	@COOCNN4>>:C@nn66s;G#dnnRVV3456G%;;GDIAq#'',,tW5K..33EEgNL\55{CMMAk]!,bkk#.>?	@rc(|jddS)=Recursive compile_dir ddir= contains package paths; bpo39769.
<a prefix>Frrrrfs rtest_ddir_only_one_workerz-CompileallTestsBase.test_ddir_only_one_workerHs###FFrc(|jddS)rrTrrrfs rtest_ddir_multiple_workersz.CompileallTestsBase.test_ddir_multiple_workersLs###EErc(|jddS)?Recursive compile_dir ddir='' contains package paths; bpo39769.rFrrrfs rtest_ddir_empty_only_one_workerz3CompileallTestsBase.test_ddir_empty_only_one_workerQs##e#<<rc(|jddS)r
rTrrrfs r test_ddir_empty_multiple_workersz4CompileallTestsBase.test_ddir_empty_multiple_workersUs##d#;;rcgd}tjj|jg|}tj|tj|dd}tjj|}tjj|jg|dd}tj|d|tj|\}}}tjj|dd}	|j|	t|tj |j#|t|tj y)Nrbuildrealr7r1 / 0rT)rqrr.r r7r8r3makedirsr
rrrrrdr{rrstrsysgetdefaultencodingassertNotIn)
rDrr7rr}rrcoutrrs
          rtest_strip_onlyz#CompileallTestsBase.test_strip_onlyZs4ww||DNN6X6
D**4A
^^
-
-f
577<<>"1>t4(C$::2>CggllHQRL1

c4467	
	
c4467	
rcgd}tjj|jg|}tj|tj|dd}tjj|}d}tj|d|tj|\}}}tjj||jg|}	|j|	t|tj y)Nrrr/fooT)rqrr.)r r7r8r3rr
rrrrrdr{rrrrr)
rDrr7rr}rrrrrs
          rtest_prepend_onlyz%CompileallTestsBase.test_prepend_onlyms4ww||DNN6X6
D**4A
^^
-
-f
5
t4JG$::2>Cggll:t~~II

c4467	
rcgd}tjj|jg|}tj|tj|dd}tjj|}tjj|jg|dd}d}tj|d||tj|\}}}	tjj|g|dd}
|j|
t|	tj |j#|t|	tj y)	NrrrrrT)rqrrr.rrDrr7rr}rrrrrrs           rtest_strip_and_prependz*CompileallTestsBase.test_strip_and_prepend|s4ww||DNN6X6
D**4A
^^
-
-f
577<<>"1>
t4(0Z	I$::2>Cggll:==

c4467	
	
c4467	
rc@gd}tjj|jg|}tj|tj|dd|jt5tj|dddddddy#1swYyxYw)N)rrrr7rrrTz/barr)rqrrr)r r7r8r3rr
rassertRaisesrrdr{)rDrr7s   rtest_strip_prepend_and_ddirz/CompileallTestsBase.test_strip_prepend_and_ddirs<ww||DNN6X6
D!!$8


z
*	G""4t&,2v
G	G	G	Gs0BBctj|jdd}g}dD]2}|jtj
j
||4ddgddgddggdg}|D]k}tj|d	|
|D]L}|jtjj||	tj||Nmy#t$rY]wxYw)Ntest_optimizationa = 0rrrrrrrrrTr)r
rr3rrrrrdrercr r7rr	Exception)rDrr}	opt_leveltest_combinationsopt_combinations      r!test_multiple_optimization_levelsz5CompileallTestsBase.test_multiple_optimization_levelss**4>>+>+24$	PIIIinn66vDM7O
P	P VaVaVY?0	O##F$-<
>,
	r)} =>IIbm,
	!s=C	C&%C&c"tjj|jddd}tjj|jddd}tjj|jddd}tj|tj|tj|tj|dd}tj|dd}tjj|d	}tjj|d
}tj||tj||tjj|}tjj|}	tj|d||jtjj||jtjj|	y)
Nrdirallowedsymlinks
prohibitedtest_allowedr'test_prohibitedtest_allowed.pytest_prohibited.pyT)rq
limit_sl_dest)r r7r8r3rr
rsymlinkrrrrdr{rcrr
rDallowed_path
symlinks_pathprohibited_pathallowed_scriptprohibited_scriptallowed_symlinkprohibited_symlink
allowed_bc
prohibited_bcs
          rtest_ignore_symlink_destinationz3CompileallTestsBase.test_ignore_symlink_destinationsbww||DNNFE9MT^^VUJO
'',,t~~vulS
L!
M"
O$'22<QXY)55oGXZab'',,}6GHWW\\-9MN


>?3


$&89^^55oF
!889KL
}DUz23
67r).__name__
__module____qualname__rFrIrXrgrkr~rrrrrrrrrrrrrrr_have_multiprocessingrpatchrrrrrrrrrrr
rrr!r$r-r	skip_unless_symlinkrCrrr)r)6s=  
GG4 1
+G26666K
PL
1666%'ABTZZ89*:C*?
%'ABTZZ89F:CF%'ABTZZ89TZZ)*2+:C2
%'ABTZZ8dCTZZ)*2+DC26"15@:G%'ABFCF=%'AB<C<
&


*G&""8#8rr)ceZdZy)CompileallTestsWithSourceEpochNrDrErFrJrrrLrL	rrL)	metaclasssource_date_epochceZdZy)!CompileallTestsWithoutSourceEpochNrMrJrrrRrRrNrrRz tempdir is not encodable on WASIc"eZdZdZdZdZdZy)EncodingTestzTIssue 6716: compileall should escape source code when printing errors
    to stdout.c2tj|_tjj|jd|_t|jdd5}|jd|jddddy#1swYyxYw)Nr+r,r-r.z# -*- coding: utf-8 -*-
u
print u"€"
)	r1r2r3r r7r8r9r;r<rCs  rrFzEncodingTest.setUpsp!))+77<<
C
$""C'
:	,dJJ23JJ*+	,	,	,s!#B

BcBtj|jyr)r5r6r3rfs rtearDownzEncodingTest.tearDowns

dnn%rc	tj}tjtjdt_tj|j|t_y#t_wxYw)Nasciir.)rrra
TextIOWrapperBytesIOrdr{r3)rDorig_stdouts  r
test_errorzEncodingTest.test_errorsK	%**K))"**,HCJ""4>>2$CJCJsA!A//
A<N)rDrErF__doc__rFrWr]rJrrrTrTs,&%rrTcDeZdZdZdZejdZdZdZ	dZ
dZdZd	Z
eej d
dZej d
dZd
dgfdddgfdddgffD]\ZZZeefdZeedez<dZdZedZdZdZej<dZdZ dZ!dZ"d Z#d!Z$d"Z%d#Z&d$Z'd%Z(d&Z)d'Z*d(Z+d)Z,e-e.d*d+Z/e0jbd,d-Z2d.Z3d/Z4ej<d0Z5d1Z6d2Z7y3)4CommandLineTestsBasezTest compileall's CLI.ctj|_|jtj
|jtjj|jd|_	t
j|jtjj|jd|_tj|jdd|_tj|jdd|_y)Nrrrrbar)r1r2r3r4r	r6r r7r8pkgdirrApkgdir_cachedirr
rinitfnbarfnrfs rrFzCommandLineTestsBase.setUps!))+	(($..9ggll4>>59
!ww||DKKG#//ZL"..t{{E2F
rc#Ktj}tjj	|j
d}	|t_|j
|d|t_y#|t_wxYww)z&Adjust and restore sys.pycache_prefix.
__testcache__)
PYTHONPATHPYTHONPYCACHEPREFIXN)rpycache_prefixr r7r8r3)rD
old_prefix
new_prefixs   rtemporary_pycache_prefixz-CommandLineTestsBase.temporary_pycache_prefixs^''
WW\\$../B
	,!+C"nn'1

",CCs;A6A&A6&
A33A6c>gtjddd|S)Nz-S-mrd)r!optim_args_from_interpreter_flags)rDargss  r
_get_run_argsz"CommandLineTestsBase._get_run_args
s<::<(	rctj|j|i|ddi\}}}|jd||S)NPYTHONIOENCODINGr-r)r
assert_python_okrsrxrDrrenv_varsrrrs      rassertRunOKz CommandLineTestsBase.assertRunOKsM$55,,T236>3*13C	
c"
rcdtj|j|i|ddi\}}}|||fS)Nrur-)r
rrsrws      rassertRunNotOKz#CommandLineTestsBase.assertRunNotOKsD$::++D125=2)02C3|rctjj|}|jtj
j
|yr)rrrrcr r7rrDrr7s   rassertCompiledz#CommandLineTestsBase.assertCompileds/~~//3t,-rctjj|}|jtj
j
|yr)rrrrr r7rr}s   rassertNotCompiledz&CommandLineTestsBase.assertNotCompiled s1~~//3-.rcBtj|jdd}|j5}|jdi||j||j
|j|j
|jdddy#1swYyxYw)NbazrrJ)	r
rr3rnryr~rrerf)rDbazfnenvs   rtest_no_args_compiles_pathz/CommandLineTestsBase.test_no_args_compiles_path$s))$..%D

*
*
,	/D#s#&""4;;/""4::.		/	/	/sABBcpuctj|jdd}|j5}|jdi|t
jj|}dddtjtjdz
fdztj|j}|jditj|j}|j|||jdi|tj|j}|j||y#1swYxYw)Nrr<rrJ)-f)r
rr3rnryrrrr r[timer!rQrxrz)rDrrpycpathrVmtime2s      r test_no_args_respects_force_flagz5CommandLineTestsBase.test_no_args_respects_force_flag-s
))$..%D

*
*
,	>D#s#nn66u=G	>	499;r>+A-. ))3!**'%%!**E6*	>	>s2EE
c tj|jdd|j5}|jdi|}ddd|jd|jdi}|j
d|y#1swY@xYw)NrrsListing rJ)-q)r
rr3rnryrr)rDrnoisyrqs    r test_no_args_respects_quiet_flagz5CommandLineTestsBase.test_no_args_respects_quiet_flag@s!!$..%<

*
*
,	,$D$$+s+E	,

k5)   --e,		,	,sBB
normalpycrz	opt-1.pyc-Odoubleoptimizez	opt-2.pycz-OOctj|ddd|jgz|jtj
j
|jtfddD}|jtt	j|j||jt	j|jDcgc]}|jr|c}ycc}w)Nrprdrc3rK|].}|jtjj0ywr)formatrimplementation	cache_tag).0baseexts  r	<genexpr>z)CommandLineTestsBase.f.<locals>.<genexpr>Us2K"&#kk#*<*<*F*FLKs47)z__init__.{}.{}z	bar.{}.{})
r
rvrcrcr r7rrdsortedrxlistdirrendswith)rDrswitchexpectedrs `   rfzCommandLineTestsBase.fPs**V|T4;;7.8
:
OOBGGNN4+?+?@AK*IKKHVBJJt/C/C$DExP2::dkk+B3R!#S!1!3
43sC7test_pep3147_paths_c8|jdd|j|jtjj|jtgd}|jttj|j|y)Nz-br)__init__.pyz__init__.pyczbar.pyzbar.pyc)
ryrcrr r7rrdrrxr)rDrs  rtest_legacy_pathsz&CommandLineTestsBase.test_legacy_paths]sl	
tT[[1(<(<=>&'

4;; 78(Crc`|jd|j|jtjj|jtjj|jd}|jtjj||jd|j|jtjj|j|jtjj|y)Nrr)	ryrcrcr r7rrdr8r)rD
cachecachedirs  rtest_multiple_runsz'CommandLineTestsBase.test_multiple_runsgs	
t{{+t';';<=T%9%9=I

67t{{+t';';<=
67rc`|jd|jtjj	|j
}t
j|tjdz
fdzt
j|j}|jd|jt
j|j}|j|||jdd|jt
j|j}|j||y)Nrrrr)
ryrcrrrrfr r[rr!rQrxrz)rDrrVrs    r
test_forcezCommandLineTestsBase.test_forcetst{{+..224::>
499;r>+A-. ))t{{+!**'tT[[1!**E6*rcNtjj|jd}tj|tj|dd}tj|dd}|jdd|j|j||jtjjtjj|d|jd|j|j||j|y)Nspamrrhamrz-lr)r r7r8rcrAr
rryrrrr~)rD
subpackage	subinitfnhamfns    rtest_recursion_controlz+CommandLineTestsBase.test_recursion_controlsWW\\$++v6

!--j*bI	))*eR@tT[[1y)Z(OPQt{{+I&E"rctjj|jd}tjj|d}tjj|d}|||fD]}t	j
|tjj|d}t	j|dd}t	j|dd}t	j|dd}|jdd|j|j||jtjjtjj|d	|jdd
|j|j||j||j||jdd|j|j||j||j||j||jdd|j|j||j||j||j|y)
Nrreggsrreggrz-r 0rz-r 1z-r 2z-r 5)r r7r8rcr
make_pkgrryrrrr~)	rDrsubpackage2subpackage3pkgrrspamfneggfns	         rtest_recursion_limitz)CommandLineTestsBase.test_recursion_limitsWW\\$++v6
ggll:u5ggll;7[9	(C""3'	(GGLL];	))*eR@**;C))+ubAvt{{3y)GGNN277<<
MBC	E	
vt{{3I&E"v&vt{{3I&E"F#u%vt{{3I&E"F#E"rc	tjj|jd}t	j
|tjdtjj|dtjdtjj|d|jd|j|jtjj|jddddy)Nr.evilevil2rr)	r r7r8rcr
rr8ryr~)rDrs  rtest_symlink_loopz&CommandLineTestsBase.test_symlink_loops
ggll4;;/s#


3S&12


3S'23t{{+BGGLLKK-
	rc|j|j}|jd|j}|jd||jd|y)Nrr)ryrcrzrx)rDrrqs   r
test_quietzCommandLineTestsBase.test_quietsL  -  t{{3C'e$rctj|jdd|jd|j\}}}|jd|j\}}}|j	d||jd|y)Ncrunchyfrog
bad(syntaxrz-qqr)r
rrcr{rzrx)rDrrqsilents    rtest_silentz CommandLineTestsBase.test_silentsp!!$++}lK))$<5!**5$++>61C'f%rc|jddd|j|j|j|j	|j
y)Nrz-xz
ba[^\\/]*$)ryrcrrfr~rerfs rtest_regexpz CommandLineTestsBase.test_regexps>t]DKK@tzz*DKK(rctjj|jd}tj|tj|dd}tj|dd}|jd|j||j|j|j|j|j||j|y)Nfoo2rrbar2r)r r7r8r3rAr
rryrcr~rerf)rDpkgdir2init2fnbar2fns    rtest_multiple_dirsz'CommandLineTestsBase.test_multiple_dirss'',,t~~v6
++GZD**7FB?t{{G4DKK(DJJ'G$F#rctj|jdd|jddd|j\}}}|j	|dy)Nrrr-ddinsdaleFile "dinsdale)r
rrcr{rrDrrrs    rtest_d_compile_errorz)CommandLineTestsBase.test_d_compile_errorsI!!$++}lK**4z4;;OC/0rctj|jdd}|jddd|jtj|jdd}tj
j
|}tj|tjj|jdtj|tj|d	
\}}}|j|dy)Nrzraise Exceptionrrrbingz
import bazzbaz.pycF)
__isolatedr)r
rrcryrrrr renamer7r8removerr)rDrrrrrrs       rtest_d_runtime_errorz)CommandLineTestsBase.test_d_runtime_errors))$++u>OPtZ=

&
&t{{FL
Inn..u5
		#rww||DKK;<
		%$::2%PC/0rc|jdtjj|jd|j
\}}}|j
|d|j|d|jtjjtjj|jy)N-i
nosuchfilesrror.*nosuchfiles	Traceback)r{r r7r8r3rcrassertNotRegexrrrrrrdrs    rtest_include_bad_filez*CommandLineTestsBase.test_include_bad_files**"'',,t~~|<dkkKC12C.	(H(H,0,@,@)BC	Drctj|jdd}tj|jdd}tj|jdd}tj|jdd}ttj
j
|jddd	5}|jtj
j
|jd
tjz|jtj
j
|jdtjzddd|jdtj
j
|jd||j||j||j||j|y#1swYxYw)
Nf1rf2f3f4l1r,r-r.f1.pyf2.pyr)
r
rrcr;r r7r8r3r<linesepryr~rrDrrrrrs      rtest_include_file_with_argz/CommandLineTestsBase.test_include_file_with_argsL

&
&t{{D"
=

&
&t{{D"
=

&
&t{{D"
=

&
&t{{D"
=
"'',,t~~t4cG
L	DPRHHRWW\\$++w7

BCHHRWW\\$++w7

BC	D	
rww||DNNDA2FBBr"B	D	Ds
;BGG!c2tj|jdd}tj|jdd}tj|jdd}tj|jdd}ttj
j
|jddd	5}|jtj
j
|jd
tjzddd|jdtj
j
|jd|j||j||j||j|y#1swYxYw)Nrrrrrrr,r-r.rr)
r
rrcr;r r7r8r3r<rryrr~rs      rtest_include_file_no_argz-CommandLineTestsBase.test_include_file_no_args 

&
&t{{D"
=

&
&t{{D"
=

&
&t{{D"
=

&
&t{{D"
=
"'',,t~~t4cG
L	DPRHHRWW\\$++w7

BC	Drww||DNNDABr"Br"r"
	D	Ds
;AF

Fctj|jdd}tj|jdd}tj|jdd}tj|jdd}tj|j	dddgz}|j
j
|tjzjd	tj||j||j||j||j|y)
NrrrrrrJr-rY)
r
rrcspawn_pythonrsstdinr<r rencodekill_pythonrr~)rDrrrrps      rtest_include_on_stdinz*CommandLineTestsBase.test_include_on_stdins

&
&t{{D"
=

&
&t{{D"
=

&
&t{{D"
=

&
&t{{D"
=&&););B)?4+)MO	

r"**},,W56!!!$r"r"Br"rcPtj|jdd}|jd|j||j
\}}}|j
|d|j||j|j|j|j
y)Nrzsyntax(errorrsrror)	r
rrcr{rerfrrr~)rDbingfnrrrs     r!test_compiles_as_much_as_possiblez6CommandLineTestsBase.test_compiles_as_much_as_possibles**4;;O**<+14::?Cg&v&DKK(DJJ'rcJ|jd}|j|dy)NbadfilenamesCan't list 'badfilename')ryr)rDrs  r!test_invalid_arg_produces_messagez6CommandLineTestsBase.test_invalid_arg_produces_message%s#}-9:rctj|jddtjjtjj|jd}|jd|jt|d5}|j}ddd|jtjdddd	|jd
|jt|d5}|j}ddd|jtj|ddddy#1swYxYw#1swY?xYw)Nrrrz --invalidation-mode=checked-hashrKlittlerz"--invalidation-mode=unchecked-hashr)r
rrcrrrr r7r8ryr;rOrxrP
from_bytes)rDrfprUs    rtest_pyc_invalidation_modez/CommandLineTestsBase.test_pyc_invalidation_mode)s!!$++tR8nn..GGLLg.0;T[[I
#t_	779D	Qq	8<dC=t{{K
#t_	779D	Qq	8<dC
				sD>;E
>E
Erctj|jdd}g}tdD]}tj
j
|jdj|}t	j|tj|dd}|jtj|dd|j|jdd|j||D]}|j|y)Nrrrzfoo{}rz-j0)r
rr3rr r7r8rrArryr~)rDrfilessuffixrcrrEs       rtest_workersz!CommandLineTestsBase.test_workers6s**4>>62FAh	HFWW\\$..'..2HIFHHV**6:rBBLL22662FG		H	
s3F#	&D%	&rzcompileall.compile_dirc4tjdtj|jdg5tj|j|j|j|jddddddy#1swYyxYw)Nzsys.argvz-j0rrrr)rrHr
executabler3rdmainrcrrxr)rDr{s  rtest_workers_available_coresz1CommandLineTestsBase.test_workers_available_coresEsx
ZZ
 ^^T^^UCE	FOOOOK../[2226yA1E		F	F	FsABBcgd}tjj|jg|}tj|tj|dd}tjj|}tjj|jg|dd}d}|jd|d||tj|\}}}	tjj|g|dd}
|j|
t|	tj|j!|t|	tjy)	Nrrrrrz-sz-pr.)r r7r8r3rr
rrrrryrrrrrrr s           rr!z+CommandLineTestsBase.test_strip_and_prependMs
4ww||DNN6X6
D**4A
^^
-
-f
577<<>"1>
xz4@$::2>Cggll:==

c4467	
	
c4467	
rc
Rtjj|jd}tj|tj|dd}g}dD]2}|jtjj||4ddgddgddggd	g}|D]v}|j|gd
|D|D]U}|jtjj|t|	tj||Wxy#t $rYfwxYw)N
optimizationsr&r'r(rr12)rrrc38K|]}dt|zyw)z-oN)r)rns  rrzICommandLineTestsBase.test_multiple_optimization_levels.<locals>.<genexpr>ps$LqTCF]$Ls)r r7r8r3rr
rrrrrryrcrrPrr))rDr7rr}r*r+r,s       rr-z6CommandLineTestsBase.test_multiple_optimization_levelsas'ww||DNNO<
D**4+>+24$	PIIIinn66vDM7O
P	P"3Z!3Z!3Z,. 1	ODTM$LO$LM,
	r#i./A BCIIbm,
	!s=D	D&%D&ctjj|jddd}tjj|jddd}tjj|jddd}tj|tj|tj|tj|dd}tj|dd}tjj|d	}tjj|d
}tj||tj||tjj|}tjj|}	|j|d||jtjj||jtjj|	y)Nrr/r0r1r2r3r'r4r5r6z-e)r r7r8r3rr
rr8rrrryrcrrr9s
          rrCz4CommandLineTestsBase.test_ignore_symlink_destinationxsbww||DNNFE9MT^^VUJO
'',,t~~vulS
L!
M"
O$'22<QXY)55oGXZab'',,}6GHWW\\-9MN


>?3


$&89^^55oF
!889KL
l;z23
67rc>|j|jddy)N-o 1--hardlink-dupes)r{r3rfs rtest_hardlink_bad_argsz+CommandLineTestsBase.test_hardlink_bad_argss	
DNNF4FGrc
dD]}tj5}|j|5tj|dd}t|}gd}|r|j
d|j|g||jt|d|d||jt|d|d	||jt|d|d	|ddddddy#1swYxYw#1swYxYw)
N)TFdeduprr')rz-o 0rz-o 2rrrr)
r1TemporaryDirectorysubTestr
rrrryrxr')rDrr7rpycsrrs      r
test_hardlinkz"CommandLineTestsBase.test_hardlinks#
	KE,,.
K$\\\.K*66tXwOF#F+D9D$67$D$$T1D1$$[a$q'%BEJ$$[a$q'%BEJ$$[a$q'%BEJK
K
K
	KKK
K
Ks#C?B3C3 C?3C<8C??D		N)8rDrErFr^rFr_contextmanagerrnrsryr{r~rrrrrequires_resourcerrnamerrrlocalsrrrrrr	rIrrrrrrrrrrrrrrrrGrrrHrr!r-rCrr"rJrrr`r`s G,,
.//Wu%+&+"Wu%-&-
5"	[4&)	;03c6
F
	423&-.!3$D8
+
+
# #D""#%&)
	$1
1D ##(;D%'AB&C&TZZ()F*F
(.""8#80H
Krr`ceZdZy)CommandLineTestsWithSourceEpochNrMrJrrr(r(rNrr(ceZdZy)CommandLineTestsNoSourceEpochNrMrJrrr*r*rNrr*linkzrequires os.linkceZdZdZej
dZddZdddddZd	Z	dd
Z
dZdZdd
Z
dZdZdZdZdZy)HardlinkDedupTestsBasecd|_yrrrfs rrFzHardlinkDedupTestsBase.setUps		rc#Ktj5}||_|d|_dddy#1swYyxYwwr)r1rr7)rDr7s  rtemporary_directoryz*HardlinkDedupTestsBase.temporary_directorys;

(
(
*	dDIJDI			s?3	?<?cDtj|j||Sr)r
rr7)rDcoder%s   rrz"HardlinkDedupTestsBase.make_scripts((D$??rTrF)rrrpcLtj|jd|||y)NT)rqrhardlink_dupesrp)rdr{r7)rDrrrps    rr{z"HardlinkDedupTestsBase.compile_dirs tyyx.35	Brc|j5|jd|jt5t	j
|jdddddd|jt5t	j
|jdddgdddddddy#1swYUxYw#1swYxYw#1swYyxYw)NpassTr)rqrr4)r0rr#rrdr{r7rfs r
test_bad_argsz$HardlinkDedupTestsBase.test_bad_argss
%
%
'		<V$"":.
<&&tyyq6:<
<"":.
<&&tyy1v6:<
<		<		<
<
<
<
<		<		<s:'C$B0C9&B<C0B9	5C<C	CCcg}|r|jd|jd|r|jddj|S)Nz'module docstring'zx = 1z
assert x == 1
)rr8)rD	docstring	assertionliness    rcreate_codez"HardlinkDedupTestsBase.create_codesALL-.
WLL)yyrc#\KdD]#}dD]}|j||}|||f%yw)N)FTr:r;)r=)rDr:r;r2s    r
iter_codesz!HardlinkDedupTestsBase.iter_codessF&	3I*
3	'')y'QY	22
3	3s*,c
|jD]\}}}|j||5|j5|j|}t	|}|jd|j
t|d|d|j
t|d|d|j
t|d|dddddddy#1swYxYw#1swYxYw)Nr?Frrrr)r@r r0rrr{rr')rDr2r:r;rr!s      r
test_disabledz$HardlinkDedupTestsBase.test_disableds*.//*;	D&D)Y	YG
D--/D!--d3F#F+D$$5$1$$[a$q'%BC$$[a$q'%BC$$[a$q'%BC
D
D
D	DDD
D
Ds#C-BC!C-!C*&C--C6	ct|}|jt|d|d||jt|d|d|xr||jt|d|d|y)Nrrr)rrxr')rDrr:r;r!s     rcheck_hardlinksz&HardlinkDedupTestsBase.check_hardlinkssT!Wd1g6&	(T!Wd1g6&8y=	:T!Wd1g6&	(rc8|jD]o\}}}|j||5|j5|j|}|j	|j|||ddddddqy#1swYxYw#1swYxYw)Nr?)r@r r0rr{rD)rDr2r:r;rs     rr"z$HardlinkDedupTestsBase.test_hardlinks*.//*;	G&D)Y	YG
G--/G!--d3F$$&((IFG
G
G	GGG
G
Gs"B5B1BB
	BB	c	~dD]}|j|5|j5|j|j}|j	|t||d}t||d}|j
t||ddddddy#1swYxYw#1swYxYw)N))rr)rr)rr)optsrrr)r r0rr=r{rrcr')rDrGrpyc1pyc2s     rtest_only_two_levelsz+HardlinkDedupTestsBase.test_only_two_levelss,		=D4(
=--/="--d.>.>.@AF$$d$3"6473D"6473DOOKd$;<=
=
=		===
=
=s#B3A+B'B3'B0,B33B<	c|j5|j|j}|jgdt	|d}t	|d}|jt
||dddy#1swYyxYw)N)rrrrrHrr)r0rr=r{rrcr')rDrrIrJs    rtest_duplicated_levelsz-HardlinkDedupTestsBase.test_duplicated_levelss|
%
%
'	5%%d&6&6&89Fl361%D61%DOOKd34	5	5	5sA'BB
c|j5|jd}|j|j|t	|}tj|dj}|jd}|jddgd|j|tj|dj|jt|d|d|j|tj|dj|jtj|d|dddddy#1swYyxYw)	Nr'rprint(0)rT)rrprshallow)r0rr{rDrr r!r"rxrcr'rzrfilecmpcmprDrr!inodes    rtest_recompilationz)HardlinkDedupTestsBase.test_recompilation$s&
%
%
'	J%%g.F  (F#DGGDG$++E%%j1F
q!fD9
UBGGDG$4$;$;<OOKQa9:rwwtAw'7'>'>?W[[a$q'4HI)	J	J	JsD8EEc|j5|j|jd}|j|j	|t|}t
j|dj}|jdd}tjdddd|j	|j|t
j|dj|j|t
j|d
j|jt|d|d
|jtj |d|d
d
dddy#1swYyxYw)Nmodule)r%rrOrz-cz
import moduleF)rrirrTrP)r0rr=r{rDrr r!r"r
rvr7rxrr'rRrSrTs    rtest_importz"HardlinkDedupTestsBase.test_import=sA
%
%
'	J%%d&6&6&8x%HF  (F#DGGDG$++E%%jx%@F
**dO$))


UBGGDG$4$;$;<UBGGDG$4$;$;<[a$q':;W[[a$q'4HI-	J	J	JsEE33E<N)r)FF)rDrErFrFr_r#r0rr{r7r=r@rBrDr"rKrMrVrYrJrrr-r-sl@$()5B< 3
D(G=
5J2Jrr-ceZdZy)!HardlinkDedupTestsWithSourceEpochNrMrJrrr[r[YrNrr[ceZdZy)HardlinkDedupTestsNoSourceEpochNrMrJrrr]r]`rNrr]__main__)7rdr_rRimportlib.utilrrar rrvr5rRrr1test.test_importlib.utilrrrtrrmultiprocessing.utilrrconcurrent.futuresrconcurrent.futures.processrrGNotImplementedErrorModuleNotFoundErrorrtest.supportr	r
test.test_py_compilerrrrr'r)TestCaserLrRskipIfis_wasirTr`r(r*hasattrr-r[r]rDrrJrr<module>rls		


%	"U6? "&:8F7N8N8b	%8%-%6%6/F7;		(;(0(9(92I:?	"DE%8$$%F%.zKzKz
	&:'/'8'81H9=		$8%-%6%6/F7<	WR(*<=ZJZJ>ZJz	(>(0(9(92I:>		&<&.&7&70G8=	zHMMO["	01"!"sF&&	F32F3