python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_compileall.cpython-312.opt-2.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 666sc	tj|j}tj|j}||k(SN)osstatst_ino)	filename1	filename2inode1inode2s    ris_hardlinkr(/s8B
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!r8r9r4bad_source_pathr<r=rDs  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"r:st_mtimestructpackrrMAGIC_NUMBER)rErFdatamtimecompares     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)rOrOz0filesystem doesn't support timestamps near 2**32
r!utimer:
OverflowErrorOSErrorskipTest
contextlibredirect_stdoutioStringIO
assertTrue
compileallcompile_filerEs 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) rkz+filesystem doesn't support large timestampsr[rgs 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	Gric	tjjdrtjdtj|j|j|jt|jd5}|jt|d}dddt|jd5}|j||jddd|j|jt!j"|j$dd|j&|jy#1swYxYw#1swYrxYw)NSOURCE_DATE_EPOCHzSOURCE_DATE_EPOCH is setrLwbFTforcequiet)r!environgetunittestSkipTest
py_compilecompiler:assertEqualrYr<r;rPlenr=assertNotEqualrecompile_dirr4rd)rEmetadatarFbcs    rrecreation_checkz$CompileallTestsBase.recreation_checkis	
::>>-.##$>??4++,$1134
$,,
%	-S]^,B	-
$,,
%	JJx JJrN		T4467t~~U$G0023	-	-		sE#EEE c|jtjdtjj
ddy)NrNrr)rrSrTrrrUrgs r
test_mtimezCompileallTestsBase.test_mtimeys.fkk'9>>3N3N*+Q0	1rc&|jdy)Ns)rrgs 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)NFTrpr)r;r?r!unlinkrdrerfr:r8isfiler|r4rJassertFalserI)rEfns  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!r8rr;rcaptured_stdoutrdrerfpathlibPathr:assertRegexgetvalue)rEstdouts  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)ddirrrrr!r8rr;rdrerfrrr:rgs 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)stripdirrrrrgs 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)
prependdirrrrrgs 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)Nr8rrrFT)skip_curdirrqrr)
testtest_importlibrimport_stater4rdrecompile_pathrJrrgs 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)NrVrFro__pycache__)
r!r8r9r4rBr<rerfrexists)rEdata_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#1swYyxYwr )	rJr`rarbrcrrerfrIrgs 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)rrTrroptimizer)
rer|r4rrrr:rdr!r8rr>rC)rErrcachedcached2cached3s      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!r8rr;rrrer|rrr4r
splitlinesrrd)rErlines   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!r8rr;rdrer|rrr4rgs 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|jyrrrgs 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|jyNTrrworkersrer|r4rdcalledrE	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
ValueErrorrer|r4rgs r!test_compile_workers_non_positivez5CompileallTestsBase.test_compile_workers_non_positives?

#
#J$KM	?""4>>2>	?	?	?s"AActj|jdd|j|jdddy)NTrrrmax_workers)rer|r4ry	call_argsrs  rtest_compile_workers_cpu_countz2CompileallTestsBase.test_compile_workers_cpu_counts:	t~~T1E,,Q/
>Erzcompileall.compile_filectj|jd|j|j|j|jy)NTr)rer|r4rrrd)rEcompile_file_mockrs   rtest_compile_one_workerz+CompileallTestsBase.test_compile_one_workers?	t~~T:))*)001rNnewc~tj|jdd|j|jyrr)rErs  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)rr	maxlevels)r4ranger!r8r9rBr6r@r:rrrrer|rrrd)rEdepthr8isource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)parallelc	ddg}|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|dtj4| y)Nrfoo__init__rmodzdef fn(): 1/0
fn()
Trr)rrrr")r4r!r8r9rBr
make_scriptappendr5multiprocessing_cleanup_testsrer|rd
startswithrrrrzsepassert_python_failurerrget_code_from_pycryco_filenameassertInfsdecode)rErrfullpathr8modssubdirrmodcodemodpath_errexpected_inmod_code_objs              r_test_ddir_onlyz#CompileallTestsBase._test_ddir_only+sNE?~~	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)N
<a prefix>Frrrrgs rtest_ddir_only_one_workerz-CompileallTestsBase.test_ddir_only_one_workerHsK###FFrc*	|jddS)NrTrrrgs rtest_ddir_multiple_workersz.CompileallTestsBase.test_ddir_multiple_workersLsK###EErc*	|jddS)NrFrrrgs rtest_ddir_empty_only_one_workerz3CompileallTestsBase.test_ddir_empty_only_one_workerQsM##e#<<rc*	|jddS)NrTrrrgs r test_ddir_empty_multiple_workersz4CompileallTestsBase.test_ddir_empty_multiple_workersUsM##d#;;rcgd}tjj|jg|}tj|tj|dd}tjj|}tjj|jg|dd}tj|d|tj|\}}}tjj|dd}	|j|	t|tj |j#|t|tj y)Nrbuildrealr8r1 / 0rT)rrrr/r!r8r9r4makedirsr
rrrrrer|rrstrsysgetdefaultencodingassertNotIn)
rErr8rr~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)Nr
rr/fooT)rrrr/)r!r8r9r4rr
rrrrrer|rrrrr)
rErr8rr~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)	Nr
rrrrT)rrrrr/rrErr8rr~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)rrrr8rrrTz/barr)rrrrr)r!r8r9r4rr
rassertRaisesrrer|)rErr8s   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
rr4rrrrrerfrdr!r8rr	Exception)rErr~	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)rr
limit_sl_dest)r!r8r9r4rr
rsymlinkrrrrer|rdrr
rE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__rGrJrYrhrlrrrrrrrrrrrrrrrr_have_multiprocessingrpatchrrrrrrrrrr	rrrrr"r+r	skip_unless_symlinkrArrr*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)CompileallTestsWithSourceEpochNrBrCrDrHrrrJrJ	rrJ)	metaclasssource_date_epochceZdZy)!CompileallTestsWithoutSourceEpochNrKrHrrrPrPrLrrPz tempdir is not encodable on WASIc eZdZ	dZdZdZy)EncodingTestc2tj|_tjj|jd|_t|jdd5}|jd|jddddy#1swYyxYw)Nr,r-r.r/z# -*- coding: utf-8 -*-
u
print u"€"
)	r2r3r4r!r8r9r:r<r=rDs  rrGzEncodingTest.setUpsp!))+77<<
C
$""C'
:	,dJJ23JJ*+	,	,	,s!#B

BcBtj|jyr )r6r7r4rgs rtearDownzEncodingTest.tearDowns

dnn%rc	tj}tjtjdt_tj|j|t_y#t_wxYw)Nasciir/)rrrb
TextIOWrapperBytesIOrer|r4)rEorig_stdouts  r
test_errorzEncodingTest.test_errorsK	%**K))"**,HCJ""4>>2$CJCJsA!A//
A<N)rBrCrDrGrUr[rHrrrRrRs,&%rrRcBeZdZ	dZej
dZdZdZdZ	dZ
dZdZe
ejd	d
Zejd	dZdd
gfdddgfdddgffD]\ZZZeefdZeedez<dZdZe
dZdZdZej:dZdZdZ dZ!dZ"d Z#d!Z$d"Z%d#Z&d$Z'd%Z(d&Z)d'Z*d(Z+e,e-d)d*Z.e/j`d+d,Z1d-Z2d.Z3ej:d/Z4d0Z5d1Z6y2)3CommandLineTestsBasectj|_|jtj
|jtjj|jd|_	t
j|jtjj|jd|_tj|jdd|_tj|jdd|_y)Nrrrrbar)r2r3r4r5r	r7r!r8r9pkgdirrBpkgdir_cachedirr
rinitfnbarfnrgs rrGzCommandLineTestsBase.setUps!))+	(($..9ggll4>>59
!ww||DKKG#//ZL"..t{{E2F
rc#K	tj}tjj	|j
d}	|t_|j
|d|t_y#|t_wxYww)N
__testcache__)
PYTHONPATHPYTHONPYCACHEPREFIX)rpycache_prefixr!r8r9r4)rE
old_prefix
new_prefixs   rtemporary_pycache_prefixz-CommandLineTestsBase.temporary_pycache_prefixs_4''
WW\\$../B
	,!+C"nn'1

",CCs<A7A'A7'
A44A7c>gtjddd|S)Nz-S-mre)r!optim_args_from_interpreter_flags)rEargss  r
_get_run_argsz"CommandLineTestsBase._get_run_args
s<::<(	rctj|j|i|ddi\}}}|jd||S)NPYTHONIOENCODINGr.r)r
assert_python_okrpryrEroenv_varsrrrs      rassertRunOKz CommandLineTestsBase.assertRunOKsM$55,,T236>3*13C	
c"
rcdtj|j|i|ddi\}}}|||fS)Nrrr.)r
rrprts      rassertRunNotOKz#CommandLineTestsBase.assertRunNotOKsD$::++D125=2)02C3|rctjj|}|jtj
j
|yr )rrrrdr!r8rrErr8s   rassertCompiledz#CommandLineTestsBase.assertCompileds/~~//3t,-rctjj|}|jtj
j
|yr )rrrrr!r8rrzs   rassertNotCompiledz&CommandLineTestsBase.assertNotCompiled s1~~//3-.rcBtj|jdd}|j5}|jdi||j||j
|j|j
|jdddy#1swYyxYw)NbazrrH)	r
rr4rkrvr{r}rbrc)rEbazfnenvs   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<rrH)-f)r
rr4rkrvrrrr!r\timer"rRryr{)rErrpycpathrWmtime2s      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 rH)-q)r
rr4rkrvrr)rErnoisyrrs    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)Nrmrerc3rK|].}|jtjj0ywr )formatrimplementation	cache_tag).0baseexts  r	<genexpr>z)CommandLineTestsBase.f.<locals>.<genexpr>Us2K"&#kk#*<*<*F*FLKs47)z__init__.{}.{}z	bar.{}.{})
r
rsr`rdr!r8rrasortedrylistdirrendswith)rErswitchexpectedrs `   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)
rvr`rr!r8rrarryr)rErs  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)	rvr`rdr!r8rrar9r)rE
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)
rvr`rrrrcr!r\rr"rRryr{)rErrWrs    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!r8r9r`rBr
rrvr}rrr{)rE
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!r8r9r`r
make_pkgrrvr}rrr{)	rErsubpackage2subpackage3pkgrrspamfneggfns	         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!r8r9r`r
rr6rvr{)rErs  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)rvr`r{ry)rErrrs   r
test_quietzCommandLineTestsBase.test_quietsL  -  t{{3C'e$rctj|jdd|jd|j\}}}|jd|j\}}}|j	d||jd|y)Ncrunchyfrog
bad(syntaxrz-qqr)r
rr`rxr{ry)rErrrsilents    rtest_silentz CommandLineTestsBase.test_silentsp!!$++}lK))$<5!**5$++>61C'f%rc|jddd|j|j|j|j	|j
y)Nrz-xz
ba[^\\/]*$)rvr`r}rcr{rbrgs 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!r8r9r4rBr
rrvr`r{rbrc)rEpkgdir2init2fnbar2fns    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
rr`rxrrErrrs    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
rr`rvrrrr!renamer8r9removerr)rErrrrrrs       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)rxr!r8r9r4r`rassertNotRegexrrrrrrars    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
rr`r<r!r8r9r4r=lineseprvr{r}rErrrrrs      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
rr`r<r!r8r9r4r=rrvr}r{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)
NrrrrrrHr-rW)
r
rr`spawn_pythonrpstdinr=r!rencodekill_pythonr}r{)rErrrrps      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
rr`rxrbrcrr}r{)rEbingfnrrrs     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')rvr)rErs  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-hashrLlittlerz"--invalidation-mode=unchecked-hashr)r
rr`rrrr!r8r9rvr<rPryrQ
from_bytes)rErfprVs    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
rr4rr!r8r9rrBrrvr{)rErfilessuffixr`rrFs       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)rrFr
executabler4remainrdrryr)rEr|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)	Nr
rrrrz-sz-pr/)r!r8r9r4rr
rrrrrvrrrrrrrs           rrz+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!r8r9r4rr
rrrrrrvrdrrQrr')rEr8rr~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-r.r/r0r1r%r2r3r4z-e)r!r8r9r4rr
rr6rrrrvrdrrr7s
          rrAz4CommandLineTestsBase.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)rxr4rgs 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)
r2TemporaryDirectorysubTestr
rrrrvryr()rErr8rpycsros      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)7rBrCrDrGr`contextmanagerrkrprvrxr{r}rrrrequires_resourcerrnamerrrlocalsrrrrrr	rGrrrrrrrrrrrrrrrrErrrFrrr+rArrrHrrr]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)CommandLineTestsWithSourceEpochNrKrHrrr%r%rLrr%ceZdZy)CommandLineTestsNoSourceEpochNrKrHrrr'r'rLrr'linkzrequires os.linkceZdZdZej
dZddZdddddZd	Z	dd
Z
dZdZdd
Z
dZdZdZdZdZy)HardlinkDedupTestsBasecd|_yr rrgs rrGzHardlinkDedupTestsBase.setUps		rc#Ktj5}||_|d|_dddy#1swYyxYwwr )r2rr8)rEr8s  rtemporary_directoryz*HardlinkDedupTestsBase.temporary_directorys;

(
(
*	dDIJDI			s?3	?<?cDtj|j||Sr )r
rr8)rEcoder"s   rrz"HardlinkDedupTestsBase.make_scripts((D$??rTrF)rrrqcLtj|jd|||y)NT)rrrhardlink_dupesrq)rer|r8)rErrrqs    rr|z"HardlinkDedupTestsBase.compile_dirs tyyx.35	Brc|j5|jd|jt5t	j
|jdddddd|jt5t	j
|jdddgdddddddy#1swYUxYw#1swYxYw#1swYyxYw)NpassTr)rrrr1)r-rr!rrer|r8rgs 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
)rr9)rE	docstring	assertionliness    rcreate_codez"HardlinkDedupTestsBase.create_codesALL-.
WLL)yyrc#\KdD]#}dD]}|j||}|||f%yw)N)FTr7r8)r:)rEr7r8r/s    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=rr-rrr|rr()rEr/r7r8rrs      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)rryr()rErr7r8rs     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=rr-rr|rA)rEr/r7r8rs     rrz$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)rr-rr:r|rrdr()rErDrpyc1pyc2s     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)rrrrrErr)r-rr:r|rrdr()rErrFrGs    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)rrqrshallow)r-rr|rArr!r"r#ryrdr(r{rfilecmpcmprErrinodes    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"rrLrz-cz
import moduleF)rrfrrTrM)r-rr:r|rArr!r"r#r
rsr8ryrr(rOrPrQs    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)rBrCrDrGr`r r-rr|r4r:r=r?rArrHrJrSrVrHrrr*r*sl@$()5B< 3
D(G=
5J2Jrr*ceZdZy)!HardlinkDedupTestsWithSourceEpochNrKrHrrrXrXYrLrrXceZdZy)HardlinkDedupTestsNoSourceEpochNrKrHrrrZrZ`rLrrZ__main__)7rer`rOimportlib.utilrrbr!rrwr6rSrr2test.test_importlib.utilrrrurrmultiprocessing.utilrrconcurrent.futuresrconcurrent.futures.processrrENotImplementedErrorModuleNotFoundErrorrtest.supportr	r
test.test_py_compilerrrrr(r*TestCaserJrPskipIfis_wasirRr]r%r'hasattrr*rXrZrBrrHrr<module>ris		


%	"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