
    7bh&;                     0   	 d dl Z d dlZd dlZd dlmZ d dlmZmZ dZ G d d      Z	 G d de	      Z
 G d	 d
e	      Z G d dee
      Z G d de      Z G d de      Z G d de	      Z G d dej                         Zedk(  r ej&                          yy)    N)patch)import_helperthreading_helper   c                   "    e Zd Zd Zed        Zy)Ac                      yNr    selfs    9/opt/python-3.12.12/usr/lib/python3.12/test/test_super.pyfzA.f   s        c                 
    | dfS r
   r   clss    r   cmzA.cm   s    Szr   N)__name__
__module____qualname__r   classmethodr   r   r   r   r   r      s     r   r   c                   2     e Zd Z fdZe fd       Z xZS )Bc                 &    t         |          dz   S Nr   superr   r   	__class__s    r   r   zB.f       wy{S  r   c                 &    | t         |          dfS r   r   r   r   r    s    r   r   zB.cm       UWZ\3''r   r   r   r   r   r   r   __classcell__r    s   @r   r   r          !( (r   r   c                   2     e Zd Z fdZe fd       Z xZS )Cc                 &    t         |          dz   S Nr+   r   r   s    r   r   zC.f   r!   r   c                 &    | t         |          dfS r-   r#   r$   s    r   r   zC.cm   r%   r   r&   r(   s   @r   r+   r+      r)   r   r+   c                   (     e Zd Z fdZ fdZ xZS )Dc                 &    t         |          dz   S Nr0   r   r   s    r   r   zD.f#   r!   r   c                 &    | t         |          dfS r2   r#   r$   s    r   r   zD.cm%   s    UWZ\3''r   )r   r   r   r   r   r'   r(   s   @r   r0   r0   "   s    !( (r   r0   c                       e Zd Zy)ENr   r   r   r   r   r   r5   r5   (       r   r5   c                   $    e Zd Zej                  Zy)FN)r   r   r   r5   r   r   r   r   r9   r9   +   s    	Ar   r9   c                       e Zd Zy)GNr6   r   r   r   r;   r;   .   r7   r   r;   c                   8    e Zd Z fdZd Zd Zd Zd Zd Zd Z	d Z
 fd	Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Z fdZd Z fdZ fdZ fdZd Zd Zd Zd Zd Zd Z  fdZ! fd Z" fd!Z#d" Z$d# Z% e&jN                         d$        Z( xZ)S )%	TestSuperc                     t         y N)r=   r   s    r   tearDownzTestSuper.tearDown4   s
     	r   c                 T    | j                  t               j                         d       y NABCDassertEqualr0   r   r   s    r   test_basics_workingzTestSuper.test_basics_working9   s    &)r   c                 ^    | j                  t        j                  t                     d       y rB   rD   r   s    r   test_class_getattr_workingz$TestSuper.test_class_getattr_working<   s    QS6*r   c                     | j                  t               j                         d       | j                  t        j                  t                     d       y rB   )rE   r5   r   r   s    r   !test_subclass_no_override_workingz+TestSuper.test_subclass_no_override_working?   4    &)QS6*r   c                     | j                  t               j                         d       | j                  t        j                  t                     d       y rB   )rE   r9   r   r   s    r   $test_unbound_method_transfer_workingz.TestSuper.test_unbound_method_transfer_workingC   rK   r   c                 d   | j                  t        j                         t        df       | j                  t               j                         t        df       | j                  t        j                         t        df       | j                  t               j                         t        df       y r
   )rE   r   r   r;   r   s    r    test_class_methods_still_workingz*TestSuper.test_class_methods_still_workingG   sn    !S*As8,!S*As8,r   c                    t               }| j                  |j                         |t         t         t         dfdfdfdf       t               }| j                  |j                         |t        t        t        dfdfdfdf       y )Nr   r   r+   r0   )r0   rE   r   r5   )r   des      r   #test_super_in_class_methods_workingz-TestSuper.test_super_in_class_methods_workingM   sn    C!a!aXs);S%A3!GHC!a!aXs);S%A3!GHr   c                 l     G d dt               }| j                   |       j                         d       y )Nc                        e Zd Z fdZ xZS ),TestSuper.test_super_with_closure.<locals>.Ec                 2      fd}t                   dz   S )Nc                  
      y r?   r   r   s   r   nestedz>TestSuper.test_super_with_closure.<locals>.E.f.<locals>.nestedX   s    r   r5   r   )r   rY   r    s   ` r   r   z.TestSuper.test_super_with_closure.<locals>.E.fW   s    wy{S((r   r   r   r   r   r'   r(   s   @r   r5   rV   V   s    ) )r   r5   AE)r   rE   r   )r   r5   s     r   test_super_with_closurez!TestSuper.test_super_with_closureS   s(    	) 	) 	$'r   c                     G d dt               } |       }| j                  |j                         d       | j                  |j                  d        G fdd      }| j	                  |j
                  t        |              | j                  t              5 }t        dt               i        d d d        | j	                  t        j                        t                G d d      }| j                  t               d   d	       t               d= | j                  d|j                          G fd
d      }| j                  d	       y # 1 sw Y   xY w)Nc                   "     e Zd Z fdZdZ xZS )7TestSuper.test_various___class___pathologies.<locals>.Xc                      t         |          S r?   r   r   s    r   r   z9TestSuper.test_various___class___pathologies.<locals>.X.fa   s    wy{"r     )r   r   r   r   r    r'   r(   s   @r   Xr_   `   s    #Ir   rb   r   ra   c                   &     e Zd ZW Z fdZ xZS )r_   c                  
      y r?   r   r(   s   r   r   z9TestSuper.test_various___class___pathologies.<locals>.X.fi       r   )r   r   r   xr   r'   r    r    s   @r   rb   z7TestSuper.test_various___class___pathologies.<locals>.Xg   s    A r   zYclass X:
                __class__
                def f():
                    __class__c                   "     e Zd Zda fdZ xZS )r_   *   c                  
      y r?   r   r(   s   r   r   z9TestSuper.test_various___class___pathologies.<locals>.X.fu   re   r   )r   r   r   r    r   r'   r(   s   @r   rb   z7TestSuper.test_various___class___pathologies.<locals>.Xr   s    I r   r    ri   c                   $     e Zd Zd fdZ xZS )r_   ri   c                  
      y r?   r   r(   s   r   r   z9TestSuper.test_various___class___pathologies.<locals>.X.f}   re   r   rZ   rg   s   @r   rb   z7TestSuper.test_various___class___pathologies.<locals>.Xz   s    I r   )r   rE   r   r    assertIsrf   typeassertRaises	NameErrorexecglobals	exceptionassertNotIn__dict__)r   rb   rf   rR   r    s       r   "test_various___class___pathologiesz,TestSuper.test_various___class___pathologies^   s   	 	 C$c*	 	 	acc4:&y)Q ! #*)R1 *
 	d1;;'3	 	
 	;/4Ik"ajj1	 	
 	B'' *)s   EEc                 b     G d d      }| j                   |       j                         |       y )Nc                        e Zd Z fdZ xZS )2TestSuper.test___class___instancemethod.<locals>.Xc                     S r?   r   r   s    r   r   z4TestSuper.test___class___instancemethod.<locals>.X.f   	      r   rZ   r(   s   @r   rb   ry          ! !r   rb   rm   r   r   rb   s     r   test___class___instancemethodz'TestSuper.test___class___instancemethod   s$    	! 	! 	aceegq!r   c                 X     G d d      }| j                  |j                         |       y )Nc                   (     e Zd Ze fd       Z xZS )/TestSuper.test___class___classmethod.<locals>.Xc                     S r?   r   r$   s    r   r   z1TestSuper.test___class___classmethod.<locals>.X.f   	      r   )r   r   r   r   r   r'   r(   s   @r   rb   r      s    ! !r   rb   r}   r~   s     r   test___class___classmethodz$TestSuper.test___class___classmethod   "    	! 	! 	acceQr   c                 X     G d d      }| j                  |j                         |       y )Nc                   (     e Zd Ze fd       Z xZS )0TestSuper.test___class___staticmethod.<locals>.Xc                       S r?   r   r(   s   r   r   z2TestSuper.test___class___staticmethod.<locals>.X.f   r   r   r   r   r   staticmethodr   r'   r(   s   @r   rb   r          ! !r   rb   r}   r~   s     r   test___class___staticmethodz%TestSuper.test___class___staticmethod   r   r   c                 h    d  G fddt               } G d d|      }| j                  |       y )Nc                   "     e Zd Z fdZ xZS )*TestSuper.test___class___new.<locals>.Metac                 L    t         |   | |||      }|j                         |S r?   )r   __new__r   )r   namebases	namespacer   r    
test_classs        r   r   z2TestSuper.test___class___new.<locals>.Meta.__new__   s'    wsD%C!VVX
r   r   r   r   r   r'   r    r   s   @r   Metar      s     r   r   c                   (     e Zd Ze fd       Z xZS )'TestSuper.test___class___new.<locals>.Ac                       S r?   r   r(   s   r   r   z)TestSuper.test___class___new.<locals>.A.f   r   r   r   r(   s   @r   r   r      r   r   r   	metaclassrn   rm   r   r   r   r   s      @r   test___class___newzTestSuper.test___class___new   s2     
	4 		!$ 	!
 	j!$r   c                     d  G fddt               } G d d|      }| j                  |d        t        dd      }| j                  |j                         |       y )Nc                       e Zd Z fdZy).TestSuper.test___class___delayed.<locals>.Metac                 
    |y r?   r   )r   r   r   r   test_namespaces       r   r   z6TestSuper.test___class___delayed.<locals>.Meta.__new__   s    !*r   N)r   r   r   r   )r   s   r   r   r      s    r   r   c                   (     e Zd Ze fd       Z xZS )+TestSuper.test___class___delayed.<locals>.Ac                       S r?   r   r(   s   r   r   z-TestSuper.test___class___delayed.<locals>.A.f   r   r   r   r(   s   @r   r   r      r   r   r   r   r   r   )rn   rm   r   )r   r   r   r   r   s       @r   test___class___delayedz TestSuper.test___class___delayed   sR    	4 		!$ 	!
 	ab.)acceQr   c                 h    d  G d dt               } G fdd|      }| j                  |       y )Nc                        e Zd Z fdZ xZS )*TestSuper.test___class___mro.<locals>.Metac                 H     | j                   d           t        | 	         S )Nr   )ru   r   mror   s    r   r   z.TestSuper.test___class___mro.<locals>.Meta.mro   s     "c"$w{}$r   )r   r   r   r   r'   r(   s   @r   r   r      s    % %r   r   c                   "     e Zd Z fdZ xZS )'TestSuper.test___class___mro.<locals>.Ac                  
     y r?   r   r   s   r   r   z)TestSuper.test___class___mro.<locals>.A.f   s    &
r   rZ   r   s   @r   r   r      s    ' 'r   r   r   r   r   s      @r   test___class___mrozTestSuper.test___class___mro   s0    
	%4 	%	'$ 	'
 	j!$r   c                     G fddt               }d  G d d|      }| j                  d       d  G d d|      }d   }|j                  j                  }| j	                  t        |      d	       | j                  ||d
          | j                  t              5  |j                   d d d        y # 1 sw Y   y xY w)Nc                   "     e Zd Z fdZ xZS )=TestSuper.test___classcell___expected_behaviour.<locals>.Metac                 H    |j                         t        | 	  | |||      S r?   )copyr   r   )r   r   r   r   r    namespace_snapshots       r   r   zETestSuper.test___classcell___expected_behaviour.<locals>.Meta.__new__   s%    %.^^%5"wsD%CCr   r   )r    r   s   @r   r   r      s    D Dr   r   c                       e Zd Zy)HTestSuper.test___classcell___expected_behaviour.<locals>.WithoutClassRefNr6   r   r   r   WithoutClassRefr          r   r   r   r'   c                        e Zd Z fdZ xZS )ETestSuper.test___classcell___expected_behaviour.<locals>.WithClassRefc                     S r?   r   r   s    r   r   zGTestSuper.test___classcell___expected_behaviour.<locals>.WithClassRef.f   r{   r   rZ   r(   s   @r   WithClassRefr      r|   r   r      r   )
rn   rt   r   __closure__rE   lenrm   ro   AttributeErrorr'   )r   r   r   r   
class_cellmethod_closurer   s         @r   %test___classcell___expected_behaviourz/TestSuper.test___classcell___expected_behaviour   s    	D4 	D "	 	*<=
 "	!T 	! (8
%33^,a0j."34~.&& /..s   !B77C c                      G d dt               } G d d|      }d}| j                  t        |      5   G d d|      }d d d        y # 1 sw Y   y xY w)	Nc                        e Zd Z fdZ xZS )2TestSuper.test___classcell___missing.<locals>.Metac                 L    |j                  dd        t        | 	  | |||      S Nr'   )popr   r   )r   r   r   r   r    s       r   r   z:TestSuper.test___classcell___missing.<locals>.Meta.__new__   s&    ot4wsD%CCr   r   r(   s   @r   r   r          D Dr   r   c                       e Zd Zy)=TestSuper.test___classcell___missing.<locals>.WithoutClassRefNr6   r   r   r   r   r      r   r   r   r   z+__class__ not set.*__classcell__ propagatedc                        e Zd Z fdZ xZS ):TestSuper.test___classcell___missing.<locals>.WithClassRefc                     S r?   r   r   s    r   r   z<TestSuper.test___classcell___missing.<locals>.WithClassRef.f  	    $$r   rZ   r(   s   @r   r   r         % %r   r   )rn   assertRaisesRegexRuntimeError)r   r   r   expected_errorr   s        r   test___classcell___missingz$TestSuper.test___classcell___missing   sM    	D4 	D	 	 G##L.A% % BAAs   A

Ac           	          G d dt               }d ddt               fD ]H  }| j                  |      5  | j                  t              5   G d d||      }d d d        d d d        J y # 1 sw Y   xY w# 1 sw Y   axY w)	Nc                        e Zd Z fdZ xZS )4TestSuper.test___classcell___overwrite.<locals>.Metac                 2    ||d<   t         |   | |||      S r   r   r   )r   r   r   r   cellr    s        r   r   z<TestSuper.test___classcell___overwrite.<locals>.Meta.__new__
  s"    -1	/*wsD%CCr   r   r(   s   @r   r   r   	  r   r   r   r    )bad_cellc                       e Zd Zy)1TestSuper.test___classcell___overwrite.<locals>.ANr6   r   r   r   r   r     s    r   r   )r   r   )rn   objectsubTestro   	TypeError)r   r   r   r   s       r   test___classcell___overwritez&TestSuper.test___classcell___overwrite  sn    	D4 	D
 q"fh/Hx0&&y1d  2 10 011 10s#   A6	A*A6*A3/A66A?	c                      G d dt               }| j                  t              5   G d d|      }d d d        y # 1 sw Y   y xY w)Nc                        e Zd Z fdZ xZS )5TestSuper.test___classcell___wrong_cell.<locals>.Metac                 F    t         |   | |||      } t        dd|      }| S )Nr   r   )r   r   rn   )r   r   r   r   r   r    s        r   r   z=TestSuper.test___classcell___wrong_cell.<locals>.Meta.__new__  s*    goc4	Bb),
r   r   r(   s   @r   r   r     s     r   r   c                        e Zd Z fdZ xZS )2TestSuper.test___classcell___wrong_cell.<locals>.Ac                     S r?   r   r   s    r   r   z4TestSuper.test___classcell___wrong_cell.<locals>.A.f  r   r   rZ   r(   s   @r   r   r     r   r   r   r   )rn   ro   r   )r   r   r   s      r   test___classcell___wrong_cellz'TestSuper.test___classcell___wrong_cell  s6    	4 	 y)%d % *))s	   ;Ac                    fd}| j                  t        d      5   |        d d d         G d d      }| j                  t        d      5  |j                          d d d        fd}| j                  t        d      5   |d        d d d         G d d      }| j                  t        d	      5   |       j                          d d d        y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   `xY w# 1 sw Y   y xY w)
Nc                      t                y r?   r   r(   s   r   r   z.TestSuper.test_obscure_super_errors.<locals>.f#  s    Gr   zno argumentsc                        e Zd Z fdZ xZS ).TestSuper.test_obscure_super_errors.<locals>.Cc                      t                y r?   r   r(   s   r   r   z0TestSuper.test_obscure_super_errors.<locals>.C.f)      r   rZ   r(   s   @r   r+   r   (       r   r+   c                     ~ t                y r?   r   rf   r    s    r   r   z.TestSuper.test_obscure_super_errors.<locals>.f.  s    Gr   zarg\[0\] deletedc                        e Zd Z fdZ xZS ).TestSuper.test_obscure_super_errors.<locals>.Xc                     t                y r?   r   r   s    r   r   z0TestSuper.test_obscure_super_errors.<locals>.X.f5  s    r   rZ   r(   s   @r   rb   r   4  s     r   rb   zempty __class__ cell)r   r   r   )r   r   r+   rb   r    s       r   test_obscure_super_errorsz#TestSuper.test_obscure_super_errors"  s    	##L/BC C	 	 ##L/BCCE C	 ##L2EFdG G	 	
 ##L2IJCEEG KJ) CB CB GF KJs/   CC	C)2C5CC&)C25C>c                      G d d      fd} |       j                   d   }| j                  t        j                  |       y )Nc                        e Zd Z fdZ xZS )&TestSuper.test_cell_as_self.<locals>.Xc                     t                y r?   r   r   s    r   methz+TestSuper.test_cell_as_self.<locals>.X.meth>  r   r   )r   r   r   r  r'   r(   s   @r   rb   r  =  r   r   rb   c                  "            fd} | S )Nc                       S r?   r   )ks   r   gz1TestSuper.test_cell_as_self.<locals>.f.<locals>.gC  s    r   r   )r  r  rb   s    @r   r   z&TestSuper.test_cell_as_self.<locals>.fA  s    AHr   r   )r   ro   r   r  )r   r   crb   s      @r   test_cell_as_selfzTestSuper.test_cell_as_self<  s:    	 		
 COOA)QVVQ/r   c                 |    t        t        d      }t        d      D ]  }t         j                  |t        |        y )Ng      ?i  )r   floatrange__init__int)r   spir    s      r   test_super_init_leakszTestSuper.test_super_init_leaksI  s/    
 5#tANN2sA& r   c                     | j                  t        d      5  t        t        t        t               d d d        y # 1 sw Y   y xY w)Nzexpected at mostr   r   r   r  r   s    r   test_super_argcountzTestSuper.test_super_argcountR  s-    ##I/AB#sC  CBBs	   ;Ac                 |    | j                  t        d      5  t        dt               d d d        y # 1 sw Y   y xY w)Nargument 1 must be a typer   r  r   s    r   test_super_argtypezTestSuper.test_super_argtypeV  s*    ##I/JK!SM LKKs   2;c                    t        j                  d      }t        j                  d|      5  dd l}d d d        | j                  j                         j                         d       t        j                  d       y # 1 sw Y   MxY w)Nz
            class super:
                msg = "truly super"

            class C:
                def method(self):
                    return super().msg
            shadowed_super)r   sourcer   ztruly super)	textwrapdedentr   ready_to_importr  rE   r+   methodunload)r   r  r  s      r   test_shadowed_globalzTestSuper.test_shadowed_globalZ  sl    	
 **0@P! Q))+224mD-. QPs   A>>Bc                 |     G d d       G fdd      }| j                   |       j                         d       y )Nc                       e Zd ZdZy),TestSuper.test_shadowed_local.<locals>.superquite superNr   r   r   msgr   r   r   r   r$  k      Cr   r   c                   "     e Zd Z fdZ xZS )(TestSuper.test_shadowed_local.<locals>.Cc                 &            j                   S r?   )r'  )r   r    r   s    r   r  z/TestSuper.test_shadowed_local.<locals>.C.methodo  s    w{{"r   r   r   r   r  r'   )r    r   s   @r   r+   r*  n  s    # #r   r+   r%  )rE   r  )r   r+   r   s     @r   test_shadowed_localzTestSuper.test_shadowed_localj  s1    	  	 	# 	# 	}5r   c                      G d d      } G d d      }t        t         d|      5 }| j                   |       j                         d       d d d        y # 1 sw Y   y xY w)Nc                       e Zd ZdZy)0TestSuper.test_shadowed_dynamic.<locals>.MySupersuper superNr&  r   r   r   MySuperr0  u  r(  r   r2  c                        e Zd Z fdZ xZS )*TestSuper.test_shadowed_dynamic.<locals>.Cc                     t         |   S r?   r   r'  r   s    r   r  z1TestSuper.test_shadowed_dynamic.<locals>.C.methody      w{"r   r,  r(   s   @r   r+   r4  x      # #r   r+   .superr1  r   r   rE   r  )r   r2  r+   ms       r   test_shadowed_dynamiczTestSuper.test_shadowed_dynamict  sO    	  	 	# 	# hZv&0AQSZZ\=9 100s   &AA c                     g  G fdd      } G d d      }t        t         d|      5 }| j                   |       j                         d       | j                  dg       d d d        y # 1 sw Y   y xY w)Nc                       e Zd Z fdZdZy)8TestSuper.test_shadowed_dynamic_two_arg.<locals>.MySuperc                 (    j                  |       y r?   )append)r   args	call_argss     r   r  zATestSuper.test_shadowed_dynamic_two_arg.<locals>.MySuper.__init__  s      &r   r1  N)r   r   r   r  r'  )rC  s   r   r2  r?    s    'Cr   r2  c                        e Zd Z fdZ xZS )2TestSuper.test_shadowed_dynamic_two_arg.<locals>.Cc                     t         dd  S )Nr   r   r6  r   s    r   r  z9TestSuper.test_shadowed_dynamic_two_arg.<locals>.C.method  s    Q&r   r,  r(   s   @r   r+   rE    s    ' 'r   r+   r9  r1  )r   r   r:  )r   r2  r+   r;  rC  s       @r   test_shadowed_dynamic_two_argz'TestSuper.test_shadowed_dynamic_two_arg  sg    		  	 
	' 	' hZv&0AQSZZ\=9Y1 100s   9A//A8c                      G d d      }| j                  t        d      5   |       j                          d d d        y # 1 sw Y   y xY w)Nc                        e Zd Z fdZ xZS ))TestSuper.test_attribute_error.<locals>.Cc                     t         |   S r?   r6  r   s    r   r  z0TestSuper.test_attribute_error.<locals>.C.method  r7  r   r,  r(   s   @r   r+   rJ    r8  r   r+   z%'super' object has no attribute 'msg')r   r   r  r   r+   s     r   test_attribute_errorzTestSuper.test_attribute_error  s7    	# 	# ##N4[\CJJL ]\\   A  A	c                      G d d      }| j                  t        d      5   |       j                          d d d        y # 1 sw Y   y xY w)Nc                        e Zd Z fdZ xZS )'TestSuper.test_bad_first_arg.<locals>.Cc                      t         d|          S )Nr   )r   r  r   s    r   r  z.TestSuper.test_bad_first_arg.<locals>.C.method  s    Q,..r   r,  r(   s   @r   r+   rQ    s    / /r   r+   r  )r   r   r  rL  s     r   test_bad_first_argzTestSuper.test_bad_first_arg  s7    	/ 	/ ##I/JKCJJL LKKrN  c                 l     G d d      }| j                   |       j                         t               y )Nc                        e Zd Z fdZ xZS ))TestSuper.test_super___class__.<locals>.Cc                 ,    t               j                  S r?   )r   r    r   s    r   r  z0TestSuper.test_super___class__.<locals>.C.method  s    w(((r   r,  r(   s   @r   r+   rV    s    ) )r   r+   )rE   r  r   )r   r+   r    s     r   test_super___class__zTestSuper.test_super___class__  s'    	) 	) 	u-r   c                      G d dt                G fdd      | j                          j                                y )Nc                       e Zd Zy)8TestSuper.test_super_subclass___class__.<locals>.mysuperNr6   r   r   r   mysuperr[    r   r   r\  c                       e Zd Z fdZy)2TestSuper.test_super_subclass___class__.<locals>.Cc                 *     |       j                   S r?   r(   )r   r+   r\  s    r   r  z9TestSuper.test_super_subclass___class__.<locals>.C.method  s    q$'111r   N)r   r   r   r  )r+   r\  s   r   r+   r^    s    2r   r+   )r   rE   r  )r   r+   r\  r    s    @@r   test_super_subclass___class__z'TestSuper.test_super_subclass___class__  s3    	e 		2 	2 	w/r   c                 n      G d dt                fd}t        t              D ]
  } |d        y )Nc                       e Zd Zy)/TestSuper.test_unusual_getattro.<locals>.MyTypeNr6   r   r   r   MyTyperc    r   r   rd  c                      | fi       }t         t        |        |dd       j                  |j                  d       y )Nbarr   )r   rn   __setattr__rE   rf  )r   mytyperd  r    r   s     r   testz-TestSuper.test_unusual_getattro.<locals>.test  s>    D6)R0F&$v,3FE1EVZZ+r   foo1)rn   r  ADAPTIVE_WARMUP_DELAY)r   ri  _rd  r    s   `  @r   test_unusual_getattrozTestSuper.test_unusual_getattro  s-    	T 		,
 ,-AL .r   c                 z     G d d      } G d d|      } G d d|      }t        t              D ]	  } |         y )Nc                       e Zd Zd Zd Zy)(TestSuper.test_reassigned_new.<locals>.Ac                      y r?   r   r   s    r   r   z0TestSuper.test_reassigned_new.<locals>.A.__new__  s    r   c                 D    d| j                   vr| j                  | _        y y )Nr   )ru   r   r   s    r   __init_subclass__z:TestSuper.test_reassigned_new.<locals>.A.__init_subclass__  s    CLL0"%++CK 1r   N)r   r   r   r   rs  r   r   r   r   rp    s    .r   r   c                       e Zd Zy)(TestSuper.test_reassigned_new.<locals>.BNr6   r   r   r   r   ru    r   r   r   c                        e Zd Z fdZ xZS )(TestSuper.test_reassigned_new.<locals>.Cc                 "    t         |   |       S r?   r   r$   s    r   r   z0TestSuper.test_reassigned_new.<locals>.C.__new__  s    ws++r   r   r(   s   @r   r+   rw    s    , ,r   r+   )r  rk  r   r   r   r+   rl  s        r   test_reassigned_newzTestSuper.test_reassigned_new  s;    	. 	.	 		, 	, ,-AC .r   c                       G  fdd      } G d d|      } G d d|      }t        t              D ]  }|j                  |        y )Nc                   "    e Zd Ze fd       Zy)6TestSuper.test_mixed_staticmethod_hierarchy.<locals>.Ac                 J    j                  |       j                  |       y r?   )assertFalse)r   rB  kwargsr   s      r   somez;TestSuper.test_mixed_staticmethod_hierarchy.<locals>.A.some  s      &  (r   N)r   r   r   r   r  r   s   r   r   r}    s    ) )r   r   c                        e Zd Z fdZ xZS )6TestSuper.test_mixed_staticmethod_hierarchy.<locals>.Bc                 *    t        |   | g|i |S r?   r   r  )r   rB  r  r    s      r   r  z;TestSuper.test_mixed_staticmethod_hierarchy.<locals>.B.some  s    w|C9$9&99r   )r   r   r   r  r'   r(   s   @r   r   r    s    : :r   r   c                   (     e Zd Ze fd       Z xZS )6TestSuper.test_mixed_staticmethod_hierarchy.<locals>.Cc                 "    t         |   |       S r?   r  r$   s    r   r  z;TestSuper.test_mixed_staticmethod_hierarchy.<locals>.C.some  s    w|C((r   )r   r   r   r   r  r'   r(   s   @r   r+   r    s    ) )r   r+   )r  rk  r  ry  s   `    r   !test_mixed_staticmethod_hierarchyz+TestSuper.test_mixed_staticmethod_hierarchy  sB    	) 	)	: 	:	) 	)
 ,-AFF1I .r   c                    	  G d d       G d d              fd}g }t        d      D ]9  }t        j                  |      }|j                          |j	                  |       ; |D ]  }|j                           y )Nc                       e Zd Zy)@TestSuper.test___class___modification_multithreaded.<locals>.FooNr6   r   r   r   Foor    r   r   r  c                       e Zd Zy)@TestSuper.test___class___modification_multithreaded.<locals>.BarNr6   r   r   r   Barr    r   r   r  c                  r    } t        d      D ]&  }| _        t        |        | _        t        |        ( y )Ni  )r  r    rn   )foorl  r  r  things     r   workzATestSuper.test___class___modification_multithreaded.<locals>.work  s2    C4[ #S	 #S		 !r      )target)r  	threadingThreadstartrA  join)r   r  threadsrl  threadr  r  r  s        @@@r   )test___class___modification_multithreadedz3TestSuper.test___class___modification_multithreaded  sy    	
	 		 	 	 qA%%T2FLLNNN6" 
 FKKM r   )*r   r   r   r@   rF   rH   rJ   rM   rO   rS   r\   rv   r   r   r   r   r   r   r   r   r   r   r   r
  r  r  r  r!  r-  r<  rG  rM  rS  rX  r`  rm  rz  r  r   requires_working_threadingr  r'   r(   s   @r   r=   r=   2   s    
*+++-I	(!(F"  %& (%"'>%.%40'!/ 6	:2.0
&( 1002 3r   r=   __main__)r  r  unittestunittest.mockr   test.supportr   r   rk  r   r   r+   r0   r5   r9   r;   TestCaser=   r   mainr   r   r   <module>r     s    ?     8   ( (( ((1 (	 	 	 	N!! Nb zHMMO r   