python (3.11.7)

(root)/
lib/
python3.11/
test/
__pycache__/
test_profile.cpython-311.opt-1.pyc

e"dZddlZddlZddlZddlZddlmZddlmZddl	m
Z
mZmZm
Z
ddlmZddlZddlmZmZddlmZmZGd	d
ejZdZedZd
ZiZded<ded<ded<edkredSdS)z"Test suite for the profile module.N)unified_diff)StringIO)TESTFNunlinktemp_dir
change_cwd)contextmanager)testfunctimer)assert_python_failureassert_python_okcreZdZejZeZgdZdZdZ	dZ
edZdZ
dZdZd	Zd
ZdZdS)
ProfileTest)print_stats
print_callers
print_calleesz:0(max)c.ttdSN)rrselfs E/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/test/test_profile.pytearDownzProfileTest.tearDownsvctSr)_ProfileOutputrs rget_expected_outputzProfileTest.get_expected_outputsrcg}|td}t}|dtt	|t|z
|jD]}t}tj	||}|
dt|||
}tjdddfd|D}|d||S)	NMbP?
testfunc()streamstdname.c@g|]}|v|S)rstrip).0linemod_names  r
<listcomp>z,ProfileTest.do_profiling.<locals>.<listcomp>/s+KKK(d:J:Jdkkmm:J:J:Jr
)
profilerclassrrunctxglobalslocalsappendmethodnamesrpstatsStats
strip_dirs
sort_statsgetattrgetvalue
splitlinesr

__module__rsplitjoin)	clsresultsprofstart_timer
methodnamesstatsoutputr*s	        @rdo_profilingzProfileTest.do_profilings=  ..ggL'))VXX666uww,---/	.	.J

ALa000E)))444&GE:&&(((ZZ\\,,..F*11#q99!<HLKKKKKKFNN499V,,----rc	2|}|}||ddg}t|jD]\}}||}||dz}||krq|d|d|jjd|t|
d|
dd	|r*|d|dSdS)
Nrir$z
Stats.z output for z does not fit expectation:r,)lineterm)
rErassertEqual	enumerater2r1r-__name__extendrsplitfailr<)rr>expectedrNimethodabs        r
test_cprofilezProfileTest.test_cprofile3s9##%%++--T***"4#344	*	*IAv A!AAvv9v99#1:999:::L

%')))***	'IIdiioo&&&&&	'	'rc	gd}|D]}t}|td}||t	tt
j||}||	}|
|j|d||dS)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/r0r3r4rr8assertInexpected_max_outputformat)rstmtsstmtrBr?rCress       rtest_calling_conventionsz$ProfileTest.test_calling_conventionsDs


	M	MD

A%%eU33DKKgii222La000E**,,CMM$2C9@@sKK
M
M
M
M	M	Mrc6t5|jddddn#1swxYwY|jdt|t
jtdS)Nzint('1')filename)silentprofilermodulerunr
assertTrueospathexistsrs rtest_runzProfileTest.test_runYs
XX	0	0##J///	0	0	0	0	0	0	0	0	0	0	0	0	0	0	0
V<<<v../////s6::ct5|jdtt	dddn#1swxYwY|jdtt	t
|tj	t
dS)Nrr^)
r`rar.r/r0rrcrdrerfrs rtest_runctxzProfileTest.test_runctx_s
XX	J	J&&|WYYIII	J	J	J	J	J	J	J	J	J	J	J	J	J	J	J""<FHH+1	#	3	3	3v../////s5AAActd|jjdtd|jjddtd|jjdddddS)N-mrandom_module_xyztimeitz-n1)rrarKr
rs rtest_run_profile_as_modulez&ProfileTest.test_run_profile_as_modulefsodD$7$@$GGG	dD$7$@"$7	9	9	9	t2;xs	4	4	4	4	4rc	t5}t|5tjdt	ddd5}|ddddn#1swxYwYt
d|jjdd	d|	tj
d	dddn#1swxYwYddddS#1swxYwYdS)
Ndestzdemo.pywzutf-8)encodingzimport os; os.chdir("dest")rkz-oz
out.pstats)rrrdmkdiropenwriter
rarKrcrerf)rtmpdirfs   r(test_output_file_when_changing_directoryz4ProfileTest.test_output_file_when_changing_directoryrs
ZZ	:6:f#5#5	:	:HViw777
715666
7
7
7
7
7
7
7
7
7
7
7
7
7
7
7
d)2l



OOBGNN<88999	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:	:sYC&'CA(C(A,,C/A,0ACC&C	C&C	C&&C*-C*N)rKr:__qualname__profileProfiler-rar2rWrrclassmethodrErTr\rgriroryr&rrrrsOMNCCCK#[('''"MMM*000000
4
4
4:::::rrc
|d}td|z|}g}t|d5}|D].}|||drn/dddn#1swxYwYt|d5}|||dt|j	D]*\}}|d|d||d	zd
+|dddddS#1swxYwYdS)NcozRegenerating %s...rz#--cutrrz_ProfileOutput = {}
z_ProfileOutput[z	] = """\
r$z"""
z'
if __name__ == "__main__":
    main()
)
r'printrErur1
startswith
writelinesrvrJr2)r_r=r>newfilerxr)rPrQs        rregenerate_expected_outputrst$$H	

)***  GG	
h				DNN4   x((


h		>	W	'((("3?33	+	+IAv
GGGFFGAaCLLL*
+
+
+
+	<===
>>>>>>>>>>>>>>>>>>s%2BBB'A?D33D7:D7c#Ktj}	tt_dV|t_dS#|t_wxYwr)sysstdoutr)rs rr`r`sD
ZFZZ




V
s	:AcdtjvrtjdSt	t
tdS)Nz-r)rargvunittestmainr__file__rr&rrrrs438
"8[99999ra       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(exc_info)                      <- 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__rr3rrddifflibriortest.support.os_helperrrrr
contextlibr	r{
test.profileer
rtest.support.script_helperrr
TestCaserrr`rrrKr&rr<module>rs((







				      GGGGGGGGGGGG%%%%%%))))))))NNNNNNNNm:m:m:m:m:(#m:m:m:`>>>(:::	!K}#L$#R&zDFFFFFr