+
    BiI                     F   R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIH	t	H
t
  ! R R4      t ! R R]4      t ! R R	]4      t ! R
 R]]4      t ! R R]4      t ! R R]4      t ! R R]4      t ! R R]P$                  4      t]R8X  d   ]P*                  ! 4        R# R# )z9Unit tests for zero-argument super() & related machinery.N)patch)import_helperthreading_helperc                   6   a  ] tR t^t o R t]R 4       tRtV tR# )Ac                    R # r    selfs   &&/usr/lib/python3.14/test/test_super.pyfA.f   s        c                
    V R 3# r   r	   clss   &r   cmA.cm   s    Szr   r	   N)	__name__
__module____qualname____firstlineno__r   classmethodr   __static_attributes____classdictcell____classdict__s   @r   r   r      s      r   r   c                   H   a a ] tR t^t oV 3R lt]V 3R l4       tRtVtV ;t	# )Bc                .   < \         SV `  4       R ,           # r   superr   r   	__class__s   &r   r   B.f       wy{S  r   c                &   < V \         SV `  4       R 3# r!   r#   r   r   r%   s   &r   r   B.cm       UWZ\3''r   r	   
r   r   r   r   r   r   r   r   r   __classcell__r%   r   s   @@r   r   r      !     !( ( (r   r   c                   H   a a ] tR t^t oV 3R lt]V 3R l4       tRtVtV ;t	# )Cc                .   < \         SV `  4       R ,           # r2   r"   r$   s   &r   r   C.f   r'   r   c                &   < V \         SV `  4       R 3# r4   r)   r*   s   &r   r   C.cm   r,   r   r	   r-   r/   s   @@r   r2   r2      r0   r   r2   c                   >   a a ] tR t^!t oV 3R ltV 3R ltRtVtV ;t# )Dc                .   < \         SV `  4       R ,           # r9   r"   r$   s   &r   r   D.f"   r'   r   c                &   < V \         SV `  4       R 3# r;   r)   r*   s   &r   r   D.cm$   s    UWZ\3''r   r	   )	r   r   r   r   r   r   r   r   r.   r/   s   @@r   r9   r9   !   s     !( (r   r9   c                       ] tR t^'tRtR# )Er	   Nr   r   r   r   r   r	   r   r   r@   r@   '       r   r@   c                   .    ] tR t^*t]P
                  tRtR# )Fr	   N)r   r   r   r   r@   r   r   r	   r   r   rD   rD   *   s    	Ar   rD   c                       ] tR t^-tRtR# )Gr	   NrA   r	   r   r   rF   rF   -   rB   r   rF   c                     a a ] tR t^1t oV 3R ltR tR tR tR tR t	R t
R tV 3R	 ltR
 tR tR tR tR tR tR tR tR tR tV 3R ltR tV 3R ltV 3R ltV 3R ltR tR tR tR tR t R t!R t"V 3R  lt#V 3R! lt$V 3R" lt%R# t&R$ t'](PR                  ! 4       R% 4       t*V 3R& lt+V 3R' lt,V 3R( lt-V 3R) lt.R*t/Vt0V ;t1# )+	TestSuperc                   < \         oR # N)rH   r$   s   &r   tearDownTestSuper.tearDown3   s
     	r   c                V    V P                  \        4       P                  4       R 4       R# ABCDNassertEqualr9   r   r
   s   &r   test_basics_workingTestSuper.test_basics_working8   s    &)r   c                `    V P                  \        P                  \        4       4      R 4       R# rN   rP   r
   s   &r   test_class_getattr_working$TestSuper.test_class_getattr_working;   s    QS6*r   c                    V P                  \        4       P                  4       R 4       V P                  \        P                  \        4       4      R 4       R# rN   )rQ   r@   r   r
   s   &r   !test_subclass_no_override_working+TestSuper.test_subclass_no_override_working>   4    &)QS6*r   c                    V P                  \        4       P                  4       R 4       V P                  \        P                  \        4       4      R 4       R# rN   )rQ   rD   r   r
   s   &r   $test_unbound_method_transfer_working.TestSuper.test_unbound_method_transfer_workingB   rZ   r   c                f   V P                  \        P                  4       \        R 34       V P                  \        4       P                  4       \        R 34       V P                  \        P                  4       \        R 34       V P                  \        4       P                  4       \        R 34       R# )r   N)rQ   r   r   rF   r
   s   &r    test_class_methods_still_working*TestSuper.test_class_methods_still_workingF   sn    !S*As8,!S*As8,r   c                
   \        4       pV P                  VP                  4       V\         \         \         R 3R3R3R34       \        4       pV P                  VP                  4       V\        \        \        R 3R3R3R34       R# )r   r   r2   r9   N)r9   rQ   r   r@   )r   des   &  r   #test_super_in_class_methods_working-TestSuper.test_super_in_class_methods_workingL   sn    C!a!aXs);S%A3!GHC!a!aXs);S%A3!GHr   c                n     ! R  R\         4      pV P                  V! 4       P                  4       R4       R# )c                   2   a a ] tR t^Ut oV 3R ltRtVtV ;t# ),TestSuper.test_super_with_closure.<locals>.Ec                <   <a  V 3R  lp\         SS `  4       R,           # )c                     < S  R # rJ   r	   r
   s   r   nested>TestSuper.test_super_with_closure.<locals>.E.f.<locals>.nestedW   s    r   r@   r"   )r   rk   r%   s   f r   r   .TestSuper.test_super_with_closure.<locals>.E.fV   s    wy{S((r   r	   r   r   r   r   r   r   r   r.   r/   s   @@r   r@   rh   U   s     ) )r   r@   AEN)r   rQ   r   )r   r@   s   & r   test_super_with_closure!TestSuper.test_super_with_closureR   s(    	) 	) 	$'r   c                  <  ! R  R\         4      pV! 4       pV P                  VP                  4       R4       V P                  VP                  R4        ! V3R lR4      pV P	                  VP
                  \        V 4      4       V P                  \        4      ;_uu_ 4       p\        R\        4       / 4       RRR4       V P	                  \        XP                  4      \        4        ! R R4      pV P                  \        4       R,          ^*4       \        4       R V P                  RVP                  4        ! V3R	 lR4      pV P                  S^*4       R#   + '       g   i     L; i)
c                   6   a a ] tR t^_t oV 3R ltRtRtVtV ;t# )7TestSuper.test_various___class___pathologies.<locals>.Xc                    < \         SV `  4       # rJ   r"   r$   s   &r   r   9TestSuper.test_various___class___pathologies.<locals>.X.f`   s    wy{"r     r	   )	r   r   r   r   r   r%   r   r   r.   r/   s   @@r   Xrt   _   s     #IIr   rx   r   rw   c                   :   <a a ] tR t^ft o ZtV 3R ltRtVtV ;t# )rt   c                    < S  R # rJ   r	   r%   s   r   r   rv   h       r   r	   )	r   r   r   r   xr   r   r   r.   r%   r   r%   s   @@r   rx   rt   f   s     A r   zYclass X:
                __class__
                def f():
                    __class__Nc                   6   a a ] tR t^qt o^*sV 3R ltRtVtV ;t# )rt   c                    < S  R # rJ   r	   r{   s   r   r   rv   t   r|   r   r	   )	r   r   r   r   r%   r   r   r   r.   r/   s   @@r   rx   rt   q   s     I r   r%   c                   8   <a a ] tR t^yt o^*oV 3R ltRtVtV ;t# )rt   c                    < S  R # rJ   r	   r{   s   r   r   rv   |   r|   r   r	   rn   r~   s   @@r   rx   rt   y   s     I r   )r   rQ   r   r%   assertIsr}   typeassertRaises	NameErrorexecglobals	exceptionassertNotIn__dict__)r   rx   r}   rc   r%   s   &   r   "test_various___class___pathologies,TestSuper.test_various___class___pathologies]   s   	 	 C$c*	 	 	acc4:&y))Q ! #*)R1 *
 	d1;;'3	 	
 	;/4Ik"ajj1	 	
 	B'' *)s   #EE-	c                d     ! R  R4      pV P                  V! 4       P                  4       V4       R# )c                   2   a a ] tR t^t oV 3R ltRtVtV ;t# )2TestSuper.test___class___instancemethod.<locals>.Xc                   < S# rJ   r	   r$   s   &r   r   4TestSuper.test___class___instancemethod.<locals>.X.f   	      r   r	   rn   r/   s   @@r   rx   r           ! !r   rx   Nr   r   r   rx   s   & r   test___class___instancemethod'TestSuper.test___class___instancemethod   s$    	! 	! 	aceegq!r   c                Z     ! R  R4      pV P                  VP                  4       V4       R# )c                   <   a a ] tR t^t o]V 3R l4       tRtVtV ;t# )/TestSuper.test___class___classmethod.<locals>.Xc                   < S# rJ   r	   r*   s   &r   r   1TestSuper.test___class___classmethod.<locals>.X.f   	      r   r	   )	r   r   r   r   r   r   r   r   r.   r/   s   @@r   rx   r      s     ! ! !r   rx   Nr   r   s   & r   test___class___classmethod$TestSuper.test___class___classmethod   "    	! 	! 	acceQr   c                Z     ! R  R4      pV P                  VP                  4       V4       R# )c                   <   a a ] tR t^t o]V 3R l4       tRtVtV ;t# )0TestSuper.test___class___staticmethod.<locals>.Xc                    < S # rJ   r	   r{   s   r   r   2TestSuper.test___class___staticmethod.<locals>.X.f   r   r   r	   	r   r   r   r   staticmethodr   r   r   r.   r/   s   @@r   rx   r           ! ! !r   rx   Nr   r   s   & r   test___class___staticmethod%TestSuper.test___class___staticmethod   r   r   c                l   a R o ! V3R lR\         4      p ! R RVR7      pV P                  SV4       R # )Nc                   6   <a a ] tR t^t oV V3R ltRtVtV ;t# )*TestSuper.test___class___new.<locals>.Metac                H   < \         SV `  WW#4      pVP                  4       oV# rJ   )r#   __new__r   )r   namebases	namespacer   r%   
test_classs   &&&& r   r   2TestSuper.test___class___new.<locals>.Meta.__new__   s#    ws%C!VVX
r   r	   r   r   r   r   r   r   r   r.   r%   r   r   s   @@r   Metar      s      r   r   c                   <   a a ] tR t^t o]V 3R l4       tRtVtV ;t# )'TestSuper.test___class___new.<locals>.Ac                    < S # rJ   r	   r{   s   r   r   )TestSuper.test___class___new.<locals>.A.f   r   r   r	   r   r/   s   @@r   r   r      r   r   r   	metaclassr   r   r   r   r   r   s   &  @r   test___class___newTestSuper.test___class___new   s2     
	4 		!$ 	!
 	j!$r   c                   a R o ! V3R lR\         4      p ! R RVR7      pV P                  VR 4       \        RRS4      pV P                  VP                  4       V4       R # )Nc                   .   <a  ] tR t^t o V3R ltRtV tR# ).TestSuper.test___class___delayed.<locals>.Metac                   < VoR # rJ   r	   )r   r   r   r   test_namespaces   &&&&r   r   6TestSuper.test___class___delayed.<locals>.Meta.__new__   s    !*r   r	   N)r   r   r   r   r   r   r   )r   r   s   @r   r   r      s      r   r   c                   <   a a ] tR t^t o]V 3R l4       tRtVtV ;t# )+TestSuper.test___class___delayed.<locals>.Ac                    < S # rJ   r	   r{   s   r   r   -TestSuper.test___class___delayed.<locals>.A.f   r   r   r	   r   r/   s   @@r   r   r      r   r   r   r   r   r	   )r   r   r   )r   r   r   r   r   s   &   @r   test___class___delayed TestSuper.test___class___delayed   sR    	4 		!$ 	!
 	ab.)acceQr   c                l   a R o ! R R\         4      p ! V3R lRVR7      pV P                  SV4       R # )Nc                   2   a a ] tR t^t oV 3R ltRtVtV ;t# )*TestSuper.test___class___mro.<locals>.Metac                P   < V P                   R ,          ! 4        \        SV `	  4       # )r   )r   r#   mror$   s   &r   r   .TestSuper.test___class___mro.<locals>.Meta.mro   s    c"$w{}$r   r	   )r   r   r   r   r   r   r   r.   r/   s   @@r   r   r      s     % %r   r   c                   6   <a a ] tR t^t oV V3R ltRtVtV ;t# )'TestSuper.test___class___mro.<locals>.Ac                    < S oR # rJ   r	   )r%   r   s   r   r   )TestSuper.test___class___mro.<locals>.A.f   s    &
r   r	   rn   r   s   @@r   r   r      s     ' 'r   r   r   r   r   s   &  @r   test___class___mroTestSuper.test___class___mro   s0    
	%4 	%	'$ 	'
 	j!$r   c                  a  ! V3R  lR\         4      pRo ! R RVR7      pV P                  RS4       Ro ! R RVR7      pSR,          pVP                  P                  pV P	                  \        V4      ^4       V P                  WE^ ,          4       V P                  \        4      ;_uu_ 4        VP                   RRR4       R#   + '       g   i     R# ; i)	c                   6   <a a ] tR t^t oV V3R ltRtVtV ;t# )=TestSuper.test___classcell___expected_behaviour.<locals>.Metac                D   < VP                  4       o\        SV `	  WW#4      # rJ   )copyr#   r   )r   r   r   r   r%   namespace_snapshots   &&&&r   r   ETestSuper.test___classcell___expected_behaviour.<locals>.Meta.__new__   s!    %.^^%5"ws%CCr   r	   r   )r%   r   r   s   @@r   r   r      s     D Dr   r   Nc                       ] tR t^tRtR# )HTestSuper.test___classcell___expected_behaviour.<locals>.WithoutClassRefr	   NrA   r	   r   r   WithoutClassRefr          r   r   r   r.   c                   2   a a ] tR t^t oV 3R ltRtVtV ;t# )ETestSuper.test___classcell___expected_behaviour.<locals>.WithClassRefc                   < S# rJ   r	   r$   s   &r   r   GTestSuper.test___classcell___expected_behaviour.<locals>.WithClassRef.f   r   r   r	   rn   r/   s   @@r   WithClassRefr      r   r   r   )
r   r   r   __closure__rQ   lenr   r   AttributeErrorr.   )r   r   r   r   
class_cellmethod_closurer   s   &     @r   %test___classcell___expected_behaviour/TestSuper.test___classcell___expected_behaviour   s    	D4 	D "	 	*<=
 "	!T 	! (8
%33^,a0j"34~..&& /...s   1CC	c                     ! R  R\         4      p ! R RVR7      pRpV P                  \        V4      ;_uu_ 4         ! R RVR7      pRRR4       R#   + '       g   i     R# ; i)	c                   2   a a ] tR t^t oV 3R ltRtVtV ;t# )2TestSuper.test___classcell___missing.<locals>.Metac                H   < VP                  R R4       \        SV `	  WW#4      # )r.   N)popr#   r   )r   r   r   r   r%   s   &&&&r   r   :TestSuper.test___classcell___missing.<locals>.Meta.__new__   s"    ot4ws%CCr   r	   r   r/   s   @@r   r   r           D Dr   r   c                       ] tR t^tRtR# )=TestSuper.test___classcell___missing.<locals>.WithoutClassRefr	   NrA   r	   r   r   r   r      r   r   r   r   z+__class__ not set.*__classcell__ propagatedc                   2   a a ] tR tRt oV 3R ltRtVtV ;t# ):TestSuper.test___classcell___missing.<locals>.WithClassRefi  c                   < S# rJ   r	   r$   s   &r   r   <TestSuper.test___classcell___missing.<locals>.WithClassRef.f  	    $$r   r	   rn   r/   s   @@r   r   r          % %r   r   N)r   assertRaisesRegexRuntimeError)r   r   r   expected_errorr   s   &    r   test___classcell___missing$TestSuper.test___classcell___missing   sS    	D4 	D	 	 G##L.AA% % BAAAs   AA$	c                F    ! R  R\         4      pR^ R\        4       3 FX  pV P                  VR7      ;_uu_ 4        V P                  \        4      ;_uu_ 4         ! R RWR7      pRRR4       RRR4       KZ  	  R#   + '       g   i     L; i  + '       g   i     K  ; i)c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# )4TestSuper.test___classcell___overwrite.<locals>.Metai  c                ,   < WCR &   \         SV `  WW#4      # )r.   r#   r   )r   r   r   r   cellr%   s   &&&&&r   r   <TestSuper.test___classcell___overwrite.<locals>.Meta.__new__	  s    -1/*ws%CCr   r	   r   r/   s   @@r   r   r    r   r   r   N )bad_cellc                       ] tR tRtRtR# )1TestSuper.test___classcell___overwrite.<locals>.Ai  r	   NrA   r	   r   r   r   r    s    r   r   )r   r  )r   objectsubTestr   	TypeError)r   r   r  r   s   &   r   test___classcell___overwrite&TestSuper.test___classcell___overwrite  su    	D4 	D
 q"fh/Hx00&&y11d  2 10 011 100s#   BA<&B<BBB c                     ! R  R\         4      pV P                  \        4      ;_uu_ 4         ! R RVR7      pRRR4       R#   + '       g   i     R# ; i)c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# )5TestSuper.test___classcell___wrong_cell.<locals>.Metai  c                B   < \         SV `  WW#4      p \        R RV4      pV # )r   r	   )r#   r   r   )r   r   r   r   r   r%   s   &&&& r   r   =TestSuper.test___classcell___wrong_cell.<locals>.Meta.__new__  s&    gocBb),
r   r	   r   r/   s   @@r   r   r    s      r   r   c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# )2TestSuper.test___classcell___wrong_cell.<locals>.Ai  c                   < S# rJ   r	   r$   s   &r   r   4TestSuper.test___classcell___wrong_cell.<locals>.A.f  r   r   r	   rn   r/   s   @@r   r   r    r   r   r   r   N)r   r   r  )r   r   r   s   &  r   test___classcell___wrong_cell'TestSuper.test___classcell___wrong_cell  s<    	4 	 y))%d % *)))s   AA	c                  < V3R  lpV P                  \        R4      ;_uu_ 4        V! 4        RRR4        ! R R4      pV P                  \        R4      ;_uu_ 4        VP                  4        RRR4       V3R lpV P                  \        R4      ;_uu_ 4        V! R4       RRR4        ! R R4      pV P                  \        R	4      ;_uu_ 4        V! 4       P                  4        RRR4       R#   + '       g   i     L; i  + '       g   i     L; i  + '       g   i     L~; i  + '       g   i     R# ; i)
c                     < \        4        R # rJ   r#   r{   s   r   r   .TestSuper.test_obscure_super_errors.<locals>.f"  s    Gr   zno argumentsNc                   2   a a ] tR tRt oV 3R ltRtVtV ;t# ).TestSuper.test_obscure_super_errors.<locals>.Ci'  c                    < \        4        R # rJ   r#  r{   s   r   r   0TestSuper.test_obscure_super_errors.<locals>.C.f(      r   r	   rn   r/   s   @@r   r2   r&  '        r   r2   c                    < ? \        4        R # rJ   r#  r}   r%   s   &r   r   r$  -  s    Gr   zarg\[0\] deletedc                   2   a a ] tR tRt oV 3R ltRtVtV ;t# ).TestSuper.test_obscure_super_errors.<locals>.Xi3  c                   < >\        4        R # rJ   r#  r,  s   &r   r   0TestSuper.test_obscure_super_errors.<locals>.X.f4  s    r   r	   rn   r/   s   @@r   rx   r.  3  s      r   rx   zempty __class__ cell)r  r  r   )r   r   r2   rx   r%   s   &   r   test_obscure_super_errors#TestSuper.test_obscure_super_errors!  s    	##L/BBC C	 	 ##L/BBCCE C	 ##L2EFFdG G	 	
 ##L2IJJCEEG KJ) CB CB GF KJJs/   C4D	DD-4D	D	D*	-D>	c                   a  ! R  R4      oV3R lpV! 4       P                   ^ ,          pV P                  \        SP                  V4       R# )c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# )&TestSuper.test_cell_as_self.<locals>.Xi<  c                   < \        4        R # rJ   r#  r$   s   &r   meth+TestSuper.test_cell_as_self.<locals>.X.meth=  r)  r   r	   )r   r   r   r   r7  r   r   r.   r/   s   @@r   rx   r5  <  r*  r   rx   c                  $   <a S! 4       oV3R  lp V # )c                     < S # rJ   r	   )ks   r   g1TestSuper.test_cell_as_self.<locals>.f.<locals>.gB  s    r   r	   )r<  r;  rx   s    @r   r   &TestSuper.test_cell_as_self.<locals>.f@  s    AHr   N)r   r   r  r7  )r   r   crx   s   &  @r   test_cell_as_selfTestSuper.test_cell_as_self;  s:    	 		
 COOA)QVVQ/r   c                   < \        \        R 4      p\        R4       F  p\         P                  V\        V4       K   	  R# )g      ?i  N)r#   floatrange__init__int)r   spir%   s   &  r   test_super_init_leaksTestSuper.test_super_init_leaksH  s/    
 5#tANN2sA& r   c                   < V P                  \        R 4      ;_uu_ 4        \        \        \        \        4       RRR4       R#   + '       g   i     R# ; i)zexpected at mostNr  r  r#   rF  r$   s   &r   test_super_argcountTestSuper.test_super_argcountQ  s3    ##I/ABB#sC  CBBBs   AA	c                   < V P                  \        R 4      ;_uu_ 4        \        ^\        4       RRR4       R#   + '       g   i     R# ; i)argument 1 must be a typeNrL  r$   s   &r   test_super_argtypeTestSuper.test_super_argtypeU  s0    ##I/JKK!SM LKKKs	   ;A	c                :   \         P                  ! R 4      p\        P                  ! RVR7      ;_uu_ 4        ^ RIpRRR4       V P                  XP                  4       P                  4       R4       \        P                  ! R4       R#   + '       g   i     LV; i)z
            class super:
                msg = "truly super"

            class C:
                def method(self):
                    return super().msg
            shadowed_super)r   sourceNztruly super)	textwrapdedentr   ready_to_importrT  rQ   r2   methodunload)r   rU  rT  s   &  r   test_shadowed_globalTestSuper.test_shadowed_globalY  so    	
 **0@PP! Q))+224mD-. QPs   B

B	c                   a  ! R  R4      o ! V3R lR4      pV P                  V! 4       P                  4       R4       R# )c                       ] tR tRtRtRtR# ),TestSuper.test_shadowed_local.<locals>.superij  quite superr	   Nr   r   r   r   msgr   r	   r   r   r#   r_  j      Cr   r#   c                   6   <a a ] tR tRt oV V3R ltRtVtV ;t# )(TestSuper.test_shadowed_local.<locals>.Cim  c                &   < S! 4       P                   # rJ   )rb  )r   r%   r#   s   &r   rY  /TestSuper.test_shadowed_local.<locals>.C.methodn  s    w{{"r   r	   r   r   r   r   rY  r   r   r.   )r%   r   r#   s   @@r   r2   re  m  s     # #r   r2   r`  N)rQ   rY  )r   r2   r#   s   & @r   test_shadowed_localTestSuper.test_shadowed_locali  s1    	  	 	# 	# 	}5r   c                     ! R  R4      p ! R R4      p\        \         R2V4      ;_uu_ 4       pV P                  V! 4       P                  4       R4       RRR4       R#   + '       g   i     R# ; i)c                       ] tR tRtRtRtR# )0TestSuper.test_shadowed_dynamic.<locals>.MySuperit  super superr	   Nra  r	   r   r   MySuperrm  t  rc  r   ro  c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# )*TestSuper.test_shadowed_dynamic.<locals>.Ciw  c                   < \         SV `  # rJ   r#   rb  r$   s   &r   rY  1TestSuper.test_shadowed_dynamic.<locals>.C.methodx      w{"r   r	   rh  r/   s   @@r   r2   rq  w       # #r   r2   .superrn  Nr   r   rQ   rY  )r   ro  r2   ms   &   r   test_shadowed_dynamicTestSuper.test_shadowed_dynamics  sU    	  	 	# 	# hZv&00AQSZZ\=9 1000s   &A  A1	c                  a . o ! V3R  lR4      p ! R R4      p\        \         R2V4      ;_uu_ 4       pV P                  V! 4       P                  4       R4       V P                  SR.4       RRR4       R#   + '       g   i     R# ; i)c                   2   <a  ] tR tRt o V3R ltRtRtV tR# )8TestSuper.test_shadowed_dynamic_two_arg.<locals>.MySuperi  c                *   < SP                  V4       R # rJ   )append)r   args	call_argss   &*r   rE  ATestSuper.test_shadowed_dynamic_two_arg.<locals>.MySuper.__init__  s      &r   rn  r	   N)r   r   r   r   rE  rb  r   r   )r   r  s   @r   ro  r~    s     'Cr   ro  c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# )2TestSuper.test_shadowed_dynamic_two_arg.<locals>.Ci  c                   < \         ^^`  #    rs  r$   s   &r   rY  9TestSuper.test_shadowed_dynamic_two_arg.<locals>.C.method  s    Q&r   r	   rh  r/   s   @@r   r2   r    s     ' 'r   r2   rw  rn  N)r     rx  )r   ro  r2   ry  r  s   &   @r   test_shadowed_dynamic_two_arg'TestSuper.test_shadowed_dynamic_two_arg~  sm    		  	 
	' 	' hZv&00AQSZZ\=9Y1 1000s   9A99B
	c                     ! R  R4      pV P                  \        R4      ;_uu_ 4        V! 4       P                  4        RRR4       R#   + '       g   i     R# ; i)c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# ))TestSuper.test_attribute_error.<locals>.Ci  c                   < \         SV `  # rJ   rs  r$   s   &r   rY  0TestSuper.test_attribute_error.<locals>.C.method  ru  r   r	   rh  r/   s   @@r   r2   r    rv  r   r2   z%'super' object has no attribute 'msg'N)r  r   rY  r   r2   s   & r   test_attribute_errorTestSuper.test_attribute_error  s=    	# 	# ##N4[\\CJJL ]\\\   A		A	c                     ! R  R4      pV P                  \        R4      ;_uu_ 4        V! 4       P                  4        RRR4       R#   + '       g   i     R# ; i)c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# )'TestSuper.test_bad_first_arg.<locals>.Ci  c                    < \         ^V `  4       # r  r#   rY  r$   s   &r   rY  .TestSuper.test_bad_first_arg.<locals>.C.method  s    Q,..r   r	   rh  r/   s   @@r   r2   r    s     / /r   r2   rP  N)r  r  rY  r  s   & r   test_bad_first_argTestSuper.test_bad_first_arg  s=    	/ 	/ ##I/JKKCJJL LKKKr  c           
     J    ! R  R4      pV! 4       pRp\         V\         P                  VP                  R3V\        4       VP                  \        P                  R3V\        VP                  \        P                  R33pV Fv  pV P                  VR7      ;_uu_ 4        Vw  rgrp
VP	                  WV4      pV P                  \        V4      ;_uu_ 4        VP                  Wg4       RRR4       RRR4       Kx  	  R#   + '       g   i     L; i  + '       g   i     K  ; i)c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# ))TestSuper.test_supercheck_fail.<locals>.Ci  c                   < \         W`  4       # rJ   r  )r   type_objr%   s   &&&r   rY  0TestSuper.test_supercheck_fail.<locals>.C.method  s    U/11r   r	   rh  r/   s   @@r   r2   r    s     2 2r   r2   zOsuper\(type, obj\): obj \({} {}\) is not an instance or subtype of type \({}\).zinstance ofr   )caseN)rF  r   listr  formatr  r  rY  )r   r2   r?  err_msgcasesr  r  r  type_strobj_strinstance_or_typeregexs   &           r   test_supercheck_failTestSuper.test_supercheck_fail  s    	2 	2 C6 	 !S\\1::}=

DMM=Aajj$--8
 D4((BF?H/?'7(K++Iu==HHU( >	 )( 
 >=	 )((s$   7DC>(D>D	DD"c                n   <  ! R  R4      pV P                  V! 4       P                  4       \        4       R# )c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# ))TestSuper.test_super___class__.<locals>.Ci  c                ,   < \        4       P                  # rJ   )r#   r%   r$   s   &r   rY  0TestSuper.test_super___class__.<locals>.C.method  s    w(((r   r	   rh  r/   s   @@r   r2   r    s     ) )r   r2   N)rQ   rY  r#   )r   r2   r%   s   & r   test_super___class__TestSuper.test_super___class__  s'    	) 	) 	u-r   c                   <aa  ! R  R\         4      o ! VV3R lR4      oV P                  S! 4       P                  4       S4       R# )c                       ] tR tRtRtR# )8TestSuper.test_super_subclass___class__.<locals>.mysuperi  r	   NrA   r	   r   r   mysuperr    r   r   r  c                   0   <a  ] tR tRt o VV3R ltRtV tR# )2TestSuper.test_super_subclass___class__.<locals>.Ci  c                *   < S! SV 4      P                   # rJ   r{   )r   r2   r  s   &r   rY  9TestSuper.test_super_subclass___class__.<locals>.C.method  s    q$'111r   r	   N)r   r   r   r   rY  r   r   )r   r2   r  s   @r   r2   r    s     2 2r   r2   N)r#   rQ   rY  )r   r2   r  r%   s   &@@r   test_super_subclass___class__'TestSuper.test_super_subclass___class__  s3    	e 		2 	2 	w/r   c                   <a a  ! R  R\         4      oVVV 3R lp\        P                  ! R4      p\        VP                  4       F  pV! R4       K  	  R# )c                       ] tR tRtRtR# )/TestSuper.test_unusual_getattro.<locals>.MyTypei  r	   NrA   r	   r   r   MyTyper    r   r   r  c                    < S! V S3/ 4      p\         S\        V4      `  VR ^4       SP                  VP                  ^4       R# )barN)r#   r   __setattr__rQ   r  )r   mytyper  r%   r   s   & r   test-TestSuper.test_unusual_getattro.<locals>.test  s>    D6)R0F&$v,3FE1EVZZ+r   _testinternalcapifoo1N)r   r   import_modulerD  SPECIALIZATION_THRESHOLD)r   r  r  _r  r%   s   f   @r   test_unusual_getattroTestSuper.test_unusual_getattro  sF    	T 		,
 *778KL(AABAL Cr   c                     ! R  R4      p ! R RV4      p ! R RV4      p\         P                  ! R4      p\        VP                  4       F
  pV! 4        K  	  R# )c                   ,   a  ] tR tRt o R tR tRtV tR# )(TestSuper.test_reassigned_new.<locals>.Ai  c                    R # rJ   r	   r   s   &r   r   0TestSuper.test_reassigned_new.<locals>.A.__new__  s    r   c                N    R V P                   9  d   V P                  V n        R# R# )r   N)r   r   r   s   &r   __init_subclass__:TestSuper.test_reassigned_new.<locals>.A.__init_subclass__  s    CLL0"%++CK 1r   r	   N)r   r   r   r   r   r  r   r   r   s   @r   r   r    s     . .r   r   c                       ] tR tRtRtR# )(TestSuper.test_reassigned_new.<locals>.Bi  r	   NrA   r	   r   r   r   r    r   r   r   c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# )(TestSuper.test_reassigned_new.<locals>.Ci  c                "   < \         SV `  V 4      # rJ   r
  r*   s   &r   r   0TestSuper.test_reassigned_new.<locals>.C.__new__  s    ws++r   r	   r   r/   s   @@r   r2   r    s     , ,r   r2   r  N)r   r  rD  r  r   r   r   r2   r  r  s   &     r   test_reassigned_newTestSuper.test_reassigned_new  sT    	. 	.	 		, 	, *778KL(AABAC Cr   c                   a   ! V 3R  lR4      p ! R RV4      p ! R RV4      p\         P                  ! R4      p\        VP                  4       F  pVP	                  V4       K  	  R# )c                   8   <a  ] tR tRt o ]V3R l4       tRtV tR# )6TestSuper.test_mixed_staticmethod_hierarchy.<locals>.Ai  c                L   < SP                  V4       SP                  V4       R # rJ   )assertFalse)r   r  kwargsr   s   &*,r   some;TestSuper.test_mixed_staticmethod_hierarchy.<locals>.A.some  s      &  (r   r	   N)r   r   r   r   r   r  r   r   )r   r   s   @r   r   r    s     ) )r   r   c                   2   a a ] tR tRt oV 3R ltRtVtV ;t# )6TestSuper.test_mixed_staticmethod_hierarchy.<locals>.Bi  c                ,   < \         SV `  ! V .VO5/ VB # rJ   r#   r  )r   r  r  r%   s   &*,r   r  ;TestSuper.test_mixed_staticmethod_hierarchy.<locals>.B.some  s    w|C9$9&99r   r	   )r   r   r   r   r  r   r   r.   r/   s   @@r   r   r    s     : :r   r   c                   <   a a ] tR tRt o]V 3R l4       tRtVtV ;t# )6TestSuper.test_mixed_staticmethod_hierarchy.<locals>.Ci  c                "   < \         SV `  V 4      # rJ   r  r*   s   &r   r  ;TestSuper.test_mixed_staticmethod_hierarchy.<locals>.C.some  s    w|C((r   r	   )	r   r   r   r   r   r  r   r   r.   r/   s   @@r   r2   r    s     ) ) )r   r2   r  N)r   r  rD  r  r  r  s   f     r   !test_mixed_staticmethod_hierarchy+TestSuper.test_mixed_staticmethod_hierarchy  s[    	) 	)	: 	:	) 	)
 *778KL(AABAFF1I Cr   c                  aaa  ! R R4      o ! R R4      oS! 4       oVVV3R lp. p\        ^4       F;  p\        P                  ! VR7      pVP                  4        VP	                  V4       K=  	  V F  pVP                  4        K  	  R# )zNote: this test isn't actually testing anything on its own.
It requires a sys audithook to be set to crash on older Python.
This should be the case anyways as our test suite sets
an audit hook.
c                       ] tR tRtRtR# )@TestSuper.test___class___modification_multithreaded.<locals>.Fooi  r	   NrA   r	   r   r   Foor    r   r   r  c                       ] tR tRtRtR# )@TestSuper.test___class___modification_multithreaded.<locals>.Bari
  r	   NrA   r	   r   r   Barr  
  r   r   r  c                  x   < Sp \        ^4       F'  pSV n        \        V 4       SV n        \        V 4       K)  	  R# )   N)rD  r%   r   )foor  r  r  things     r   workATestSuper.test___class___modification_multithreaded.<locals>.work  s2    C3Z #S	 #S		  r   )targetN)rD  	threadingThreadstartr  join)r   r  threadsr  threadr  r  r   s   &    @@@r   )test___class___modification_multithreaded3TestSuper.test___class___modification_multithreaded  st    	 		 	 	 qA%%T2FLLNNN6" 
 FKKM r   c                  < \        4       \         3 F  p\        \        V4      pV P                  VP                  VP                  4       V P                  VP
                  VP
                  4       V P                  VP                  VP                  4       V P                  VR 4       V P                  VR4       V P                  VR4       V P                  VR4       V P                  VR4       K  	  R# )__getnewargs____getnewargs_ex____setstate____copy____deepcopy__N)r@   r#   r2   rQ   
__reduce____reduce_ex____getstate__assertNotHasAttr)r   rc   sr%   s   &  r   test_special_methodsTestSuper.test_special_methods   s    aAaAQ\\1<<8Q__aoo>Q^^Q^^<!!!%56!!!%89!!!^4!!!Z0!!!^4 r   c           	       < \        4       p^Vn        \        \        V4      p\	        \
        P                  ^,           4       EF2  pV P                  VR7      ;_uu_ 4        \
        P                  ! \
        P                  ! W#4      4      pV P                  VP                  4       VP                  4       4       V P                  \        V4      \        V4      4       V P                  \        VP                  4      \         4       V P                  VP                  P                  ^4       V P                  VP                  \        4       V P                  VP                   \         4       RRR4       EK5  	  \        \        \         4      p\	        \
        P                  ^,           4       EF)  pV P                  VR7      ;_uu_ 4        \
        P                  ! \
        P                  ! W#4      4      pV P                  VP#                  4       VP#                  4       4       V P                  VP                  VP                  4       V P                  \        V4      \        V4      4       V P                  VP                  \         4       V P                  VP                  \        4       V P                  VP                   \         4       RRR4       EK,  	  R#   + '       g   i     EK  ; i  + '       g   i     EKW  ; i)r  )protoN)r@   r}   r#   r2   rD  pickleHIGHEST_PROTOCOLr  loadsdumpsrQ   r   r   r   __self____thisclass____self_class__r   )r   rc   r  r  ur%   s   &    r   test_picklingTestSuper.test_pickling,  s   C!QK622Q67EE**LLa!78  .d1gtAw/d1::.2  q1aooq1a..2 +* 8 !QK622Q67EE**LLa!78  0  acc*d1gtAw/ajj!,aooq1a..2 +* 8 +** +**s   !DKDK3K03Lc                   < \        \        \        4       4      pV P                  \        P                  ! V4      V4       \        \        \        4      pV P                  \        P                  ! V4      V4       R # rJ   )r#   r2   r@   r   r   )r   r  r%   s   & r   test_shallow_copyingTestSuper.test_shallow_copyingE  sG    !QSMdiilA&!QKdiilA&r   c                  < \        4       p^.Vn        \        \        V4      p\        P
                  ! V4      pV P                  VP                  4       VP                  4       4       V P                  \        V4      \        V4      4       V P                  W24       V P                  \        VP                  4      \         4       V P                  VP                  V4       V P                  VP                  P                  VP                  4       V P                  VP                  P                  ^.4       V P                  VP                  \        4       V P                  VP                  \         4       \        \        \         4      p\        P
                  ! V4      pV P                  VP                  4       VP                  4       4       V P                  VP                  VP                  4       V P                  W24       V P                  \        V4      \        V4      4       V P                  VP                  \         4       V P                  VP                  \        4       V P                  VP                  \         4       R# )r  N)r@   r}   r#   r2   r   deepcopyrQ   r   r   r   assertIsNotr  r   r!  r   )r   rc   r  r"  r%   s   &   r   test_deep_copyingTestSuper.test_deep_copyingK  s   Cc!QKMM!&d1gtAw'd1::&*Q'qss+s+aooq)a&&*!QKMM!(acc"d1gtAw'ajj!$aooq)a&&*r   r	   )2r   r   r   r   rK   rR   rU   rX   r\   r_   rd   rp   r   r   r   r   r   r   r   r   r  r  r  r1  r@  rI  rM  rQ  r[  ri  rz  r  r  r  r  r  r  r  r  r  r   requires_working_threadingr
  r  r#  r&  r+  r   r   r.   r/   s   @@r   rH   rH   1   s     
*+++-I	(!(F"  %& (%"'>%.%40'!/ 6	:2)6.0(* 002 3@
532'+ +r   rH   __main__)__doc__r   r  rV  r  unittestunittest.mockr   test.supportr   r   r   r   r2   r9   r@   rD   rF   TestCaserH   r   mainr	   r   r   <module>r5     s    ?       8 ( (( ((1 (	 	 	 	q+!! q+h zMMO r   