Current File : //opt/imh-python/lib/python2.7/test/test_gc.pyo
�
��Wc@sddlZddlmZmZmZddlZddlZddlZddlZyddl	Z	Wne
k
r�eZ	nXdefd��YZ
defd��YZdejfd��YZd	ejfd
��YZd�Zedkr�e�ndS(
i����N(tverbosetrun_unittestt
start_threadstC1055820cBseZd�ZRS(cCs||_||_dS(N(titloop(tselfR((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyt__init__s	(t__name__t
__module__R(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyRstGC_DetectorcBseZd�ZRS(cs7t�_�fd�}tjtd�|��_dS(Ncs
t�_dS(N(tTruetgc_happened(tignored(R(se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pytit_happened!si�(tFalseRtweakreftrefRtwr(RR((Rse/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyRs	(RR	R(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR
stGCTestscBseZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zejed�d��Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cCs:g}|j|�tj�~|jtj�d�dS(Ni(tappendtgctcollecttassertEqual(Rtl((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyt	test_list-s


cCs7i}||d<tj�~|jtj�d�dS(Ni(RRR(Rtd((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyt	test_dict4s


cCsFg}|f}|j|�tj�~~|jtj�d�dS(Ni(RRRR(RRtt((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyt
test_tuple;s	

cCsCddd��Y}||_tj�~|jtj�d�dS(NtAcBseZRS((RR	(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyRFsi((taRRtassertNotEqual(RR((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyt
test_classEs
	
cCs=dtfd��Y}tj�~|jtj�d�dS(NRcBseZRS((RR	(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyRNsi(tobjectRRR (RR((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyttest_newstyleclassMs
cCsLddd��Y}|�}||_tj�~|jtj�d�dS(NRcBseZRS((RR	(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyRUsi((RRRR (RRR((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyt
test_instanceTs		
cCs
dtfd��Y}|�}||_tj�~|jtj�d�dtfd��Y}d||fd��Y}|�}||_tj�~|jtj�d�~~|jtj�d�|�|_~|jtj�d�|jtj�d�dS(NRcBseZRS((RR	(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR^sitBcBseZRS((RR	(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR%estCcBseZRS((RR	(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR&gs(R"RRRR tlistR(RRRR%R&((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyttest_newinstance]s&		
		
cCsCddd��Y}|�}tj�~|jtj�d�dS(NRcBseZd�ZRS(cSs|j|_dS(N(Rtinit(R((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyRxs(RR	R(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyRwsi((RRR (RRR((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyttest_methodus
	
cCs�ddd��Y}ddd��Y}|�}||_t|�}|�}||_tj�~~|jtj�d�x:tjD]"}t|�|kr�|`Pq�q�W|jd�tjj|�dS(	NRcBseZd�ZRS(cSsdS(N((R((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyt__del__�s(RR	R+(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR�sR%cBseZRS((RR	(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR%�sis&didn't find obj in garbage (finalizer)(((	RtidtbRRR tgarbagetfailtremove(RRR%Rtid_aR-tobj((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyttest_finalizers"				

cCs�dtfd��Y}dtfd��Y}|�}||_t|�}|�}||_tj�~~|jtj�d�x:tjD]"}t|�|kr�|`Pq�q�W|jd�tjj	|�dS(NRcBseZd�ZRS(cSsdS(N((R((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR+�s(RR	R+(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR�sR%cBseZRS((RR	(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR%�sis&didn't find obj in garbage (finalizer)(
R"RR,R-RRR R.R/R0(RRR%RR1R-R2((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyttest_finalizer_newclass�s"				

cBs5i}d|Uej�~|jej�d�dS(Nsdef f(): pass
i(RRR(RR((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyt
test_function�s

cCs4d�}tj�|�|jtj�d�dS(NcSstj�}dS(N(tsyst	_getframe(tframe((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pytf�si(RRR(RR9((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyt
test_frame�s	
cCs�tj�|jtjg�g}|j|�t|�}tj�}tj|tjB�~tj�tj|�|jt	tj�d�tjj
�}|jt|�|�dS(Ni(RRRR.RR,t	get_debugt	set_debugt
DEBUG_SAVEALLtlentpop(RtLtid_LtdebugR2((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyttest_saveall�s



cCs]tj�}tj�tjd�ddd��Y}|�}~tj�tj|�dS(NiRcBseZd�ZRS(cSst|�dS(N(tdir(R((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR+�s(RR	R+(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR�s((Rt
get_thresholdtenablet
set_thresholdtdisable(Rt
thresholdsRR((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyttest_del�s

	
cCs`tj�}tj�tjd�dtfd��Y}|�}~tj�tj|�dS(NiRcBseZd�ZRS(cSst|�dS(N(RD(R((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR+�s(RR	R+(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR�s(RRERFRGR"RH(RRIRR((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyttest_del_newclass�s

	
cCsF|j}tj�|tj�d�t�}|tj�d�dS(Nii(iii(iii(t_baseAssertEqualRRt	get_counttdict(RRR((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyttest_get_count�s
	
	cCs�|j}tj�t�}tjd�|tj�d�tjd�|tj�d�tjd�|tj�d�dS(Niii(iii(iii(iii(RRRRNRM(RRR((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyttest_collect_generationss	
	


cs�dd�fd��Y�tj�d}x�td�D]�}g}x#t|�D]}|��g}qOWg}x#t|�D]}|��g}q{Wi}x+t|�D]}i|d6��d6}q�Wq6Wtj�dS(NtOuchcseZdZ�fd�ZRS(ics4�jd�_�jddkr0tj�ndS(Niii(tnRR(R(RQ(se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR+s(RR	RRR+((RQ(se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyRQsi�ii((RRFtrangeRH(RtNtcountRRtutv((RQse/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyt
test_trashcans
s*test meaningless on builds without threadscs$d�d}d��dtf��fd��Y���fd����fd�}tj�}tjd�zrg�g}x3t|�D]%}tjd	|�}|j|�q�Wt|�fd
���t	j
d�WdQXWdtj|�Xtj�|j
t�j�t�j��dS(Ni<icssz	dVWdtjd�XdS(s<A generator that releases the GIL when closed or dealloc'ed.Ng���ư>(ttimetsleep(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pytsleeper_gen:s	R&cs5eZgZgZ�fd�Z��fd�ZRS(cs||(�jjd�dS(N(tinitsRtNone(Rtalist(R&(se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyREscs'�jjd���}t|�dS(N(tdelsRR]tnext(Rtg(R&R[(se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR+Hs	(RR	R\R_RR+((R&R[(se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR&Ascs<�g�}x&t��D]}�|g�g}qW~dS(syCreate a sufficiently nested container object so that the
            trashcan mechanism is invoked when deallocating it.N(RS(txR(R&tNESTING(se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pytmake_nestedSscsx�s��qWdS(s!Exercise make_nested() in a loop.N(((texitRd(se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyt
run_thread[s	ittargetcs
�jd�S(Ni(R((Re(se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyt<lambda>hsg�?(R'R6tgetcheckintervaltsetcheckintervalRSt	threadingtThreadRRRYRZRRRR>R\R_(Rt	N_THREADSRftold_checkintervaltthreadsRR((R&RcReRdR[se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyttest_trashcan_threads4s&	

cCs�ddd��Y}|�}|�}||_||_tj�ttj�}~~|jtj�d�|jttj�|�dS(NtBoomcBseZd�ZRS(cSs|`t�dS(N(tattrtAttributeError(Rt
someattribute((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyt__getattr__qs(RR	Ru(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyRqpsi((RrRRR>R.R(RRqRR-t
garbagelen((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyt	test_boomos				
cCs�ddd��Y}|�}|�}||_||_tj�ttj�}~~|jtj�d�|jttj�|�dS(NtBoom2cBseZd�Zd�ZRS(cSs
d|_dS(Ni(Rb(R((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR�scSs1|jd7_|jdkr'|`nt�dS(Ni(RbRrRs(RRt((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyRu�s	(RR	RRu(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyRx�s	i((RrRRR>R.R(RRxRR-Rv((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyt
test_boom2�s
				
cCs�dtfd��Y}|�}|�}||_||_tj�ttj�}~~|jtj�d�|jttj�|�dS(NtBoom_NewcBseZd�ZRS(cSs|`t�dS(N(RrRs(RRt((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyRu�s(RR	Ru(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyRz�si(R"RrRRR>R.R(RRzRR-Rv((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyt
test_boom_new�s				
cCs�dtfd��Y}|�}|�}||_||_tj�ttj�}~~|jtj�d�|jttj�|�dS(Nt	Boom2_NewcBseZd�Zd�ZRS(cSs
d|_dS(Ni(Rb(R((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR�scSs1|jd7_|jdkr'|`nt�dS(Ni(RbRrRs(RRt((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyRu�s	(RR	RRu(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR|�s	i(R"RrRRR>R.R(RR|RR-Rv((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyttest_boom2_new�s
				
cCs+dddg}tj|�}|j�|j||�t|�}tj|�}|j�|j||�idd6dd6}ddddg}tj|�}|j�|j||�tjddgidd6d
�}|j�|j|ddgtd��|jtjddd	�g�dS(NiiiiiiiRy@(iii(Rt
get_referentstsortRttupleRS(RR^tgottatupletadicttexpected((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyttest_get_referents�s"


"
 cCs�|jtjd��|jtjd��|jtjd��|jtjd
��|jtjt��|jtjt��|jtjd��|jtjd��|jtjtd���|jtjt��|jtjt��|jtjt	��|jtjt	���ddd��Y}dt	fd	��Y}|j
tjt��|j
tj|��|j
tj|���|j
tj|��|j
tj|���|j
tjg��|j
tjt���dS(Nig�?y@RuatOldStylecBseZRS((RR	(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR��stNewStylecBseZRS((RR	(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR��sy�?@((tassertFalseRt
is_trackedR]RRt	bytearrayttypetintR"t
assertTruetset(RR�R�((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyttest_is_tracked�s,cs�g���fd�}gtd�D]}t|�^q%}g|D]}tj||�^qD�d}tj�|jt��d�d}tj�|jt��d�x�D]}|j|d�q�WdS(Ncs!g�D]}|�^q�(dS(N((R
R(tWRstouch(se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pytcallbacksii(	RSRRRR]RRRR>(RR�RtCstcRb((R�R�se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyttest_bug1055820bs%%


(RR	RRRR!R#R$R(R*R3R4R5R:RCRJRKRORPRXtunittestt
skipUnlessRkRpRwRyR{R}R�R�R�(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR,s4			
						
									
		#;						tGCTogglingTestscBs,eZd�Zd�Zd�Zd�ZRS(cCstj�dS(N(RRF(R((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pytsetUpscCstj�dS(N(RRH(R((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyttearDownsc
s-td�}tj�td�}||_|`td�}tj|��g���fd�}tj||�}d}}}g}d}t�}xV|j	s�|d7}|dkr�|j
d�n|jt��d�|j
g�q�W|jt��d�x�D]}	|j|	d�qWdS(Niiics��g�(dS(N((R
(tc2wrR�(se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR�1si's'gc didn't happen after 10000 iterations(RRRt
keep_c0_aliveRRRR]R
RR/RR>R(
Rtc0tc1tc2R�tc0wrtjunkRtdetectorRb((R�R�se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyttest_bug1055820c!s.
	 	

c	s(g�dtf��fd��Y}|d�}tj�td�}||_|`td�}tj|��d}}}t�}g}d}xV|j	s�|d7}|dkr�|j
d�n|jt��d�|j
g�q�W|jt��d�x�D]}|j|d�q
WdS(NtDcseZ��fd�ZRS(cs��g�(dS(N((R(R�R�(se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR+ns(RR	R+((R�R�(se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR�msiiii's'gc didn't happen after 10000 iterations(RRRt
keep_d0_aliveRRRR]R
RR/RR>R(	RR�td0R�R�R�R�RRb((R�R�se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyttest_bug1055820dgs,
		

(RR	R�R�R�R�(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyR�s			FcCs�tj�}tj�tj�}tj|tj@�ztj�ttt	�Wdtj|�t
rpdGHntj�|s�tj�nXdS(Nsrestoring automatic collection(Rt	isenabledRHR;R<t
DEBUG_LEAKRRRR�RRF(tenabledRB((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyt	test_main�s



t__main__(R�ttest.test_supportRRRR6RYRRRktImportErrorR]R"RR
tTestCaseRR�R�R(((se/builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_gc.pyt<module>s"


���