python (3.12.0)

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

Αe5dZddlZddlmZddlmZdZGddZGdd	eZGd
deZ	Gdd
e	eZ
Gdde
ZGddeZGddeZ
GddejZedk(rej"yy)z9Unit tests for zero-argument super() & related machinery.N)patch)shadowed_superc"eZdZdZedZy)AcyNrselfs C/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/test/test_super.pyfzA.fsc
|dfSr	r
clss r
cmzA.cmsSzrN)__name__
__module____qualname__rclassmethodrr
rr
rrsrrc2eZdZfdZefdZxZS)Bc&t|dzSNrsuperrr	__class__s r
rzB.fwy{S  rc&|t|dfSrrrrrs r
rzB.cmUWZ\3''rrrrrrr
__classcell__rs@r
rr!((rrc2eZdZfdZefdZxZS)Cc&t|dzSNr*rrs r
rzC.fr rc&|t|dfSr,r"r#s r
rzC.cmr$rr%r's@r
r*r*r(rr*c(eZdZfdZfdZxZS)Dc&t|dzSNr/rrs r
rzD.f!r rc&|t|dfSr1r"r#s r
rzD.cm#sUWZ\3''r)rrrrrr&r's@r
r/r/ s!((rr/ceZdZy)ENrrrr
rr
r4r4&rr4c$eZdZejZy)FN)rrrr4rr
rr
r8r8)s	Arr8ceZdZy)GNr5r
rr
r:r:,r6rr:c
eZdZfdZdZdZdZdZdZdZ	dZ
fd	Zd
ZdZ
dZd
ZdZdZdZdZdZdZfdZdZfdZfdZfdZdZdZdZdZdZdZ fdZ!fd Z"fd!Z#d"Z$d#Z%xZ&S)$	TestSuperctyN)r<rs r
tearDownzTestSuper.tearDown2s
	rcT|jtjdyNABCDassertEqualr/rrs r
test_basics_workingzTestSuper.test_basics_working7s&)rc^|jtjtdyrArCrs r
test_class_getattr_workingz$TestSuper.test_class_getattr_working:sQS6*rc|jtjd|jtjtdyrA)rDr4rrs r
!test_subclass_no_override_workingz+TestSuper.test_subclass_no_override_working=4&)QS6*rc|jtjd|jtjtdyrA)rDr8rrs r
$test_unbound_method_transfer_workingz.TestSuper.test_unbound_method_transfer_workingArJrcd|jtjtdf|jtjtdf|jtjtdf|jtjtdfyr	)rDrrr:rs r
 test_class_methods_still_workingz*TestSuper.test_class_methods_still_workingEsn!S*As8,!S*As8,rct}|j|j|tttdfdfdfdft}|j|j|tttdfdfdfdfy)Nrrr*r/)r/rDrr4)rdes   r
#test_super_in_class_methods_workingz-TestSuper.test_super_in_class_methods_workingKsn
C!a!aXs);S%A3!GH
C!a!aXs);S%A3!GHrclGddt}|j|jdy)NceZdZfdZxZS),TestSuper.test_super_with_closure.<locals>.Ec2fd}tdzS)Nc
yr>r
rsr
nestedz>TestSuper.test_super_with_closure.<locals>.E.f.<locals>.nestedVsrr4r)rrXrs` r
rz.TestSuper.test_super_with_closure.<locals>.E.fUswy{S((rrrrrr&r's@r
r4rUTs

)
)rr4AE)rrDr)rr4s  r
test_super_with_closurez!TestSuper.test_super_with_closureQs(	)	)	
$'rcGddt}|}|j|jd|j|jdGfdd}|j	|j
t
||jt5}tdtiddd|j	t
jtGdd}|jtdd	td=|jd|jGfd
d}|jd	y#1swYxYw)Nc"eZdZfdZdZxZS)7TestSuper.test_various___class___pathologies.<locals>.Xc t|Sr>rrs r
rz9TestSuper.test_various___class___pathologies.<locals>.X.f_swy{"r)rrrrrr&r's@r
Xr^^s

#Irrarr`c&eZdZWZfdZxZS)r^c
yr>r
r'sr
rz9TestSuper.test_various___class___pathologies.<locals>.X.fgr)rrrxrr&rrs@r
raz7TestSuper.test_various___class___pathologies.<locals>.XesA

rzYclass X:
                __class__
                def f():
                    __class__c"eZdZdafdZxZS)r^*c
yr>r
r'sr
rz9TestSuper.test_various___class___pathologies.<locals>.X.fsrdr)rrrrrr&r's@r
raz7TestSuper.test_various___class___pathologies.<locals>.XpsI

rrrhc$eZdZdfdZxZS)r^rhc
yr>r
r'sr
rz9TestSuper.test_various___class___pathologies.<locals>.X.f{rdrrYrfs@r
raz7TestSuper.test_various___class___pathologies.<locals>.XxsI

r)rrDrrassertIsretypeassertRaises	NameErrorexecglobals	exceptionassertNotIn__dict__)rrarerQrs    r
"test_various___class___pathologiesz,TestSuper.test_various___class___pathologies\s		
C$c*			


acc4:&


y
)	1Q!#*)R
1	1
	


d1;;'3		
	
;/4Ik"ajj1		
	
B''	1	1sEEcbGdd}|j|j|y)NceZdZfdZxZS)2TestSuper.test___class___instancemethod.<locals>.XcSr>r
rs r
rz4TestSuper.test___class___instancemethod.<locals>.X.f	  rrYr's@r
rarx

!
!rrarlrrras  r
test___class___instancemethodz'TestSuper.test___class___instancemethods$	!	!	


aceegq!rcXGdd}|j|j|y)Nc(eZdZefdZxZS)/TestSuper.test___class___classmethod.<locals>.XcSr>r
r#s r
rz1TestSuper.test___class___classmethod.<locals>.X.f	  r)rrrrrr&r's@r
rars

!
!rrar|r}s  r
test___class___classmethodz$TestSuper.test___class___classmethod"	!	!	


acceQrcXGdd}|j|j|y)Nc(eZdZefdZxZS)0TestSuper.test___class___staticmethod.<locals>.XcSr>r
r'sr
rz2TestSuper.test___class___staticmethod.<locals>.X.frrrrrstaticmethodrr&r's@r
rar

!
!rrar|r}s  r
test___class___staticmethodz%TestSuper.test___class___staticmethodrrchdGfddt}Gdd|}|j|y)Nc"eZdZfdZxZS)*TestSuper.test___class___new.<locals>.MetacLt|||||}|j|Sr>)r__new__r)rnamebases	namespacerr
test_classs     r
rz2TestSuper.test___class___new.<locals>.Meta.__new__s'wsD%C!VVX
rrrrrr&rrs@r
Metars


rrc(eZdZefdZxZS)'TestSuper.test___class___new.<locals>.AcSr>r
r'sr
rz)TestSuper.test___class___new.<locals>.A.frrrr's@r
rrrrr	metaclassrmrlrrrrs   @r
test___class___newzTestSuper.test___class___news2
	4		!$	!
	


j!$rcdGfddt}Gdd|}|j|dtdd}|j|j|y)NceZdZfdZy).TestSuper.test___class___delayed.<locals>.Metac
|yr>r
)rrrrtest_namespaces    r
rz6TestSuper.test___class___delayed.<locals>.Meta.__new__s!*rN)rrrr)rsr
rrs
rrc(eZdZefdZxZS)+TestSuper.test___class___delayed.<locals>.AcSr>r
r'sr
rz-TestSuper.test___class___delayed.<locals>.A.frrrr's@r
rrrrrrrr
)rmrlr)rrrrrs    @r
test___class___delayedz TestSuper.test___class___delayedsR	4		!$	!
	


ab.)

acceQrchdGddt}Gfdd|}|j|y)NceZdZfdZxZS)*TestSuper.test___class___mro.<locals>.MetacH|jdt|	S)Nr)rtrmrors r
rz.TestSuper.test___class___mro.<locals>.Meta.mros "

c"$w{}$r)rrrrr&r's@r
rrs

%
%rrc"eZdZfdZxZS)'TestSuper.test___class___mro.<locals>.Ac
yr>r
rsr
rz)TestSuper.test___class___mro.<locals>.A.fs&
rrYrs@r
rrs

'
'rrrrrs   @r
test___class___mrozTestSuper.test___class___mros0
	%4	%	'$	'
	


j!$rcGfddt}dGdd|}|jddGdd|}d}|jj}|j	t|d	|j
||d
|jt5|jdddy#1swYyxYw)Nc"eZdZfdZxZS)=TestSuper.test___classcell___expected_behaviour.<locals>.MetacH|jt|	||||Sr>)copyrr)rrrrrnamespace_snapshots    r
rzETestSuper.test___classcell___expected_behaviour.<locals>.Meta.__new__s%%.^^%5"wsD%CCrr)rrs@r
rrs
D
DrrceZdZy)HTestSuper.test___classcell___expected_behaviour.<locals>.WithoutClassRefNr5r
rr
WithoutClassRefrrrrr&ceZdZfdZxZS)ETestSuper.test___classcell___expected_behaviour.<locals>.WithClassRefcSr>r
rs r
rzGTestSuper.test___classcell___expected_behaviour.<locals>.WithClassRef.frzrrYr's@r
WithClassRefrr{rrr)
rmrsr__closure__rDlenrlrnAttributeErrorr&)rrrr
class_cellmethod_closurers      @r
%test___classcell___expected_behaviourz/TestSuper.test___classcell___expected_behaviours	D4	D"		*<=
"	!T	!(8
%33^,a0

j."34


~
.	'&&	'	'	's!
B77CcGddt}Gdd|}d}|jt|5Gdd|}dddy#1swYyxYw)	NceZdZfdZxZS)2TestSuper.test___classcell___missing.<locals>.MetacL|jddt|	||||SNr&)poprr)rrrrrs    r
rz:TestSuper.test___classcell___missing.<locals>.Meta.__new__s&

ot4wsD%CCrrr's@r
rr
D
DrrceZdZy)=TestSuper.test___classcell___missing.<locals>.WithoutClassRefNr5r
rr
rrrrrrz+__class__ not set.*__classcell__ propagatedceZdZfdZxZS):TestSuper.test___classcell___missing.<locals>.WithClassRefcSr>r
rs r
rz<TestSuper.test___classcell___missing.<locals>.WithClassRef.f	$$rrYr's@r
rr
%%rr)rmassertRaisesRegexRuntimeError)rrrexpected_errorrs     r
test___classcell___missingz$TestSuper.test___classcell___missingsU	D4	D		G

#
#L.
A	%
%
%	%	%	%s
A

Ac	Gddt}dddtfD]H}|j|5|jt5Gdd||}ddddddJy#1swYxYw#1swYaxYw)	NceZdZfdZxZS)4TestSuper.test___classcell___overwrite.<locals>.Metac2||d<t|||||Srrr)rrrrcellrs     r
rz<TestSuper.test___classcell___overwrite.<locals>.Meta.__new__s"-1	/*wsD%CCrrr's@r
rrrrrr)bad_cellceZdZy)1TestSuper.test___classcell___overwrite.<locals>.ANr5r
rr
rrsrr)rr)rmobjectsubTestrn	TypeError)rrrrs    r
test___classcell___overwritez&TestSuper.test___classcell___overwrites	D4	D
q"fh/	Hx0
&&y1d

	

s#A6	A*A6*A3/A66A?	cGddt}|jt5Gdd|}dddy#1swYyxYw)NceZdZfdZxZS)5TestSuper.test___classcell___wrong_cell.<locals>.MetacFt|||||}tdd|}|S)Nrr
)rrrm)rrrrrrs     r
rz=TestSuper.test___classcell___wrong_cell.<locals>.Meta.__new__s*goc4	Bb),
rrr's@r
rrs


rrceZdZfdZxZS)2TestSuper.test___classcell___wrong_cell.<locals>.AcSr>r
rs r
rz4TestSuper.test___classcell___wrong_cell.<locals>.A.frrrYr's@r
rrrrrr)rmrnr)rrrs   r
test___classcell___wrong_cellz'TestSuper.test___classcell___wrong_cells?	4	

y
)	%
%d
%	%	%	%s	
;Acfd}|jtd5|dddGdd}|jtd5|jdddfd}|jtd5|ddddGdd}|jtd	5|jdddy#1swYxYw#1swYxYw#1swY`xYw#1swYyxYw)
Nctyr>rr'sr
rz.TestSuper.test_obscure_super_errors.<locals>.f!sGrzno argumentsceZdZfdZxZS).TestSuper.test_obscure_super_errors.<locals>.Cctyr>rr'sr
rz0TestSuper.test_obscure_super_errors.<locals>.C.f'rrYr's@r
r*r&


rr*c~tyr>rrers r
rz.TestSuper.test_obscure_super_errors.<locals>.f,sGrzarg\[0\] deletedceZdZfdZxZS).TestSuper.test_obscure_super_errors.<locals>.Xctyr>rrs r
rz0TestSuper.test_obscure_super_errors.<locals>.X.f3srrYr's@r
rar2s


rrazempty __class__ cell)rrr)rrr*rars    r
test_obscure_super_errorsz#TestSuper.test_obscure_super_errors s	

#
#L/
B	
C			
#
#L/
B	
CCE		
#
#L2E
F	
dG			

#
#L2I
J	
CEEG		)								s/C
C	C)2C5CC&)C25C>cGddfd}|jd}|jtj|y)NceZdZfdZxZS)&TestSuper.test_cell_as_self.<locals>.Xctyr>rrs r
methz+TestSuper.test_cell_as_self.<locals>.X.meth<rr)rrrrr&r's@r
rar;rrrac"fd}|S)NcSr>r
)ksr
gz1TestSuper.test_cell_as_self.<locals>.f.<locals>.gAsrr
)rrras @r
rz&TestSuper.test_cell_as_self.<locals>.f?sA
Hrr)rrnrr)rrcras   @r
test_cell_as_selfzTestSuper.test_cell_as_self:s:			

COOA)QVVQ/rc|ttd}tdD]}tj|t|y)Ng?i)rfloatrange__init__int)rspirs   r
test_super_init_leakszTestSuper.test_super_init_leaksGs4
5#
t	'ANN2sA&	'rc|jtd5ttttdddy#1swYyxYw)Nzexpected at mostrrrrrs r
test_super_argcountzTestSuper.test_super_argcountPs5

#
#I/A
B	!#sC 	!	!	!s	;Ac||jtd5tdtdddy#1swYyxYw)Nargument 1 must be a typerrrs r
test_super_argtypezTestSuper.test_super_argtypeTs2

#
#I/J
K	!SM			s2;ch|jtjjdy)Nztruly super)rDrr*methodrs r
test_shadowed_globalzTestSuper.test_shadowed_globalXs$))+224mDrc|GddGfdd}|j|jdy)NceZdZdZy),TestSuper.test_shadowed_local.<locals>.superquite superNrrrmsgr
rr
rr\Crrc"eZdZfdZxZS)(TestSuper.test_shadowed_local.<locals>.Cc&jSr>)r )rrrs r
rz/TestSuper.test_shadowed_local.<locals>.C.method`sw{{"rrrrrr&)rrs@r
r*r#_s

#
#rr*r)rDr)rr*rs  @r
test_shadowed_localzTestSuper.test_shadowed_local[s1	 	 	#	#	
}5rcGdd}Gdd}ttd|5}|j|jddddy#1swYyxYw)NceZdZdZy)0TestSuper.test_shadowed_dynamic.<locals>.MySupersuper superNrr
rr
MySuperr)fr!rr+ceZdZfdZxZS)*TestSuper.test_shadowed_dynamic.<locals>.Cct|Sr>rr rs r
rz1TestSuper.test_shadowed_dynamic.<locals>.C.methodj
w{"rr%r's@r
r*r-i

#
#rr*.superr*rrrDr)rr+r*ms    r
test_shadowed_dynamiczTestSuper.test_shadowed_dynamicesX	 	 	#	#hZv&
0	:AQSZZ\=9	:	:	:s&AA cgGfdd}Gdd}ttd|5}|j|jd|jdgdddy#1swYyxYw)NceZdZfdZdZy)8TestSuper.test_shadowed_dynamic_two_arg.<locals>.MySuperc(j|yr>)append)rargs	call_argss  r
r
zATestSuper.test_shadowed_dynamic_two_arg.<locals>.MySuper.__init__ss  &rr*N)rrrr
r )r<sr
r+r8rs

'Crr+ceZdZfdZxZS)2TestSuper.test_shadowed_dynamic_two_arg.<locals>.CctddS)Nrrr/rs r
rz9TestSuper.test_shadowed_dynamic_two_arg.<locals>.C.methodxsQ&rr%r's@r
r*r>ws

'
'rr*r2r*)rrr3)rr+r*r4r<s    @r
test_shadowed_dynamic_two_argz'TestSuper.test_shadowed_dynamic_two_argpsp		 	 
	'	'hZv&
0	2AQSZZ\=9Y1	2	2	2s9A//A8cGdd}|jtd5|jdddy#1swYyxYw)NceZdZfdZxZS))TestSuper.test_attribute_error.<locals>.Cct|Sr>r/rs r
rz0TestSuper.test_attribute_error.<locals>.C.methodr0rr%r's@r
r*rCr1rr*z%'super' object has no attribute 'msg')rrrrr*s  r
test_attribute_errorzTestSuper.test_attribute_errors?	#	#
#
#N4[
\	
CJJL			AA	cGdd}|jtd5|jdddy#1swYyxYw)NceZdZfdZxZS)'TestSuper.test_bad_first_arg.<locals>.Cc td|S)Nr)rrrs r
rz.TestSuper.test_bad_first_arg.<locals>.C.methodsQ,..rr%r's@r
r*rJs

/
/rr*r)rrrrEs  r
test_bad_first_argzTestSuper.test_bad_first_args?	/	/
#
#I/J
K	
CJJL			rGclGdd}|j|jty)NceZdZfdZxZS))TestSuper.test_super___class__.<locals>.Cc,tjSr>)rrrs r
rz0TestSuper.test_super___class__.<locals>.C.methodsw(((rr%r's@r
r*rOs

)
)rr*)rDrr)rr*rs  r
test_super___class__zTestSuper.test_super___class__s'	)	)	
u-rcGddtGfdd|jjy)NceZdZy)8TestSuper.test_super_subclass___class__.<locals>.mysuperNr5r
rr
mysuperrTrrrUceZdZfdZy)2TestSuper.test_super_subclass___class__.<locals>.Cc*|jSr>r')rr*rUs r
rz9TestSuper.test_super_subclass___class__.<locals>.C.methodsq$'111rN)rrrr)r*rUsr
r*rWs
2rr*)rrDr)rr*rUrs @@r
test_super_subclass___class__z'TestSuper.test_super_subclass___class__s3	e		2	2	
w/rcnGddtfd}ttD]
}|dy)NceZdZy)/TestSuper.test_unusual_getattro.<locals>.MyTypeNr5r
rr
MyTyper\rrr]c|fi}tt||ddj|jdy)Nbarr)rrm__setattr__rDr_)rmytyper]rrs  r
testz-TestSuper.test_unusual_getattro.<locals>.tests>D6)R0F&$v,3FE1EVZZ+rfoo1)rmrADAPTIVE_WARMUP_DELAY)rrb_r]rs`  @r
test_unusual_getattrozTestSuper.test_unusual_getattros2	T		,
,-	AL	rczGdd}Gdd|}Gdd|}ttD]	}|y)NceZdZdZdZy)(TestSuper.test_reassigned_new.<locals>.Acyr>r
rs r
rz0TestSuper.test_reassigned_new.<locals>.A.__new__srcDd|jvr|j|_yy)Nr)rtrrs r
__init_subclass__z:TestSuper.test_reassigned_new.<locals>.A.__init_subclass__sCLL0"%++CK1rN)rrrrrlr
rr
rris

.rrceZdZy)(TestSuper.test_reassigned_new.<locals>.BNr5r
rr
rrnrrrceZdZfdZxZS)(TestSuper.test_reassigned_new.<locals>.Cc"t||Sr>rr#s r
rz0TestSuper.test_reassigned_new.<locals>.C.__new__sws++rrr's@r
r*rps

,
,rr*)rrdrrrr*res     r
test_reassigned_newzTestSuper.test_reassigned_news@	.	.			,	,,-	A
C	rcGfdd}Gdd|}Gdd|}ttD]}|j|y)Nc"eZdZefdZy)6TestSuper.test_mixed_staticmethod_hierarchy.<locals>.AcJj|j|yr>)assertFalse)rr;kwargsrs   r
somez;TestSuper.test_mixed_staticmethod_hierarchy.<locals>.A.somes  &  (rN)rrrrrzrsr
rrvs

)
)rrceZdZfdZxZS)6TestSuper.test_mixed_staticmethod_hierarchy.<locals>.Bc*t||g|i|Sr>rrz)rr;ryrs   r
rzz;TestSuper.test_mixed_staticmethod_hierarchy.<locals>.B.somesw|C9$9&99r)rrrrzr&r's@r
rr|s

:
:rrc(eZdZefdZxZS)6TestSuper.test_mixed_staticmethod_hierarchy.<locals>.Cc"t||Sr>r~r#s r
rzz;TestSuper.test_mixed_staticmethod_hierarchy.<locals>.C.somesw|C((r)rrrrrzr&r's@r
r*rs

)
)rr*)rrdrzrrs`    r
!test_mixed_staticmethod_hierarchyz+TestSuper.test_mixed_staticmethod_hierarchysG	)	)	:	:	)	)
,-	A
FF1I	r)'rrrr?rErGrIrLrNrRr[rur~rrrrrrrrrrr	rrrrr&r5r@rFrLrQrYrfrsrr&r's@r
r<r<0s
*+++-I	(!(F"  %& (%"'>%.%40'!E6	:
2.0
&rr<__main__)__doc__unittest
unittest.mockrrbrrdrrr*r/r4r8r:TestCaser<rmainr
rr
<module>rs?(((((1(				a!!aH
zHMMOr