python (3.12.0)

(root)/
lib/
python3.12/
test/
__pycache__/
test_profile.cpython-312.pyc

Αe"dZddlZddlZddlZddlZddlmZddlmZddl	m
Z
mZmZm
Z
ddlmZddlZddlmZmZddlmZmZGd	d
ej.ZdZedZd
ZiZded<ded<ded<edk(reyy)z"Test suite for the profile module.N)unified_diff)StringIO)TESTFNunlinktemp_dir
change_cwd)contextmanager)testfunctimer)assert_python_failureassert_python_okcteZdZejZeZgdZdZdZ	dZ
edZdZ
dZdZd	Zd
ZdZy)
ProfileTest)print_stats
print_callers
print_calleesz:0(max)c"ttyN)rrselfs E/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_profile.pytearDownzProfileTest.tearDowns	vctSr)_ProfileOutputrs rget_expected_outputzProfileTest.get_expected_outputsrcg}|jtd}t}|jdtt	|jt|z
|jD]}t}tj||}|jjdt|||jj}tj j#ddd}|D	cgc]}	||	vs|	j%}}	|jdj'||Scc}	w)NMbP?
testfunc()streamstdname.
)
profilerclassrrunctxglobalslocalsappendmethodnamesrpstatsStats
strip_dirs
sort_statsgetattrgetvalue
splitlinesr

__module__rsplitrstripjoin)
clsresultsprofstart_timer
methodnamesstatsoutputmod_namelines
          rdo_profilingzProfileTest.do_profilings  .gL')VX6uw,-//	.J
ALLa0E)))4&GE:&(ZZ\,,.F**11#q9!<H17K(d:JdkkmKFKNN499V,-	.Ls	E	E	c	|j}|j}|j|ddg}t|jD]\}}||}||dz}||k7s|jd|d|jjd|jt|jd|jdd	|r!|jdj|yy)
Nrir$z
Stats.z output for z does not fit expectation:r%)lineterm)
rArassertEqual	enumerater+r*r&__name__extendrsplitfailr6)rr8expectedrJimethodabs        r
test_cprofilezProfileTest.test_cprofile3s##%++-T*"4#3#34	*IAv A!AAvhvhl#11::;<99:L
%')*	*IIdiio&rc	hgd}|D]}t}|jtd}|j|t	tt
j||}|j|j}|j|j|dj||y)N)zmax([0])zmax([0], key=int)zmax([0], **dict(key=int))zmax(*([0],))zmax(*([0],), key=int)zmax(*([0],), **dict(key=int))rr z&Profiling {0!r} didn't report max:
{1})
rr&rr'r(r)r,r-rr1assertInexpected_max_outputformat)rstmtsstmtr<r9r=ress       rtest_calling_conventionsz$ProfileTest.test_calling_conventionsDs
	MD
A%%eU3DKKgi2LLa0E**,CMM$22C9@@sK
M	Mrct5|jjdddd|jjdt|j	t
jjty#1swY]xYw)Nzint('1')filename)silentprofilermodulerunr
assertTrueospathexistsrs rtest_runzProfileTest.test_runYsb
X	0##J/	0
V<v./	0	0sBBcft5|jjdtt	ddd|jjdtt	t
|j
tjjt
y#1swYoxYw)NrrZ)
r\r]r'r(r)rr_r`rarbrs rtest_runctxzProfileTest.test_runctx_s{
X	J&&|WYI	J""<FH+1	#	3v./		J	Js.B''B0ctd|jjdtd|jjddtd|jjddddy)N-mrandom_module_xyztimeitz-n1)rr]rGr
rs rtest_run_profile_as_modulez&ProfileTest.test_run_profile_as_modulefs]dD$7$7$@$@$G	dD$7$7$@$@"$7	9	t22;;xs	4rc	t5}t|5tjdt	ddd5}|jddddt
d|jjdd	d|jtjjd	ddddddy#1swYkxYw#1swYxYw#1swYyxYw)
Ndestzdemo.pywzutf-8)encodingzimport os; os.chdir("dest")rgz-oz
out.pstats)rrr`mkdiropenwriter
r]rGr_rarb)rtmpdirfs   r(test_output_file_when_changing_directoryz4ProfileTest.test_output_file_when_changing_directoryrs
Z	:6:f#5	:HHViw7
7156
7
d))22l

OOBGGNN<89	:	:	:
7
7	:	:	:	:s:C$CB7
AC&C7C<CC	CCN)rGr3__qualname__profileProfiler&r]r+rSrrclassmethodrArPrXrcrerkrurrrrsXOOMNCK#('"M*00
4:rrc
|jd}td|z|j}g}t|d5}|D]&}|j	||jds&ndddt|d5}|j
||jdt|jD]#\}}|jd|d||d	zd
%|jddddy#1swYxYw#1swYyxYw)NcozRegenerating %s...rz#--cutrnz_ProfileOutput = {}
z_ProfileOutput[z	] = """\
r$z"""
z'
if __name__ == "__main__":
    main()
)
r5printrArqr*
startswith
writelinesrrrFr+)r[r7r8newfilertr@rLrMs        rregenerate_expected_outputrst$H	

)* GG	
h		DNN4 x(	
h	>	W	'("3??3	+IAv
GGGAaCL*
+	+	
<=
>>
>>s(C6'C6>A/D6C?Dc#Ktj}	tt_d|t_y#|t_wxYwwr)sysstdoutr)rs rr\r\s.
ZZFZ


V
sA7A
AAczdtjvrtjyt	t
ty)Nz-r)rargvunittestmainr__file__rrzrrrrs!388

"8[9ra       28   27.972    0.999   27.972    0.999 profilee.py:110(__getattr__)
        1  269.996  269.996  999.769  999.769 profilee.py:25(testfunc)
     23/3  149.937    6.519  169.917   56.639 profilee.py:35(factorial)
       20   19.980    0.999   19.980    0.999 profilee.py:48(mul)
        2   39.986   19.993  599.830  299.915 profilee.py:55(helper)
        4  115.984   28.996  119.964   29.991 profilee.py:73(helper1)
        2   -0.006   -0.003  139.946   69.973 profilee.py:84(helper2_indirect)
        8  311.976   38.997  399.912   49.989 profilee.py:88(helper2)
        8   63.976    7.997   79.960    9.995 profilee.py:98(subhelper)ra:0(append)                        <- profilee.py:73(helper1)(4)  119.964
:0(exception)                     <- profilee.py:73(helper1)(4)  119.964
:0(hasattr)                       <- profilee.py:73(helper1)(4)  119.964
                                     profilee.py:88(helper2)(8)  399.912
profilee.py:110(__getattr__)      <- :0(hasattr)(12)   11.964
                                     profilee.py:98(subhelper)(16)   79.960
profilee.py:25(testfunc)          <- <string>:1(<module>)(1)  999.767
profilee.py:35(factorial)         <- profilee.py:25(testfunc)(1)  999.769
                                     profilee.py:35(factorial)(20)  169.917
                                     profilee.py:84(helper2_indirect)(2)  139.946
profilee.py:48(mul)               <- profilee.py:35(factorial)(20)  169.917
profilee.py:55(helper)            <- profilee.py:25(testfunc)(2)  999.769
profilee.py:73(helper1)           <- profilee.py:55(helper)(4)  599.830
profilee.py:84(helper2_indirect)  <- profilee.py:55(helper)(2)  599.830
profilee.py:88(helper2)           <- profilee.py:55(helper)(6)  599.830
                                     profilee.py:84(helper2_indirect)(2)  139.946
profilee.py:98(subhelper)         <- profilee.py:88(helper2)(8)  399.912ra:0(hasattr)                       -> profilee.py:110(__getattr__)(12)   27.972
<string>:1(<module>)              -> profilee.py:25(testfunc)(1)  999.769
profilee.py:110(__getattr__)      ->
profilee.py:25(testfunc)          -> profilee.py:35(factorial)(1)  169.917
                                     profilee.py:55(helper)(2)  599.830
profilee.py:35(factorial)         -> profilee.py:35(factorial)(20)  169.917
                                     profilee.py:48(mul)(20)   19.980
profilee.py:48(mul)               ->
profilee.py:55(helper)            -> profilee.py:73(helper1)(4)  119.964
                                     profilee.py:84(helper2_indirect)(2)  139.946
                                     profilee.py:88(helper2)(6)  399.912
profilee.py:73(helper1)           -> :0(append)(4)   -0.004
profilee.py:84(helper2_indirect)  -> profilee.py:35(factorial)(2)  169.917
                                     profilee.py:88(helper2)(2)  399.912
profilee.py:88(helper2)           -> :0(hasattr)(8)   11.964
                                     profilee.py:98(subhelper)(8)   79.960
profilee.py:98(subhelper)         -> profilee.py:110(__getattr__)(16)   27.972r__main__)__doc__rr,rr`difflibriortest.support.os_helperrrrr
contextlibr	rw
test.profileer
rtest.support.script_helperrr
TestCaserrr\rrrGrzrr<module>rs(

	 GG%)Nm:(##m:`>(:	!K}#L$#R&zFr