
    <e                       d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
mZ d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlZ	 d dlmZ n# e$ r dZY nw xY wd dlmZ d dlmZmZ d dlmZ d dlm Z  d dl!m"Z"m#Z# d d	l$m%Z& d d
l$m'Z( d dl$m)Z) d dl$m*Z* d dl$m+Z+ d dl$m,Z, d dl-m.Z. e&j/        Z0e01                    d          r
e0dd         Z0 ee0          Z0d Z2 e&j3                    Z4d Z5d Z6d7                                Z8 G d dej9                  Z:d Z;d Z<d Z=ej>        d             Z? G d de:          Z@ G d de:          ZA G d  d!ej9                  ZB G d" d#          ZC G d$ d%eB          ZD G d& d'ej9                  ZE G d( d)eB          ZF G d* d+eB          ZG G d, d-eB          ZH G d. d/eB          ZI G d0 d1eB          ZJ G d2 d3eB          ZK G d4 d5eB          ZL G d6 d7eM          ZN G d8 d9eM          ZOd: ZP G d; d<ej9                  ZQ G d= d>ej9                  ZR G d? d@ej9                  ZS eM            ZT G dA dBej9                  ZU G dC dDej9                  ZV G dE dFeV          ZW G dG dHeW          ZX G dI dJej9                  ZY G dK dLej9                  ZZ G dM dNej9                  Z[ G dO dPej\                  Z] G dQ dRej^                  Z_ G dS dTej9                  Z` G dU dVej9                  Za G dW dXej9                  Zb G dY dZej9                  Zc G d[ d\ej9                  Zd G d] d^ej9                  Ze G d_ d`          Zf G da dbej9                  Zg G dc ddej9                  Zh G de dfej9                  Ziejdgk    r ejk                     dS dS )h    Nnormcase)ThreadPoolExecutor)cpython_only)MISSING_C_DOCSTRINGS	ALWAYS_EQ)DirsOnSysPath)TESTFN)assert_python_okassert_python_failure)inspect_fodder)inspect_fodder2)support)inspect_stock_annotations)inspect_stringized_annotations) inspect_stringized_annotations_2)_ready_to_import)coc                 (    t          |           f|z   S Nr   )filenameargss     (/usr/lib/python3.11/test/test_inspect.pyreviser   >   s    X 4''    c               #   V  K   	 g d} t          ddt          |           z            D ]}g }d}t          t          |                     D ]%}|||z  z  r|                    | |                    &dd                    |          z   dz   }i }t	          |||           |d         V  d S )N)abarr   deltaephraimmagicalyoyoz      zdef foo(*, z, z): passfoo)rangelenappendjoinexec)
parametersipbitjfn_textsymbolss          r   5signatures_with_lexicographic_keyword_only_parametersr5   D   s       ONNJ1aZ()) 	 	s:'' 	( 	(AC1H~ (A'''$))A,,.:Wgw'''en	 	r   c                     d S r    )throwoutthebabywith_the_	bathwaters          r   #unsorted_keyword_only_parameters_fnr?   V   s    Dr   z'throw out the baby with_ the_ bathwaterc                       e Zd Z eej        ej        ej        ej        ej	        ej
        ej        ej        ej        ej        ej        ej        ej        ej        ej        g          Zd Zd ZdS )
IsTestBasec           	         t          |          }|                      ||          |j        d|d           | j        t	          |g          z
  D ]n}|t
          j        k    s |t
          j        k    s|t
          j        k    r|t
          j	        k    rC| 
                     ||          d|j        d|d           od S )N()znot )eval
assertTrue__name__
predicatessetinspectisgeneratorfunctionisasyncgenfunctioniscoroutinefunction
isfunctionassertFalse)self	predicateexpobjothers        r   istestzIsTestBase.isteste   s    3ii		#I4F4F4F(LMMM_sI;'7'77 	O 	OEW888G666G777***UU3ZZZ)MNNNN	O 	Or   c                 >    t          j        | t          d           d S )N)modulesbyfile)not_exported)r   check__all__rJ   rP   s    r   test__all__zIsTestBase.test__all__q   s!    T79KLLLLLLr   N)rG   
__module____qualname__rI   rJ   	isbuiltinisclassiscodeisframerN   ismethodismoduleistracebackisgeneratorrK   iscoroutinerM   
isasyncgenrL   ismethodwrapperrH   rU   r[   r7   r   r   rA   rA   \   s        g''.ow'97;K&(;)7+F)7+F('*D-/ 0 0J
O 
O 
OM M M M Mr   rA   c              #   6   K   t          d          D ]}|V  d S Nr'   r)   rP   r/   s     r   generator_function_examplerm   t   s0      1XX   r   c                D   K   t          d          2 3 d {V }|W V  6 d S rj   rk   rl   s     r    async_generator_function_examplero   x   sJ      88       a 88s   c                 
   K   dS Nspamr7   rZ   s    r   coroutine_function_examplers   |   s      6r   c              #      K   d V  dS rq   r7   rZ   s    r   gen_coroutine_function_exampleru      s      	EEE6r   c                   >    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	S )
TestPredicatesc           	         |                      t          j        d           |                      t          j        d           |                      t          j        d           	 ddz   n# t          $ r}|j        a|                      t          j        d           |                      t          j        d           t          t          d          r!|                      t          j        d	           nC|                     t          j        t          t          j                  j                             Y d }~nd }~ww xY wd an# d aw xY w|                      t          j        d
           |                      t          j        d           |                      t          j        d           |                      t          j        d           |                      t          j        d           |                      t          j        d           |                      t          j        d           |                      t          j        d           |                      t          j        d           |                      t          j        d           t1          j                    5  t1          j        d           |                      t          j        d           |                      t          j        d           d d d            n# 1 swxY w Y   t          t          d          r!|                      t          j        d           n6|                     t          j        t<          j        j                              |                      t          j!        d           |                      t          j!        d           |                      t          j!        d           |                     t          j!        t                               |                     t          j!        tD                               |                     t          j!        t          ddi                                d S )Nzsys.exitz	[].appendzmod.spam.__code__r&   r   ztb.tb_frametbGetSetDescriptorTypeztype(tb.tb_frame).f_localszmod.spamzmod.StupidGit.abusez	git.arguezmod.custom_methodmodz'collections.defaultdict.default_factoryz(x for x in range(2))rm   z#async_generator_function_example(1)ro   ignorezcoroutine_function_example(1)rs   MemberDescriptorTypezdatetime.timedelta.dayszobject().__str__zobject().__eq__zobject().__repr__AnyClassr7   )#rU   rJ   r^   r`   	Exception__traceback__ry   ra   rd   hasattrtypesisgetsetdescriptorrO   typetb_framef_localsrN   rb   rc   isdatadescriptorre   rK   rg   rL   warningscatch_warningssimplefilterrf   rM   ismemberdescriptordatetime	timedeltadaysrh   intrP   es     r   test_excluding_predicatesz(TestPredicates.test_excluding_predicates   s   G%z222G%{333GN$7888	aCCC 	Y 	Y 	YBKK777KK+T222u455 YG68: : : :   !;D<M<M<V!W!WXXX	Y BBBIIIIG&
333G&(=>>>G$k222G$&9:::G$e,,,G,.WXXXG')@AAAG/1MNNNG&9	; 	; 	;G.6	8 	8 	8 $&& 	S 	S!(+++KK+-LMMMKK35QRRR	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S 	S
 5011 	RKK24MNNNNW78J8OPPQQQG+-?@@@G+->???G+-@AAA0667770556660j"b1I1IJJKKKKKsD   "A( 'E (
D<2C D72E 7D<<E EAK==LLc           	      
   t          d          }t          d          }t          d          }|                     t	          j        t                               |                     t	          j        t          j        t          j        t                                                   |                     t	          j        |                     | 	                    t	          j
        t                               | 	                    t	          j
        t          j        t          j        t                                                   | 	                    t	          j        |                     |                     t	          j        t          j                                                             | 	                    t	          j        t          j                                                             | 	                    t	          j        t                               | 	                    t	          j        t          j        t          j        t                                                   | 	                    t	          j        |                     |                     t	          j
        t          j                                                             |                     t	          j
        t          j                                                             |                     t	          j
        t                               |                     t	          j
        t          j        t          j        t                                                   |                     t	          j        |                     |                     t	          j        t          j                                                             |                     t	          j        t          j                                                             |                     t	          j        t                               | 	                    t	          j        t                                | 	                    t	          j        t          j        t          j        t                                                    | 	                    t	          j        |                     |                                 |                                 d S Nr&   )ro   ru   rs   rO   rJ   rM   	functoolspartialrf   rF   rK   re   unittestmockMock	AsyncMockrL   rg   close)rP   async_gen_corogen_corocoros       r   test_iscoroutinezTestPredicates.test_iscoroutine   s   9!<<1!44)!,,'(FGG	I 	I 	I'!)"32#4 #4 5 56 6	7 	7 	7 	,X66777'(FGG	I 	I 	I'!)"32#4 #4 5 56 6	7 	7 	7 	+H55666'(:(:(<(<==	? 	? 	?'(?(?(A(ABB	D 	D 	D'(BCC	E 	E 	E'!)"3.#0 #0 1 12 2	3 	3 	3 	+D11222'(:(:(<(<==	? 	? 	?'(?(?(A(ABB	D 	D 	D'(BCC	E 	E 	E'!)"3.#0 #0 1 12 2	3 	3 	3 	,T22333&x}'9'9';';<<	> 	> 	>&x}'>'>'@'@AA	C 	C 	C&'ABB	D 	D 	D&'GHH	J 	J 	J&!)"34#6 #6 7 78 8	9 	9 	9 	*>::;;;

hnn&&&&&r   c                    d }|                      t          j         |                                 t          d          }t	          d          }|                     t          j        |                     |                     t          j        |                      G d d          }|                     t          j         |                                 |                      t          j        |                      G d d          } |            }d |_        |                      t          j        |                     |                                 |                                 d S )Nc               3      K   d V  d S r   r7   r7   r   r   genz,TestPredicates.test_isawaitable.<locals>.gen   s      555555r   r&   c                       e Zd Zd ZdS )/TestPredicates.test_isawaitable.<locals>.Futurec                      d S r   r7   r7   r   r   	__await__z9TestPredicates.test_isawaitable.<locals>.Future.__await__       r   N)rG   r\   r]   r   r7   r   r   Futurer      #            r   r   c                       e Zd ZdS )2TestPredicates.test_isawaitable.<locals>.NotFutureNrG   r\   r]   r7   r   r   	NotFuturer               r   r   c                      d S r   r7   r7   r   r   <lambda>z1TestPredicates.test_isawaitable.<locals>.<lambda>  s    D r   )rO   rJ   isawaitablers   ru   rF   r   r   )rP   r   r   r   r   r   not_futs          r   test_isawaitablezTestPredicates.test_isawaitable   s^   ,SSUU33444)!,,1!44+D11222+H55666	 	 	 	 	 	 	 	 	+FFHH55666,V44555)++(L,W55666

hnn&&&&&r   c           	      ,	   |                      t          j        t          j                             |                      t          j        t
          j                             |                      t          j        g j                             |                      t          j        t
          j                             |                      t          j        t
          j	        j
                             |                      t          j        t          j                             |                      t          j        t          j                             |                      t          j        t          j                             |                      t          j        t          j                             |                      t          j        t                      j                             |                      t          j        t                      j                             |                      t          j        t                      j                             |                      t          j        dj                             |                      t          j        t           j                             |                      t          j        t$          j                             |                      t          j        dj                             |                      t          j        g j                             |                     t          j        t                               |                     t          j        t                                           |                     t          j        t!                                           |                     t          j        t
                               |                     t          j        t*                               |                     t          j        t                               |                     t          j        t+          ddi                                d S )N*    
some_classr7   )rF   rJ   	isroutinegitarguer{   custom_methodcountrr   	StupidGitabuseobject__init____str____lt__r   strr,   listr+   rO   r   rZ   s    r   test_isroutinezTestPredicates.test_isroutine  s   )#)44555)#*;<<===)"(33444)#(33444)#-*=>>???)&/::;;;)&.99:::)&-88999)#*55666)&((*;<<===)&((*:;;<<<)&((/::;;;)2+66777)#(33444)$+66777)"'22333)")44555*622333*68844555*35511222*3//000*400111*3//000*4b"+E+EFFGGGGGr   c                 "   |                      t          j        d           |                     t          j        t                                G d dt
                    }|                     t          j         |                                 d S )Nzmod.StupidGitc                       e Zd Zd ZdS )2TestPredicates.test_isclass.<locals>.CustomGetattrc                     d S r   r7   )rP   attrs     r   __getattr__z>TestPredicates.test_isclass.<locals>.CustomGetattr.__getattr__3      tr   NrG   r\   r]   r   r7   r   r   CustomGetattrr   2  #            r   r   )rU   rJ   r_   rF   r   r   rO   )rP   r   s     r   test_isclasszTestPredicates.test_isclass.  s    GO_555--...	 	 	 	 	F 	 	 	 	99:::::r   c                      G d dt                     } |            }d|_        t          t          j        |                    }|                     d|           |                     d|           d S )Nc                       e Zd ZdZdS )/TestPredicates.test_get_slot_members.<locals>.Cr   bNrG   r\   r]   	__slots__r7   r   r   Cr   8  s        "IIIr   r   r   r   r   )r   r   dictrJ   
getmembersassertInassertNotIn)rP   r   xmemberss       r   test_get_slot_membersz$TestPredicates.test_get_slot_members7  s    	# 	# 	# 	# 	# 	# 	# 	#ACCw)!,,--c7###g&&&&&r   c                    ddl m}m  G fdd|          } G d d|          } |            }|                     t	          j        |                     |                     t	          j        |                     |                     t	          j        |                     |                     t	          j        t                               |                     t	          j        d                     d S )	Nr   ABCMetaabstractmethodc                   &    e Zd Z d             ZdS )<TestPredicates.test_isabstract.<locals>.AbstractClassExamplec                     d S r   r7   rZ   s    r   r(   z@TestPredicates.test_isabstract.<locals>.AbstractClassExample.fooE      r   NrG   r\   r]   r(   r   s   r   AbstractClassExampler   C  s.          ^  r   r   	metaclassc                       e Zd Zd ZdS )4TestPredicates.test_isabstract.<locals>.ClassExamplec                     d S r   r7   rZ   s    r   r(   z8TestPredicates.test_isabstract.<locals>.ClassExample.fooJ  r   r   Nr   r7   r   r   ClassExampler   I  r   r   r      )abcr   r   rF   rJ   
isabstractrO   r   )rP   r   r   r   r   r   s        @r   test_isabstractzTestPredicates.test_isabstract@  s.   ////////	 	 	 	 	 	 	W 	 	 	 		 	 	 	 	/ 	 	 	 LNN 	*+?@@AAA+L99:::+A..///+C00111+A../////r   c                 X  	 ddl m}m g 	 G 	fdd|          } G fdd|          } G d d	|          }|                     	d
dg           	                                  G d d|          } G d d|          } G d d|          }|                     	g d           d S )Nr   r   c                       e Zd Z fdZdS )LTestPredicates.test_isabstract_during_init_subclass.<locals>.AbstractCheckerc                 V                         t          j        |                      d S r   )r+   rJ   r   )clsisabstract_checkss    r   __init_subclass__z^TestPredicates.test_isabstract_during_init_subclass.<locals>.AbstractChecker.__init_subclass__Z  s(    !(();C)@)@AAAAAr   N)rG   r\   r]   r   )r   s   r   AbstractCheckerr   Y  s5        B B B B B B Br   r   r   c                   &    e Zd Z d             ZdS )QTestPredicates.test_isabstract_during_init_subclass.<locals>.AbstractClassExamplec                     d S r   r7   rZ   s    r   r(   zUTestPredicates.test_isabstract_during_init_subclass.<locals>.AbstractClassExample.foo]  r   r   Nr   r   s   r   r   r   \  s.          ^  r   r   c                       e Zd Zd ZdS )ITestPredicates.test_isabstract_during_init_subclass.<locals>.ClassExamplec                     d S r   r7   rZ   s    r   r(   zMTestPredicates.test_isabstract_during_init_subclass.<locals>.ClassExample.fooa  r   r   Nr   r7   r   r   r   r  `  r   r   r   TFc                       e Zd ZdS )JTestPredicates.test_isabstract_during_init_subclass.<locals>.AbstractChildNr   r7   r   r   AbstractChildr  f          Dr   r  c                       e Zd ZdS )OTestPredicates.test_isabstract_during_init_subclass.<locals>.AbstractGrandchildNr   r7   r   r   AbstractGrandchildr  h  r  r   r	  c                       e Zd ZdS )OTestPredicates.test_isabstract_during_init_subclass.<locals>.ConcreteGrandchildNr   r7   r   r   ConcreteGrandchildr  j  r  r   r  )TTF)r   r   r   assertEqualclear)
rP   r   r   r   r   r  r	  r  r   r   s
           @@r   $test_isabstract_during_init_subclassz3TestPredicates.test_isabstract_during_init_subclassV  s   ////////	B 	B 	B 	B 	B 	B 	B 	B 	B 	B 	B	 	 	 	 	 	 	? 	 	 		 	 	 	 	/ 	 	 	 	*T5M:::!!!	 	 	 	 	0 	 	 		 	 	 	 	 	 	 		 	 	 	 	 	 	 	*,?,?,?@@@@@r   N)rG   r\   r]   r   r   r   r   r   r   r   r  r7   r   r   rw   rw      s        .L .L .Ld;( ;( ;(z' ' '. H  H  HD; ; ;' ' '0 0 0,A A A A Ar   rw   c                   2    e Zd Zd Zd Zd Zd Zd Zd ZdS )TestInterpreterStackc                 r    t          j        j        | g|R i | t                              ddd           d S )N      	   )r   TestCaser   r   r   rP   r   kwargss      r   r   zTestInterpreterStack.__init__p  sB    "49$999&999		!Qr   c                     |                      t          j        d           |                      t          j        d           d S )Nz	git.ex[2]zmod.fr)rU   rJ   rd   ra   rZ   s    r   test_abuse_donez$TestInterpreterStack.test_abuse_doneu  s5    G'555GOX.....r   c           	      4   |                      t          t          j                  dk               t          j        ^}}}}}t	          |dd           }|                     |t          dddgdf           |                     |j        t          j	        dddd                     t	          |dd           }|                     |t          dd	d
gdf           |                     |j        t          j	        dddd                     t	          |dd           }|                     |t          dddgdf           |                     |j        t          j	        dddd                     t	          |dd           }|                     |t          dddgdf           |                     |j        t          j	        dddd                     t          j        d         }| 
                    |j        t          j                   |                     |j        d           |                     |j        t          j                   |                     |j        d           |                     d|j        d                    |                     |j        d           d S )Nr   r&      eggsz    st = inspect.stack()
r   r     rr       eggs(b + d, c + f)
      +   r               spam(a, b, c)
      '   r   z        self.argue(a, b, c)
r     zinspect.stack())rF   r*   r{   str   r  modfile	positionsdis	PositionsassertIsframefrlinenor   __file__functionr   code_contextindex)rP   frame1frame2frame3frame4_	frameinforecords           r   
test_stackzTestInterpreterStack.test_stacky  s   CFq()))-0V*F122J'	r6$@#A1E	G 	G 	G)3=RB+G+GHHHF122J'	q&#=">B	D 	D 	D)3=Aq"+E+EFFFF122J'	r7%B$CQG	I 	I 	I)3=RR+H+HIIIF122J'	r7%D$EqI	K 	K 	K)3=RB+G+GHHHflCF++++++#,777&111')<Q)?@@@q)))))r   c           	         |                      t          t          j                  d           t          j        \  }}}|                      t	          |dd           t
          dddgdf           |                      |j        t          j        dddd                     |                      t	          |dd           t
          d	d
dgdf           |                      |j        t          j        d	d	dd                     |                      t	          |dd           t
          dddgdf           |                      |j        t          j        dddd                     d S )N   r&   r"  r   r#  r   r$  r%  r  rr   r  r   r!     r  z    q = y / 0
r     )	r  r*   r   trr   r)  r*  r+  r,  )rP   r5  r6  r7  s       r   
test_tracezTestInterpreterStack.test_trace  s`   SVa((("%&,r7%B$CQG	I 	I 	I)3=RR+H+HIII,q&#=">B	D 	D 	D)3=Aq"+E+EFFF,r6$5#6:	< 	< 	<)3=RB+G+GHHHHHr   c                 ^   t          j        t          j                  \  }}}}|                     |ddg           |                     |d            |                     |d            |                     |dddd           |                     t          j        ||||          d           d S )Nr   y      )r   r0   rD  z(x=11, y=14))rJ   getargvaluesr{   r/  r  formatargvaluesrP   r   varargsvarkwlocalss        r   
test_framezTestInterpreterStack.test_frame  s    '.';CF'C'C$gufSz***$'''%%%r!<!<===0wvNN'	) 	) 	) 	) 	)r   c                 4   t          j        t          j        j                  \  }}}}|                     |g d           |                     |d           |                     |d           |                     t          j        ||||          d           d S )N)r   r   r   dr   fghz-(a=7, b=8, c=9, d=3, e=4, f=5, *g=(), **h={}))rJ   rG  r{   r/  f_backr  rH  rI  s        r   test_previous_framez(TestInterpreterStack.test_previous_frame  s    '.';CFM'J'J$guf===>>>#&&&$$$0wvNN<	> 	> 	> 	> 	>r   N)	rG   r\   r]   r   r  r<  rB  rM  rT  r7   r   r   r  r  o  sq          
/ / /* * *8I I I) ) )> > > > >r   r  c                   $    e Zd ZdZd Zd Zd ZdS )GetSourceBaseNc                     t          t          j        | j                  d          5 }|                                | _        d d d            d S # 1 swxY w Y   d S )Nutf-8encoding)openrJ   getsourcefilefodderModulereadsource)rP   fps     r   setUpzGetSourceBase.setUp  s    ''(9::WMMM 	$QS''))DK	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$s   AAAc                     | j                             d          }d                    ||dz
  |                   |rdndz   S )N
r&   r   )r_  splitr,   )rP   topbottomliness       r   sourcerangezGetSourceBase.sourcerange  sD    !!$''yys1uV|,--1GRHHr   c                 ~    |                      t          j        |          |                     ||                     d S r   )r  rJ   	getsourcerh  )rP   rS   re  rf  s       r   assertSourceEqualzGetSourceBase.assertSourceEqual  sD    *3//))#v66	8 	8 	8 	8 	8r   )rG   r\   r]   r]  ra  rh  rk  r7   r   r   rV  rV    sI        L$ $ $I I I8 8 8 8 8r   rV  c                       e Zd Z	 dddZdS )SlotUsermeasured in kilowattsmeasured in kilometers)powerdistanceNr   r7   r   r   rm  rm    s#        157 7IIIr   rm  c                   R   e Zd ZeZd Zd Z ej        e	j
        j        dk    d          d             Z ej        e	j
        j        dk    d          d             Z ej        ed          d             Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdS )TestRetrievingSourceCodec                 ,   t          j        t          t           j                  }|                     |dt          j        fdt          j        fdt          j        fdt          j        fdt          j        fdt          j	        fg           t          j
        d |D                       }|                     |t          dft          j        t          fft          j        t          j        t          j        ffgt          j        t          fft          j        t          j        fft          j        t          j        t          j        ffggt          j	        t          ffgg           t          j
        d	 |D             d
          }|                     |t          dft          j        t          fft          j        t          fft          j        t          j        fft          j        t          j        t          j        ffggt          j	        t          ffgg           d S )NFesteringGobMalodorousPervertParrotDroppingsr   TitWhichCommentsc                     g | ]
}|d          S r&   r7   .0r   s     r   
<listcomp>z<TestRetrievingSourceCode.test_getclasses.<locals>.<listcomp>      $?$?$?SV$?$?$?r   r7   c                     g | ]
}|d          S r{  r7   r|  s     r   r~  z<TestRetrievingSourceCode.test_getclasses.<locals>.<listcomp>  r  r   T)rJ   r   r{   r_   r  ru  rv  rw  r   ry  getclasstreer   )rP   classestrees      r   test_getclassesz(TestRetrievingSourceCode.test_getclasses  s   $S'/::)3+;<.0EF,c.AB&6 #"78*C,=>	 	 	 #$?$?w$?$?$?@@!2,/&; -0E363F0H I   MF95 2S]4DE!.1F474G1I J 
 !.	;	 	 	 #$?$?w$?$?$?FF!2,/&;MF95 2S]4DE!.1F474G1I J 
 !.	;
	 	 	 	 	r   c                     t          j        t          t           j                  }|                     |dt          j        fdt          j        fdt          j        fg           d S )Nr  lobbestrr   )rJ   r   r{   rN   r  r  r  rr   )rP   	functionss     r   test_getfunctionsz*TestRetrievingSourceCode.test_getfunctions  s]    &sG,>??	fch%7&/%=&,ch%7%9 	: 	: 	: 	: 	:r   r'   z)Docstrings are omitted with -O2 and abovec                    |                      t          j        t                    d           |                      t          j        t          j                  d           |                      t          j        t
          j                  d           |                      t          j        t          j                  d           |                      t          j        t          j	                  d           d S )NzA module docstring.A longer,

indented

docstring.$Another

docstring

containing

tabsrn  ro  )
r  rJ   getdocr{   r   r   r   rm  rp  rq  rZ   s    r   test_getdocz$TestRetrievingSourceCode.test_getdoc  s     	,,.CDDD66>	@ 	@ 	@	22E	G 	G 	G770	2 	2 	2(9::1	3 	3 	3 	3 	3r   c                    |                      t          j        t          j                  d           |                      t          j        t          j        j                  d           |                      t          j        t          j                    j                  d           |                      t          j        t          j        j                  d           d S )Nr  r  zThe automatic gainsaying.)r  rJ   r  r{   ru  r   contradictionrZ   s    r   test_getdoc_inheritedz.TestRetrievingSourceCode.test_getdoc_inherited  s     	(899>	@ 	@ 	@(8(>??E	G 	G 	G(8(:(:(@AAE	G 	G 	G(8(FGG4	6 	6 	6 	6 	6r   ztest requires docstringsc                 H   t           j        }|                      |t                    t          j                   |                      |t          j                  t          j        j                   |                      |t                      j                  t          j        j                   |                      |t          j                  t          j        j                   |                      |t          j                  t          j        j                   d S r   )rJ   _finddocr  r   __doc__to_bytes
from_bytesreal)rP   finddocs     r   test_finddocz%TestRetrievingSourceCode.test_finddoc  s    "s{333..0DEEE00#,2FGGG00#.2HIII**CH,<=====r   c                 V    |                      t          j        d          d           d S )NzAn
    indented
    docstring.zAn
indented
docstring.)r  rJ   cleandocrZ   s    r   test_cleandocz&TestRetrievingSourceCode.test_cleandoc  s5    )*LMM3	5 	5 	5 	5 	5r   c                    |                      t          j        t                    d           |                      t          j        t          j                  d           |                      t          j        t
          j                  d           t          ddd          }|                     t          j        |                     |                     t          j        t                               d S )N	# line 1
z
# line 20
z# line 159
x=1z_non_existing_filename.pyr-   )
r  rJ   getcommentsr{   r   mod2cls160compileassertIsNoner   )rP   cos     r   test_getcommentsz)TestRetrievingSourceCode.test_getcomments  s    ,S11<@@@,S];;]KKK,T[99>JJJU7@@'-b11222'-d3344444r   c                    |                      t          j        t                    t                     |                      t          j        t          j                  t                     |                      t          j        t          j        j                  t                     |                      t          j        t          j        j                  t                     |                      t          j        t                    t          j        d                    |                      t          j        d t                    t                     d S )Nbuiltins)
r  rJ   	getmoduler{   r   r   r   sysmodulesr)  rZ   s    r   test_getmodulez'TestRetrievingSourceCode.test_getmodule)  s    *3//555*3=993???*3=+>??EEE*3=+>??EEE*3//Z1HIII*4993?????r   c                    d }t           j                            d|          5  t          j                    }|                     t          j        |                     t          j        |           d d d            d S # 1 swxY w Y   d S )Nc                      t          d          )Nzbad file)FileNotFoundError)rS   	_filenames     r   _getabsfilezKTestRetrievingSourceCode.test_getmodule_file_not_found.<locals>._getabsfile9  s    #J///r   zinspect.getabsfile)r   r   patchrJ   currentframer  r  getouterframes)rP   r  rP  s      r   test_getmodule_file_not_foundz6TestRetrievingSourceCode.test_getmodule_file_not_found7  s    	0 	0 	0]  !5{CC 	& 	&$&&Ag/22333"1%%%	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	&s   AB  BBc                     t          j        | j        j        d          }|                     |j        d         d           |                     |j        d         d           d S )N2   r   r  r&   z'A module docstring.'
)rJ   getframeinfor]  r/  r  r3  )rP   
frame_infos     r    test_getframeinfo_get_first_linez9TestRetrievingSourceCode.test_getframeinfo_get_first_line@  s]    )$*;*>CC
03\BBB035NOOOOOr   c                     |                      t          j        dd           |                      t          j        dd           |                      t          j        dd           d S )N   r&     3   K   L   )rk  r   r   r{   r   r  rZ   s    r   test_getsourcez'TestRetrievingSourceCode.test_getsourceE  sV    sy"b111s}b"555s{B33333r   c                    |                      t          t          j        t          j                            t                     |                      t          t          j        t          j                            t                     d}t          d|d          }|                      t          j        |          d            dd d|j
        ft          j        |j
        <   	 |                      t          t          j        |                    |           t          j        |j
        = d S # t          j        |j
        = w xY w)Nz2_non_existing_filename_used_for_sourcefile_test.pyr  r-   r&   None)r  r   rJ   r\  r{   rr   r)  r   r   r  co_filename	linecachecache)rP   fnr  s      r   test_getsourcefilez+TestRetrievingSourceCode.test_getsourcefileJ  s    '"7"A"ABBGLLL'"7	"B"BCCWMMMAUB''.r22D999+,dFBN*K	'	0Xg&;B&?&?@@"EEE///	/////s   "5D+ +D?c                 ~    |                      t          j        t          j                  t          j                   d S r   )r  rJ   getfiler{   r   r1  rZ   s    r   test_getfilez%TestRetrievingSourceCode.test_getfileV  s,    77FFFFFr   c                    |                      t                    5 }t          j        t                     d d d            n# 1 swxY w Y   |                     t          |j                                      d                     d S )Nz<module)	assertRaises	TypeErrorrJ   r  r  rF   r   	exception
startswithr   s     r   test_getfile_builtin_modulez4TestRetrievingSourceCode.test_getfile_builtin_moduleY  s    y)) 	!QOC   	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!AK((33I>>?????   AAAc                    |                      t                    5 }t          j        t                     d d d            n# 1 swxY w Y   |                     t          |j                                      d                     d S )Nz<class)	r  r  rJ   r  r   rF   r   r  r  r   s     r   test_getfile_builtin_classz3TestRetrievingSourceCode.test_getfile_builtin_class^  s    y)) 	!QOC   	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!AK((33H==>>>>>r  c                    |                      t                    5 }t          j        t                     d d d            n# 1 swxY w Y   |                     dt          |j                             |                      t                    5 }t          j        t          j	                   d d d            n# 1 swxY w Y   |                     dt          |j                             d S )Nzexpected, got)
r  r  rJ   r  absr   r   r  r   r+   )rP   e_abse_appends      r   'test_getfile_builtin_function_or_methodz@TestRetrievingSourceCode.test_getfile_builtin_function_or_methodc  s3   y)) 	!UOC   	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!os5?';';<<<y)) 	)XODK(((	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	)os8+='>'>?????s#   AAAB99B= B=c                      G d dt                     } G d d|          }|                     t                    5  t          j        |           d d d            d S # 1 swxY w Y   d S )Nc                   $    e Zd Zed             ZdS )FTestRetrievingSourceCode.test_getfile_class_without_module.<locals>.CMc                     t           r   AttributeErrorr   s    r   r\   zQTestRetrievingSourceCode.test_getfile_class_without_module.<locals>.CM.__module__m  s    $$r   N)rG   r\   r]   propertyr7   r   r   CMr  l  -        % % X% % %r   r  c                       e Zd ZdS )ETestRetrievingSourceCode.test_getfile_class_without_module.<locals>.CNr   r7   r   r   r   r  p  r  r   r   r   )r   r  r  rJ   r  )rP   r  r   s      r   !test_getfile_class_without_modulez:TestRetrievingSourceCode.test_getfile_class_without_modulek  s    	% 	% 	% 	% 	% 	% 	% 	%	 	 	 	 	" 	 	 	 	y)) 	 	OA	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   AA#&A#c                      G d d          } |            }|                      t                    5  t          j        |           d d d            d S # 1 swxY w Y   d S )Nc                       e Zd Zd ZdS )DTestRetrievingSourceCode.test_getfile_broken_repr.<locals>.ErrorReprc                      t          d          )Nxyz)r   rZ   s    r   __repr__zMTestRetrievingSourceCode.test_getfile_broken_repr.<locals>.ErrorRepr.__repr__w  s    &&&r   N)rG   r\   r]   r  r7   r   r   	ErrorReprr  v  s#        ' ' ' ' 'r   r  )r  r  rJ   r  )rP   r  ers      r   test_getfile_broken_reprz1TestRetrievingSourceCode.test_getfile_broken_repru  s    	' 	' 	' 	' 	' 	' 	' 	' Y[[y)) 	  	 OB	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	 s   AAAc                 T   ddl m} d} ||          x}t          j        |<   d|_        d|_        t          d|j                   |                     t          j
        |j        j                  d           t          j        |= t          j        t          ddd	                     d S )
Nr   )
ModuleType__inspect_dummy<string>dummyzdef x(): passza=10r   single)r   r  r  r  r1  
__loader__r-   __dict__r  rJ   r\  r   __code__r  r  )rP   r  namems       r   test_getmodule_recursionz1TestRetrievingSourceCode.test_getmodule_recursion}  s    $$$$$$  *
4 0 00CK
_aj))).qs|<<jIIIK'&H5566666r   c                 
   	 d\  t           j        dfd	}|t           _        	 i }t          t          d          |           t	          j        |d                    t           _        d S # t           _        w xY w)N)z<test>zdef x(): pass
c                 T    | k    r                     d          S  | |          S )NT)keepends)
splitlines)r   module_globalsr  getlinesr_  s     r   monkeyzHTestRetrievingSourceCode.test_proceed_with_fake_filename.<locals>.monkey  s5    2~~(($(777x.999r   r  r   r   )r  r   r-   r  rJ   rj  )rP   r  nsr  r   r_  s      @@@r   test_proceed_with_fake_filenamez8TestRetrievingSourceCode.test_proceed_with_fake_filename  s    B0
F%	: 	: 	: 	: 	: 	: 	: 	:
 $		*BX..333bg&&&!)II))))s   ;A4 4Bc                 R    |                      t          j        j        dd           d S )Nr$  r?  )rk  r{   r  r  rZ   s    r   test_getsource_on_code_objectz6TestRetrievingSourceCode.test_getsource_on_code_object  s%    sx0"b99999r   N) rG   r\   r]   r{   r]  r  r  r   skipIfr  flagsoptimizer  r  r   r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r7   r   r   rs  rs    s       L& & &P: : : X_SY'1,@B B	3 	3B B	3 X_SY'1,@B B6 6B B6 X_)+EFF> > GF>5 5 55 5 5@ @ @& & &P P P
4 4 4

0 
0 
0G G G@ @ @
? ? ?
@ @ @       	7 	7 	7* * *": : : : :r   rs  c                       e Zd Zd ZdS )TestGetsourceInteractivec                 b    d}t          d|d          \  }}}|                     d|           d S )Nzimport sys, inspect;                 assert not hasattr(sys.modules['__main__'], '__file__');                 A = type('A', (), {});                 inspect.getsource(A)z-cT)
__isolateds"   OSError: source code not available)r   r   )rP   coder9  stderrs       r   test_getclasses_interactivez4TestGetsourceInteractive.test_getclasses_interactive  s@    & -T4DIII1f;VDDDDDr   N)rG   r\   r]   r  r7   r   r   r
  r
    s(        E E E E Er   r
  c                       e Zd ZeZd Zd ZdS )!TestGettingSourceOfToplevelFramesc                 V    d | _         |                     t          j        dd            d S r   )maxDiffrk  r{   r  rZ   s    r   test_range_toplevel_framez;TestGettingSourceOfToplevelFrames.test_range_toplevel_frame  s*    s/D99999r   c                 H    |                      t          j        dd            d S r   )rk  r{   ry   rZ   s    r   #test_range_traceback_toplevel_framezETestGettingSourceOfToplevelFrames.test_range_traceback_toplevel_frame  s"    svq$/////r   N)rG   r\   r]   r{   r]  r  r  r7   r   r   r  r    s7        L: : :0 0 0 0 0r   r  c                   *    e Zd ZeZd Zd Zd Zd ZdS )TestDecoratorsc                 H    |                      t          j        dd           d S )NrF     )rk  r  wrappedrZ   s    r   test_wrapped_decoratorz%TestDecorators.test_wrapped_decorator  s"    t|R44444r   c                 H    |                      t          j        dd           d S )Nr  
   )rk  r  gonerZ   s    r   test_replacing_decoratorz'TestDecorators.test_replacing_decorator  s"    ty!R00000r   c                 H    |                      t          j        dd           d S )N      )rk  r  r  rZ   s    r   test_getsource_unwrapz$TestDecorators.test_getsource_unwrap  s"    ty#s33333r   c                 H    |                      t          j        dd           d S )Nq   s   )rk  r  func114rZ   s    r   test_decorator_with_lambdaz)TestDecorators.test_decorator_with_lambda  s"    t|S#66666r   N)	rG   r\   r]   r  r]  r  r   r$  r)  r7   r   r   r  r    sU        L5 5 51 1 14 4 47 7 7 7 7r   r  c                   B    e Zd ZeZd Zd Zd Zd Zd Z	d Z
d Zd Zd	S )
TestOnelinersc                 H    |                      t          j        dd           d S )Nr%  )rk  r  ollrZ   s    r   test_oneline_lambdaz!TestOneliners.test_oneline_lambda  s"    txR00000r   c                 H    |                      t          j        dd           d S )N      )rk  r  tllrZ   s    r   test_threeline_lambdaz#TestOneliners.test_threeline_lambda  s$     	txR00000r   c                 H    |                      t          j        dd           d S )N!   "   )rk  r  tllirZ   s    r   test_twoline_indented_lambdaz*TestOneliners.test_twoline_indented_lambda  s$     	ty"b11111r   c                 H    |                      t          j        dd           d S )N%   )rk  r  onelinefuncrZ   s    r   test_onelinefunczTestOneliners.test_onelinefunc  s#    t/R88888r   c                 H    |                      t          j        dd           d S )N(   )   )rk  r  manyargsrZ   s    r   test_manyargszTestOneliners.test_manyargs  s$     	t}b"55555r   c                 H    |                      t          j        dd           d S )N,   -   )rk  r  twolinefuncrZ   s    r   test_twolinefunczTestOneliners.test_twolinefunc  s%     	t/R88888r   c                 T    |                      t          j        d         dd           d S )Nr&   1   )rk  r  r   rZ   s    r   test_lambda_in_listz!TestOneliners.test_lambda_in_list  s(     	tvay"b11111r   c                 H    |                      t          j        dd           d S )N7   )rk  r  	anonymousrZ   s    r   test_anonymouszTestOneliners.test_anonymous  s$     	t~r266666r   N)rG   r\   r]   r  r]  r.  r3  r8  r<  rA  rF  rI  rM  r7   r   r   r+  r+    s        L1 1 11 1 1
2 2 2
9 9 96 6 69 9 92 2 2
7 7 7 7 7r   r+  c                   $    e Zd ZeZd Zd Zd ZdS )TestBlockCommentsc                 H    |                      t          j        dd           d S )N`   r   )rk  r{   ry  rZ   s    r   test_toplevel_classz%TestBlockComments.test_toplevel_class  s#    s0"c:::::r   c                 R    |                      t          j        j        dd           d S )Nc   h   )rk  r{   ry  rP  rZ   s    r   test_class_methodz#TestBlockComments.test_class_method  s&    s02B<<<<<r   c                 R    |                      t          j        j        dd           d S )Nm   p   )rk  r{   ry  asyncfrZ   s    r   test_class_async_methodz)TestBlockComments.test_class_async_method  s&    s07cBBBBBr   N)rG   r\   r]   r{   r]  rS  rW  r\  r7   r   r   rO  rO    sK        L; ; ;= = =C C C C Cr   rO  c                   T   e Zd ZeZd Zd Zd Zd Zd Z	d Z
d Z ej         eed           pej                            d	          d
          d             Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z ej        e j!        pe j"        d          d             Z#dS )TestBuggyCasesc                 H    |                      t          j        dd           d S )N:   ;   )rk  r  with_commentrZ   s    r   test_with_commentz TestBuggyCases.test_with_comment  s#    t0"b99999r   c                 T    |                      t          j        d         dd           d S )Nr   ?   @   )rk  r  multiline_sigrZ   s    r   test_multiline_sigz!TestBuggyCases.test_multiline_sig  s(    t1!4b"=====r   c                 `    |                      t          j                    j        dd           d S )NG   H   )rk  r  func69func71rZ   s    r   test_nested_classz TestBuggyCases.test_nested_class  s)    t{}}3R<<<<<r   c                 H    |                      t          j        dd           d S )NM   )rk  r  func77rZ   s    r   #test_one_liner_followed_by_non_namez2TestBuggyCases.test_one_liner_followed_by_non_name  "    t{B33333r   c                 R    |                      t          j        j        dd           d S )NS   )rk  r  cls82func83rZ   s    r   test_one_liner_dedent_non_namez-TestBuggyCases.test_one_liner_dedent_non_name  s%    tz0"b99999r   c                 H    |                      t          j        dd           d S )NX   Z   )rk  r  func88rZ   s    r   &test_with_comment_instead_of_docstringz5TestBuggyCases.test_with_comment_instead_of_docstring  rs  r   c                 H    |                      t          j        dd           d S )N_   a   )rk  r  method_in_dynamic_classrZ   s    r   test_method_in_dynamic_classz+TestBuggyCases.test_method_in_dynamic_class  s#    t;RDDDDDr   r1  z.pyz,unicodedata is not an external binary modulec                     |                      t          t          j        t                     |                      t          t          j        t                     d S r   )r  OSErrorrJ   rj  unicodedata
findsourcerZ   s    r   test_findsource_binaryz%TestBuggyCases.test_findsource_binary  s@     	'7#4kBBB'7#5{CCCCCr   c                    dg}t          |d         dd          }|                     t          t          j        |           |                     t          t          j        |           dd ||j        ft          j        |j        <   	 | 	                    t          j        |          |df           | 	                    t          j        |          |d                    t          j        |j        = d S # t          j        |j        = w xY w)Nr  r   _dynamically_created_filer-   r&   )
r  r  r  rJ   r  rj  r  r  r  r  )rP   rg  r  s      r   !test_findsource_code_in_linecachez0TestBuggyCases.test_findsource_code_in_linecache  s    U1X:FCC'7#5r:::'7#4b999+,dE2>*J	'	0W/33eAY???W.r22E!H===///	/////s   AC1 1Dc                     dD ]_}t          d|d          }|                     t          t          j        |           |                     t          t          j        |           `d S )N)r   r  r  r-   )r  r  IOErrorrJ   r  rj  )rP   fnamer  s      r    test_findsource_without_filenamez/TestBuggyCases.test_findsource_without_filename#  se    % 	> 	>Ev..Bgw'92>>>gw'8"====	> 	>r   c                    t          t          j        t                              }d|z  dz   }t	          |t          j        d          }i i }}t          |||           |d         }|                     |j        j	        dd|z  z              | 
                    t          d          5  t          j        |           d d d            d S # 1 swxY w Y   d S )Nz

zdef f(): passr-   rP  r&   r'   zlineno is out of bounds)r*   rJ   rj  r{   r  r1  rE   r  r  co_firstlinenoassertRaisesRegexr  r  )rP   mod_lensrcr  rQ  lfuncs          r   )test_findsource_with_out_of_bounds_linenoz8TestBuggyCases.test_findsource_with_out_of_bounds_lineno)  s   g',,--/1S#,//21RAv5q7{CCC##G-FGG 	% 	%t$$$	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	%s   (C

CCc                 R    |                      t          j        j        dd           d S )Nv   w   )rk  r  ClassWithMethodmethodrZ   s    r   test_getsource_on_methodz'TestBuggyCases.test_getsource_on_method4  s&    t3:CEEEEEr   c                 R    |                      t          j        j        dd           d S )N      )rk  r  cls135func136rZ   s    r   test_nested_funczTestBuggyCases.test_nested_func7  s%    t{2C=====r   c                 H    |                      t          j        dd           d S )N      )rk  r  cls149rZ   s    r   4test_class_definition_in_multiline_string_definitionzCTestBuggyCases.test_class_definition_in_multiline_string_definition:  "    t{C55555r   c                 H    |                      t          j        dd           d S )N      )rk  r  r  rZ   s    r   *test_class_definition_in_multiline_commentz9TestBuggyCases.test_class_definition_in_multiline_comment=  r  r   c                 R    |                      t          j        j        dd           d S )N      )rk  r  cls173cls175rZ   s    r   ,test_nested_class_definition_indented_stringz;TestBuggyCases.test_nested_class_definition_indented_string@  s%    t{13<<<<<r   c                     |                      t          j        dd           |                      t          j        j        dd           d S )N         )rk  r  cls183cls185rZ   s    r   test_nested_class_definitionz+TestBuggyCases.test_nested_class_definitionC  ?    t{C555t{13<<<<<r   c                     |                      t          j        dd           |                      t          j        j        dd           d S )N         )rk  r  cls196cls200rZ   s    r   test_class_decoratorz#TestBuggyCases.test_class_decoratorG  r  r   c                     |                      t          j        dd           |                      t          j        j        dd           d S )N         )rk  r  cls238cls239rZ   s    r   test_class_inside_conditionalz,TestBuggyCases.test_class_inside_conditionalK  r  r   c                    |                      t          j        dd           |                      t          j        j        dd           |                      t          j        j        j        dd           |                      t          j        j        dd           |                      t          j        j        j        dd           d S )N                     )rk  r  cls203cls204cls205cls207rZ   s    r   test_multiple_children_classesz-TestBuggyCases.test_multiple_children_classesO  s    t{C555t{13<<<t{18#sCCCt{13<<<t{18#sCCCCCr   c                    |                      t          j                    dd           |                      t          j        dd           |                      t          j                                                    dd           d S )N                  )rk  r  func212cls213func219rZ   s    r   ,test_nested_class_definition_inside_functionz;TestBuggyCases.test_nested_class_definition_inside_functionV  sj    t|~~sC888t{C555t{}}4466SAAAAAr   zsocket.accept is brokenc                    dd l }|                     |j        d            |                     |                    t          j                              dd           |                     t
          j        dd           |                     |                    t          j                                                              dd           d S )Nr                     )	asyncio
addCleanupset_event_loop_policyrk  runr  func225cls226func232)rP   r  s     r   2test_nested_class_definition_inside_async_functionzATestBuggyCases.test_nested_class_definition_inside_async_function[  s    
 	5t<<<w{{4<>>::CEEEt{C555w{{4;==+@+@+B+BCCS#NNNNNr   N)$rG   r\   r]   r  r]  rc  rh  rn  rr  rx  r}  r  r   r  r   r  r1  endswithr  r  r  r  r  r  r  r  r  r  r  r  r  r  r   is_emscriptenis_wasir  r7   r   r   r^  r^    s       L: : :> > >= = =4 4 4: : :4 4 4E E E
 X_j999 F!,!5!>!>u!E!ECE ED DE ED
0 
0 
0> > >	% 	% 	%F F F> > >6 6 66 6 6= = == = == = == = =D D DB B B
 X_0! O O	 O O Or   r^  c                   *     e Zd Z fdZd Zd Z xZS )	TestNoEOLc                    t           dz   | _        t          j        | j                   t	          t          j                            | j        dt          j        z            dd          5 }|                    d           d d d            n# 1 swxY w Y   t          | j                  5  dd l
}d d d            n# 1 swxY w Y   || _        t                                                       d S )N_dirzinspect_fodder3%spywrX  rY  zclass X:
    pass # No EOLr   )r
   tempdirosmkdirr[  pathr,   extsepwriter	   inspect_fodder3r]  superra  )rP   rP  mod3	__class__s      r   ra  zTestNoEOL.setUpg  sL   
"',,t|-BRY-NOO) ) ) 	3,-GG1222	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 4<(( 	+ 	+****	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ s$   ,BBB-B>>CCc                 8    t          j        | j                   d S r   )shutilrmtreer  rZ   s    r   tearDownzTestNoEOL.tearDownr  s    dl#####r   c                 H    |                      | j        j        dd           d S )Nr&   r'   )rk  r]  XrZ   s    r   
test_classzTestNoEOL.test_classu  s&    t02Aq99999r   )rG   r\   r]   ra  r  r  __classcell__r  s   @r   r  r  f  sV        	 	 	 	 	$ $ $: : : : : : :r   r  c                       e Zd ZeZd ZdS )TestComplexDecoratorc                 H    |                      | j        j        dd           d S )Ni  i  )rk  r]  complex_decoratedrZ   s    r   test_parens_in_decoratorz-TestComplexDecorator.test_parens_in_decorator|  s&    t0BCMMMMMr   N)rG   r\   r]   r  r]  r  r7   r   r   r  r  y  s-        LN N N N Nr   r  c                   "    e Zd Z	 d Zd Zd ZdS )_BrokenDataDescriptorc                       t          d          Nzbroken data descriptorr  r   s    r   __get__z_BrokenDataDescriptor.__get__      5666r   c                      t           r   )RuntimeErrorr  s    r   __set__z_BrokenDataDescriptor.__set__  s    r   c                       t          d          r  r  r  s    r   r   z!_BrokenDataDescriptor.__getattr__  r  r   N)rG   r\   r]   r  r  r   r7   r   r   r  r    sF        7 7 7  7 7 7 7 7r   r  c                       e Zd Z	 d Zd ZdS )_BrokenMethodDescriptorc                       t          d          Nzbroken method descriptorr  r  s    r   r  z_BrokenMethodDescriptor.__get__      7888r   c                       t          d          r  r  r  s    r   r   z#_BrokenMethodDescriptor.__getattr__  r  r   N)rG   r\   r]   r  r   r7   r   r   r  r    s7        9 9 99 9 9 9 9r   r  c                 >    d t          j        |           D             S )Nc                 "    g | ]}|d d         S Nr>  r7   )r}  ts     r   r~  z!attrs_wo_objs.<locals>.<listcomp>  s     ===aAbqbE===r   )rJ   classify_class_attrsr  s    r   attrs_wo_objsr&    s!    ==77<<====r   c                   ^   e Zd Zd Zdddg g di fdZd Zd Zd Zd Z e	j
        ed          d	             Ze e	j
        ed          d
                         Ze e	j
        ed          d                         Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdS )TestClassesAndFunctionsc                      G d dt                     } G d d|          } G d d|          } G d d||          }||||t           f}t          j        |          }|                     ||           d S )	Nc                       e Zd ZdS )4TestClassesAndFunctions.test_newstyle_mro.<locals>.ANr   r7   r   r   Ar+    r   r   r,  c                       e Zd ZdS )4TestClassesAndFunctions.test_newstyle_mro.<locals>.BNr   r7   r   r   Br.    r   r   r/  c                       e Zd ZdS )4TestClassesAndFunctions.test_newstyle_mro.<locals>.CNr   r7   r   r   r   r1    r   r   r   c                       e Zd ZdS )4TestClassesAndFunctions.test_newstyle_mro.<locals>.DNr   r7   r   r   Dr3    r   r   r4  )r   rJ   getmror  )rP   r,  r/  r   r4  expectedgots          r   test_newstyle_mroz)TestClassesAndFunctions.test_newstyle_mro  s            1q!Q'nQ3'''''r   Nc
                 r   t          j        |          \  }
}}}}}}|                     |
|           |                     ||           |                     ||           |                     ||           |                     ||           |                     ||           |                     ||	           d S r   )rJ   getfullargspecr  )rP   routineargs_e	varargs_evarkw_e
defaults_eposonlyargs_ekwonlyargs_ekwonlydefaults_eann_er   rJ  rK  defaults
kwonlyargskwonlydefaultsanns                    r   assertFullArgSpecEqualsz/TestClassesAndFunctions.assertFullArgSpecEquals  s     "7++ 	Hguh
NCv&&&),,,(((:...\222)9:::e$$$$$r   c           	         |                      t          j        g ddgddi           |                      t          j        dgdt          i           |                      t          j        g dg           |                      t          j        g dd	d
g           |                      t          j        g dddd	d
g           |                      t          j        g ddd	d
gddd           d S )Narg1arg2r&   )r=  rA  rB  )rC  arg)rA  r   r   r   rO  r   rP  r   r  )r=  r>  rA  r&   r'   r>  r   r   )r   rP  )r?  rA  rB  )	rH  r  	keyworded	annotatedr   keyword_only_argall_markers all_markers_with_args_and_kwargsall_markers_with_defaultsrZ   s    r   test_getfullargspecz+TestClassesAndFunctions.test_getfullargspec  sL   $$T^R639(7=aj 	% 	B 	B 	B 	$$T^fX,2T? 	% 	< 	< 	<$$T%:B38' 	% 	; 	; 	; 	$$T%57K7K7K36* 	% 	> 	> 	> 	$$T%J%9%9%9/5-536*	 	% 	> 	> 	> 	$$T%CEYEYEY0736*<=A6F6F 	% 	H 	H 	H 	H 	Hr   c                     t          j        t          j                  d             }|                     |ddg           |                     t          j        |          ddg           d S )Nc                     d S r   r7   r   rD  s     r   hamzETestClassesAndFunctions.test_argspec_api_ignores_wrapped.<locals>.ham      Dr   r   rD  )r   wrapsr{   rr   rH  r   )rP   rY  s     r    test_argspec_api_ignores_wrappedz8TestClassesAndFunctions.test_argspec_api_ignores_wrapped  sz    		"	"	 	 
#	"	 	$$S3*555$$Y%6s%;%;&)3Z	1 	1 	1 	1 	1r   c                     d }t          j        dt           j        j                  }t          j        |f          |_        |                     |dg           d S )Nc                      d S r   r7   r7   r   r   testzHTestClassesAndFunctions.test_getfullargspec_signature_attr.<locals>.test      Dr   rr   r.   )rJ   	ParameterPOSITIONAL_ONLY	Signature__signature__rH  )rP   r_  
spam_params      r   "test_getfullargspec_signature_attrz:TestClassesAndFunctions.test_getfullargspec_signature_attr  s_    	 	 	&vw/@/PQQ
$.:-HHH$$TF844444r   c                     dd}t          j        |          }|                     |j        |j                   d }t          j        |          }|                     |j        |j                   d S )Nr   rr   returnrY  c                     d S r   r7   r   s    r   r_  zITestClassesAndFunctions.test_getfullargspec_signature_annos.<locals>.test        r   c                      d S r   r7   r7   r   r   r_  zITestClassesAndFunctions.test_getfullargspec_signature_annos.<locals>.test  rl  r   )r   rr   ri  rY  )rJ   r:  r  __annotations__annotations)rP   r_  specs      r   #test_getfullargspec_signature_annosz;TestClassesAndFunctions.test_getfullargspec_signature_annos  su    ))))%d++-t/?@@@%d++-t/?@@@@@r   6Signature information for builtins requires docstringsc                 &   |                      t          j        j        ddg           |                      t          j        t	          j                              j        ddg           |                      t          j        dgddgd dd           d S )	NrP   rS   r  dir_fdfollow_symlinksT)rt  ru  )r<  rA  rB  )rH  _picklePicklerdumpioBytesIOr  statrZ   s    r   #test_getfullargspec_builtin_methodsz;TestClassesAndFunctions.test_getfullargspec_builtin_methods  s     	$$W_%9FE?KKK$$W_RZ\\%B%B%G&RWYYY$$WH#%67)-$GG	 	% 	I 	I 	I 	I 	Ir   c                     dd l }|j        }t          j        |          }|                     |j        d         d           d S )Nr   avocado)	_testcapi&docstring_with_signature_with_defaultsrJ   r:  r  rD  )rP   r  builtinrp  s       r    test_getfullargspec_builtin_funcz8TestClassesAndFunctions.test_getfullargspec_builtin_func  sK     	B%g..q)955555r   c                     dd l }|j        }|                     t                    5  t	          j        |           d d d            d S # 1 swxY w Y   d S )Nr   )r  docstring_no_signaturer  r  rJ   r:  )rP   r  r  s      r   -test_getfullargspec_builtin_func_no_signaturezETestClassesAndFunctions.test_getfullargspec_builtin_func_no_signature  s     	2y)) 	, 	,"7+++	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	,s   AAAc                 |   t                      D ]d}t          j        |          }t          |j                  }t          |          }|                     |           |                     ||           et          j        t                    }t          |j                  }|                     |t                     d S r   )
r5   rJ   r:  r   rE  sortedrF   r  r?    unsorted_keyword_only_parametersrP   r  	signaturer  sorted_ls        r   8test_getfullargspec_definition_order_preserved_on_kwonlyzPTestClassesAndFunctions.test_getfullargspec_definition_order_preserved_on_kwonly
  s    GII 	* 	*B.r22IY)**AayyHOOAQ))))*+NOO	%&&<=====r   c                     G d dt                     }t          |          }|                     ddt           f|d           |                     ddt           f|d           |                     d	d|f|d
           |                     dd|f|d           |                     dd|f|d           |                     dd|f|d|z             |                     dd|f|d           |                     dd|f|d           |                     dd|f|d           |                     dd|f|d            G d d|          }t          |          }|                     d	d|f|d
           |                     dd|f|d           |                     dd|f|d           |                     dd|f|d           |                     dd|f|d           |                     dd|f|d           |                     dd|f|d           |                     dd|f|d            G d d|          }t          |          }|                     d	d|f|d
           |                     dd|f|d           |                     dd|f|d           |                     dd|f|d           |                     dd|f|d           |                     dd|f|d           |                     dd|f|d           |                     dd|f|d            G d  d!||          }t          |          }|                     d	d|f|d
           |                     dd|f|d           |                     dd|f|d           |                     dd|f|d           |                     dd|f|d           |                     dd|f|d           |                     dd|f|d           |                     dd|f|d           d S )"Nc                       e Zd Zd Z ee          Zd Z ee          Zd Z ee          Z	d Z
d ZdZ e            Z e            ZdS )9TestClassesAndFunctions.test_classify_newstyle.<locals>.Ac                      d S r   r7   r7   r   r   sz;TestClassesAndFunctions.test_classify_newstyle.<locals>.A.s  rl  r   c                     d S r   r7   r  s    r   r   z;TestClassesAndFunctions.test_classify_newstyle.<locals>.A.c  rl  r   c                     d S r   r7   rZ   s    r   getpz>TestClassesAndFunctions.test_classify_newstyle.<locals>.A.getp  rl  r   c                     d S r   r7   rZ   s    r   r  z;TestClassesAndFunctions.test_classify_newstyle.<locals>.A.m!  rl  r   c                     d S r   r7   rZ   s    r   m1z<TestClassesAndFunctions.test_classify_newstyle.<locals>.A.m1#  rl  r   1N)rG   r\   r]   r  staticmethodr   classmethodr  r  r0   r  r  datablobr  ddr  mdr7   r   r   r,  r    s        MMQAAA   AH&&((B((**BBBr   r,  __new__static methodmissing __new__r   r  zmissing __init__r  zmissing static methodr   class methodmissing class methodr0   r  zmissing propertyr  zmissing plain method: %rr  missing plain methodr  datazmissing datar  zmissing method descriptorr  zmissing data descriptorc                       e Zd Zd ZdS )9TestClassesAndFunctions.test_classify_newstyle.<locals>.Bc                     d S r   r7   rZ   s    r   r  z;TestClassesAndFunctions.test_classify_newstyle.<locals>.B.m<  rl  r   N)rG   r\   r]   r  r7   r   r   r/  r  :  s        r   r/  c                       e Zd Zd Zd ZdS )9TestClassesAndFunctions.test_classify_newstyle.<locals>.Cc                     d S r   r7   rZ   s    r   r  z;TestClassesAndFunctions.test_classify_newstyle.<locals>.C.mK  rl  r   c                     d S r   r7   rZ   s    r   r   z;TestClassesAndFunctions.test_classify_newstyle.<locals>.C.cL  rl  r   N)rG   r\   r]   r  r   r7   r   r   r   r  I  s"        r   r   c                       e Zd Zd ZdS )9TestClassesAndFunctions.test_classify_newstyle.<locals>.Dc                     d S r   r7   rZ   s    r   r  z<TestClassesAndFunctions.test_classify_newstyle.<locals>.D.m1Z  rl  r   N)rG   r\   r]   r  r7   r   r   r4  r  X  s        r   r4  )r   r&  r   )rP   r,  attrsr/  r   r4  s         r   test_classify_newstylez.TestClassesAndFunctions.test_classify_newstyle  s   	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+( a  y/6:E'	) 	) 	)z8V4e=OPPPsOQ/8OPPPsNA.7MNNNsJ*E3EFFFsHa(%058	: 	: 	:tXq)52HIIIz61-unEEEtXq)52MNNNtVQ'0IJJJ	 	 	 	 	 	 	 	 a  sOQ/8OPPPsNA.7MNNNsJ*E3EFFFsHa(%1GHHHtXq)52HIIIz61-unEEEtXq)52MNNNtVQ'0IJJJ	 	 	 	 	 	 	 	
 a  sOQ/8OPPPsHa(%1GHHHsJ*E3EFFFsHa(%1GHHHtXq)52HIIIz61-unEEEtXq)52MNNNtVQ'0IJJJ	 	 	 	 	1 	 	 	 a  sOQ/8OPPPsHa(%1GHHHsJ*E3EFFFsHa(%1GHHHtXq)52HIIIz61-unEEEtXq)52MNNNtVQ'0IJJJJJr   c                    t          t                    D ]@}t          t          |          }t          |t                    rt          j        |           At          t                    }| 	                    ddt          f|d           | 	                    ddt          f|d           | 	                    ddt          f|d	           | 	                    d
dt          f|d	           | 	                    ddt          f|d	           d S )Nr  r  r  r  r  r  r  r  r  __add____and__)dir__builtins__getattr
isinstancer   rJ   r%  r&  boolr   r   )rP   r  r  r  s       r   test_classify_builtin_typesz3TestClassesAndFunctions.test_classify_builtin_typesf  s    %% 	6 	6DlD11G'4(( 6,W555d##y/48%'	) 	) 	)|^S95,	. 	. 	.z8S15,	. 	. 	.y(C0%,	. 	. 	.y(D15,	. 	. 	. 	. 	.r   c                 \    G d dt                     } G d d|          }t          j        dd||j        d                   }|                     |t          j        |                     t          j        dd|d          }|                     |t          j        |                     d S )	Nc                        e Zd Z fdZ xZS )ITestClassesAndFunctions.test_classify_DynamicClassAttribute.<locals>.Metac                 V    |dk    rdS t                                          |          S )NrY  rr   r  r   rP   r  r  s     r   r   zUTestClassesAndFunctions.test_classify_DynamicClassAttribute.<locals>.Meta.__getattr__|  s)    5==!6ww**4000r   rG   r\   r]   r   r	  r
  s   @r   Metar  {  8        1 1 1 1 1 1 1 1 1r   r  c                   .    e Zd Zej        d             ZdS )GTestClassesAndFunctions.test_classify_DynamicClassAttribute.<locals>.VAc                     dS )Nr  r7   rZ   s    r   rY  zKTestClassesAndFunctions.test_classify_DynamicClassAttribute.<locals>.VA.ham      vr   N)rG   r\   r]   r   DynamicClassAttributerY  r7   r   r   VAr    1        (  )(  r   r  r   rY  r  rr   )r   rJ   	Attributer  r   r%  )rP   r  r  should_find_dcashould_find_gas        r   #test_classify_DynamicClassAttributez;TestClassesAndFunctions.test_classify_DynamicClassAttributez  s    	1 	1 	1 	1 	14 	1 	1 	1
	 	 	 	 	4 	 	 	 	 "+E62r{5?QRRow'CB'G'GHHH *5&$GGng&B2&F&FGGGGGr   c                      G fddt                      G fddt                     }t          j        dd||j                  }|                     |t          j        |                     d S )Nc                        e Zd Z fdZd ZdS )DTestClassesAndFunctions.test_classify_overrides_bool.<locals>.NoBoolc                                  S r   r7   )rP   rT   NoBools     r   __eq__zKTestClassesAndFunctions.test_classify_overrides_bool.<locals>.NoBool.__eq__  s    vxxr   c                      t          d          )Nz,This object does not specify a boolean valueNotImplementedErrorrZ   s    r   __bool__zMTestClassesAndFunctions.test_classify_overrides_bool.<locals>.NoBool.__bool__  s    )BD D Dr   N)rG   r\   r]   r  r  r  s   r   r  r    sB                 D D D D Dr   r  c                   $    e Zd Z              ZdS )CTestClassesAndFunctions.test_classify_overrides_bool.<locals>.HasNBN)rG   r\   r]   r  r  s   r   HasNBr    s        BBBr   r  r  r  )r   rJ   r  r  r   r%  )rP   r  should_find_attrr  s      @r   test_classify_overrides_boolz4TestClassesAndFunctions.test_classify_overrides_bool  s    	D 	D 	D 	D 	D 	D 	DV 	D 	D 	D	 	 	 	 	 	 	F 	 	 	 #,T65%(KK&(DU(K(KLLLLLr   c                      G d dt                     } G d d|          }t          j        dd|d          }|                     |t          j        |                     d S )	Nc                       e Zd ZdZd ZdS )MTestClassesAndFunctions.test_classify_metaclass_class_attribute.<locals>.Metaslapc                 
    g dS )N)r  r\   rG   fishr7   rZ   s    r   __dir__zUTestClassesAndFunctions.test_classify_metaclass_class_attribute.<locals>.Meta.__dir__      FFFFr   N)rG   r\   r]   r  r  r7   r   r   r  r    s-        DG G G G Gr   r  c                       e Zd ZdS )NTestClassesAndFunctions.test_classify_metaclass_class_attribute.<locals>.ClassNr   r7   r   r   Classr    r  r   r  r   r  r  r  r   rJ   r  r   r%  rP   r  r  should_finds       r   'test_classify_metaclass_class_attributez?TestClassesAndFunctions.test_classify_metaclass_class_attribute  s    	G 	G 	G 	G 	G4 	G 	G 	G	 	 	 	 	d 	 	 	 	'fEEk7#?#F#FGGGGGr   c                      G d dt                     } G d d|          }t          j        dd|d          }|                     |t          j        |                     d S )	Nc                   $     e Zd Zd Z fdZ xZS )DTestClassesAndFunctions.test_classify_VirtualAttribute.<locals>.Metac                 
    g dS )N)r  r\   rG   BOOMr7   r  s    r   r  zLTestClassesAndFunctions.test_classify_VirtualAttribute.<locals>.Meta.__dir__  r  r   c                 V    |dk    rdS t                                          |          S )Nr  r   )r  _Meta__getattrr  s     r   r   zPTestClassesAndFunctions.test_classify_VirtualAttribute.<locals>.Meta.__getattr__  s)    &==2ww((...r   rG   r\   r]   r  r   r	  r
  s   @r   r  r    sJ        G G G/ / / / / / / / /r   r  c                       e Zd ZdS )ETestClassesAndFunctions.test_classify_VirtualAttribute.<locals>.ClassNr   r7   r   r   r  r    r  r   r  r   r  r  r   r  r  s       r   test_classify_VirtualAttributez6TestClassesAndFunctions.test_classify_VirtualAttribute  s    	/ 	/ 	/ 	/ 	/4 	/ 	/ 	/	 	 	 	 	d 	 	 	 	'bAAk7#?#F#FGGGGGr   c                   	
  G d dt                     	 G d dt                     
 G 	
fdd	
          } G d d		          } G d
 d||	          }t          j        dd	d          }t          j        dd
d          }t          j        dd|d          }t          j        |          }|||fD ]}|                     ||           d S )Nc                   $     e Zd Zd Z fdZ xZS )STestClassesAndFunctions.test_classify_VirtualAttribute_multi_classes.<locals>.Meta1c                 
    g dS )N)r  r\   rG   oner7   r  s    r   r  z[TestClassesAndFunctions.test_classify_VirtualAttribute_multi_classes.<locals>.Meta1.__dir__      EEEEr   c                 V    |dk    rdS t                                          |          S )Nr  r&   r  r  s     r   r   z_TestClassesAndFunctions.test_classify_VirtualAttribute_multi_classes.<locals>.Meta1.__getattr__  )    %<<1ww**4000r   r  r
  s   @r   Meta1r    J        F F F1 1 1 1 1 1 1 1 1r   r   c                   $     e Zd Zd Z fdZ xZS )STestClassesAndFunctions.test_classify_VirtualAttribute_multi_classes.<locals>.Meta2c                 
    g dS )N)r  r\   rG   twor7   r  s    r   r  z[TestClassesAndFunctions.test_classify_VirtualAttribute_multi_classes.<locals>.Meta2.__dir__  r  r   c                 V    |dk    rdS t                                          |          S )Nr  r'   r  r  s     r   r   z_TestClassesAndFunctions.test_classify_VirtualAttribute_multi_classes.<locals>.Meta2.__getattr__  r  r   r  r
  s   @r   Meta2r    r  r   r  c                   ,     e Zd ZfdZ fdZ xZS )STestClassesAndFunctions.test_classify_VirtualAttribute_multi_classes.<locals>.Meta3c           
          t          t          t          g d                    |           z                       |           z                                 S )N)r  r\   rG   three)r   r  rI   r  )r   r   r  s    r   r  z[TestClassesAndFunctions.test_classify_VirtualAttribute_multi_classes.<locals>.Meta3.__dir__  s^    F3'W'W'WMM#&&(').s););(< $= $= > > ? ? ?r   c                 V    |dk    rdS t                                          |          S )Nr  r>  r  r  s     r   r   z_TestClassesAndFunctions.test_classify_VirtualAttribute_multi_classes.<locals>.Meta3.__getattr__  s)    '>>1ww**4000r   r  )r  r   r  s   @r   Meta3r	    sW        ? ? ? ? ? ?1 1 1 1 1 1 1 1 1r   r  c                       e Zd ZdS )TTestClassesAndFunctions.test_classify_VirtualAttribute_multi_classes.<locals>.Class1Nr   r7   r   r   Class1r    r  r   r  r   c                       e Zd ZdS )TTestClassesAndFunctions.test_classify_VirtualAttribute_multi_classes.<locals>.Class2Nr   r7   r   r   Class2r    r  r   r  r  r  r&   r  r'   r  r>  )r   rJ   r  r%  r   )rP   r  r  r  should_find1should_find2should_find3ccasfr   r  s            @@r   ,test_classify_VirtualAttribute_multi_classeszDTestClassesAndFunctions.test_classify_VirtualAttribute_multi_classes  s~   	1 	1 	1 	1 	1D 	1 	1 	1	1 	1 	1 	1 	1D 	1 	1 	1	1 	1 	1 	1 	1 	1 	1 	1E5 	1 	1 	1	 	 	 	 	u 	 	 	 		 	 	 	 	Vu 	 	 	 	 (qAA(qAA(&%CC*622|< 	# 	#BMM"c""""	# 	#r   c                      G d dt                     } G d d|          }d t          j        |          D             }|                     d|           d S )Nc                       e Zd Zd ZdS )KTestClassesAndFunctions.test_classify_class_attrs_with_buggy_dir.<locals>.Mc                 
    g dS N)r  rG   missingr7   r  s    r   r  zSTestClassesAndFunctions.test_classify_class_attrs_with_buggy_dir.<locals>.M.__dir__      ;;;;r   NrG   r\   r]   r  r7   r   r   Mr    #        < < < < <r   r"  c                       e Zd ZdS )KTestClassesAndFunctions.test_classify_class_attrs_with_buggy_dir.<locals>.CNr   r7   r   r   r   r%    r  r   r   r   c                     g | ]
}|d          S r   r7   r}  r   s     r   r~  zTTestClassesAndFunctions.test_classify_class_attrs_with_buggy_dir.<locals>.<listcomp>  s    ???!1???r   r  )r   rJ   r%  r   rP   r"  r   r  s       r   (test_classify_class_attrs_with_buggy_dirz@TestClassesAndFunctions.test_classify_class_attrs_with_buggy_dir  s    	< 	< 	< 	< 	< 	< 	< 	<	 	 	 	 	! 	 	 	 	??w;A>>???E*****r   c                 Z    G d dt                     }d } |t          j                  } |t          j                  }|                     t          j        ||          d|j        d         fg           |                     t          j        ||          d|j        d         fg            G d d|          }|                     t          j        ||          d|j        d         fg           |                     t          j        ||          d|j        d         fg           d S )Nc                   6    e Zd Z e            Z e            ZdS )>TestClassesAndFunctions.test_getmembers_descriptors.<locals>.AN)rG   r\   r]   r  r  r  r  r7   r   r   r,  r-    s*        &&((B((**BBBr   r,  c                 <      G d dt                      fd}|S )Nc                       e Zd ZdS )XTestClassesAndFunctions.test_getmembers_descriptors.<locals>.pred_wrapper.<locals>.EmptyNr   r7   r   r   Emptyr0    s        r   r1  c                 j    dt          |           v rt          | j                  rdS  |           S )NrG   F)r  r   rG   )r   r1  preds    r   r  zZTestClassesAndFunctions.test_getmembers_descriptors.<locals>.pred_wrapper.<locals>.wrapped  s7    Q''GE1:,F,F' 5tAwwr   r   )r3  r  r1  s   ` @r   pred_wrapperzITestClassesAndFunctions.test_getmembers_descriptors.<locals>.pred_wrapper  sS                 Nr   r  r  c                       e Zd ZdS )>TestClassesAndFunctions.test_getmembers_descriptors.<locals>.BNr   r7   r   r   r/  r7    r  r   r/  )r   rJ   ismethoddescriptorr   r  r   r  )rP   r,  r5  r8  r   r/  s         r   test_getmembers_descriptorsz3TestClassesAndFunctions.test_getmembers_descriptors  s   	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+		 		 		 *\'*DEE'<(@AA+A/ABBAJt$%&	( 	( 	(+A/?@@AJt$%&	( 	( 	(	 	 	 	 	 	 	 	 	+A/ABBAJt$%&	( 	( 	(+A/?@@AJt$%&	( 	( 	( 	( 	(r   c                     G d d          }|                      d|j        ft          j        |                     |                     d|j        ft          j        |t          j                              |            }|                      d|j        ft          j        |                     |                      d|j        ft          j        |t          j                             d S )Nc                       e Zd Zd ZdS )9TestClassesAndFunctions.test_getmembers_method.<locals>.Bc                     d S r   r7   rZ   s    r   rP  z;TestClassesAndFunctions.test_getmembers_method.<locals>.B.f  r   r   NrG   r\   r]   rP  r7   r   r   r/  r<    r   r   r/  rP  )r   rP  rJ   r   r   rb   )rP   r/  r   s      r   test_getmembers_methodz.TestClassesAndFunctions.test_getmembers_method  s    	 	 	 	 	 	 	 	 	sACj'"4Q"7"7888#qsW%77;K%L%LMMMACCsACj'"4Q"7"7888sACj'"4Q8H"I"IJJJJJr   c                     G d dt                     } G d d|          } G d d          }|                     dt          j        |                     |                     d	t          j         |                                  |            }|                     d
|j        ft          j        |                     d S )Nc                        e Zd Z fdZ xZS )CTestClassesAndFunctions.test_getmembers_VirtualAttribute.<locals>.Mc                 V    |dk    rdS t                                          |          S )Nr  	scrambledr  )r   r  r  s     r   r   zOTestClassesAndFunctions.test_getmembers_VirtualAttribute.<locals>.M.__getattr__  s)    6>>&;ww**4000r   r  r
  s   @r   r"  rB    r  r   r"  c                   .    e Zd Zej        d             ZdS )CTestClassesAndFunctions.test_getmembers_VirtualAttribute.<locals>.Ac                     dS rq   r7   rZ   s    r   r  zHTestClassesAndFunctions.test_getmembers_VirtualAttribute.<locals>.A.eggs  r  r   N)rG   r\   r]   r   r  r  r7   r   r   r,  rF    r  r   r,  r   c                       e Zd Zd ZdS )CTestClassesAndFunctions.test_getmembers_VirtualAttribute.<locals>.Bc                     d S r   r7   )rP   	attributes     r   r   zOTestClassesAndFunctions.test_getmembers_VirtualAttribute.<locals>.B.__getattr__  r   r   Nr   r7   r   r   r/  rI    r   r   r/  )r  rD  )r  rr   r   )r   r   rJ   r   r   )rP   r"  r,  r/  r   s        r    test_getmembers_VirtualAttributez8TestClassesAndFunctions.test_getmembers_VirtualAttribute  s   	1 	1 	1 	1 	1 	1 	1 	1
	 	 	 	 	! 	 	 	 		 	 	 	 	 	 	 	 	+W-?-B-BCCC&(:1133(?(?@@@ACC}am4g6H6K6KLLLLLr   c                     G d d          } |            }t          j        |          }t          j        |          }|                     dt          j        |d          f|           |                     dt          j        |d          f|           |                     dt          j        |d          f|           |                     dt          j        |d          f|           d S )Nc                   D    e Zd Zed             Zej        d             ZdS )9TestClassesAndFunctions.test_getmembers_static.<locals>.Ac                     t           r   r  rZ   s    r   r  z>TestClassesAndFunctions.test_getmembers_static.<locals>.A.name      ))r   c                     t           r   r  rZ   s    r   r  z>TestClassesAndFunctions.test_getmembers_static.<locals>.A.eggs  rQ  r   N)rG   r\   r]   r  r  r   r  r  r7   r   r   r,  rO    sJ        * * X*(* * )(* * *r   r,  r  r  )rJ   getmembers_staticr   getattr_static)rP   r,  r   instance_membersclass_memberss        r   test_getmembers_staticz.TestClassesAndFunctions.test_getmembers_static  s    	* 	* 	* 	* 	* 	* 	* 	* ACC"4Q771!44vw5a@@ACSTTTvw5a@@ACSTTTvw5a@@A=QQQvw5a@@A=QQQQQr   c                      G d dt                     } G d d|          }d t          j        |          D             }|                     d|           d S )Nc                       e Zd Zd ZdS )ATestClassesAndFunctions.test_getmembers_with_buggy_dir.<locals>.Mc                 
    g dS r  r7   r  s    r   r  zITestClassesAndFunctions.test_getmembers_with_buggy_dir.<locals>.M.__dir__+  r   r   Nr!  r7   r   r   r"  rZ  *  r#  r   r"  c                       e Zd ZdS )ATestClassesAndFunctions.test_getmembers_with_buggy_dir.<locals>.CNr   r7   r   r   r   r]  -  r  r   r   r   c                     g | ]
}|d          S r'  r7   r(  s     r   r~  zJTestClassesAndFunctions.test_getmembers_with_buggy_dir.<locals>.<listcomp>/  s    555!1555r   r  )r   rJ   r   r   r)  s       r   test_getmembers_with_buggy_dirz6TestClassesAndFunctions.test_getmembers_with_buggy_dir)  s    	< 	< 	< 	< 	< 	< 	< 	<	 	 	 	 	! 	 	 	 	55w1!44555E*****r   c                    dt           dt          fd}|                     t          j        |          t           t          d           ddd|_        |                     t          j        |          ddd           |                     t          j        |dt                                |t          d           |                     t          j        |dt                      	          |t          d           t          }|                     t          j        |          t           t          d           |                     t          j        |j                  t           t          d           |                     t          j        |j	                  t           t          |j        d
           |                     t          j        |j
                  t           d|j        |j        d           |                     t          j        |j                  dddd           |                     t          j        t                    i            |                     t          j        |j                  i            |                     t          j        |j                  i            |                     t          j        |d          t           t          d           |                     t          j        |j        d          t           t          d           |                     t          j        |j	        d          t           t          |j        d
           |                     t          j        |j
        d          t           t          |j        |j        d           |                     t          j        |j        d          t           t          |j        d           |                     t          j        t          d          i            |                     t          j        |j        d          i            |                     t          j        |j        d          i            |                     t          j        |d          t           t          d           |                     t          j        |j        d          t           t          d           |                     t          j        |j	        d          t           t          |j        d
           |                     t          j        |j
        d          t           d|j        |j        d           |                     t          j        |j        d          dddd           |                     t          j        t          d          i            |                     t          j        |j        d          i            |                     t          j        |j        d          i            d } ||j	                  }|                      |dd          |                    dd                     |                     |j        |j	        j                   |                     t          j        |          t           t          |j        d
           |                     t          j        |d          t           t          |j        d
           |                     t          j        |d          t           t          |j        d
           d S )Nr   r   c                     d S r   r7   r   s     r   r(   zPTestClassesAndFunctions.test_get_annotations_with_stock_annotations.<locals>.foo3  rl  r   r   r(   r   Teval_strrL  rc  globalsr   r   ri  r   r   r   ri  r   MyClassr   r   r   rc  Fc                 F     t          j                    fd            }|S )Nc                 (     | dz  |dz            S r#  r7   r   r   r  s     r   wrapperziTestClassesAndFunctions.test_get_annotations_with_stock_annotations.<locals>.times_three.<locals>.wrapperY      r!A#qs||#r   r   r[  r  rn  s   ` r   times_threezXTestClassesAndFunctions.test_get_annotations_with_stock_annotations.<locals>.times_threeX  6    _R  $ $ $ $ ! $Nr   r&   r   r>  xxx)r   r   r  rJ   get_annotationsrn  rL  r   rh  r2  	function2	function3UnannotatedClassunannotated_functionassertIsNot__globals__)rP   r(   isarr  r  s        r   +test_get_annotations_with_stock_annotationszCTestClassesAndFunctions.test_get_annotations_with_stock_annotations2  s   #######055Ss7K7KLLL$)u55055U7O7OPPP0tFHHUUU]`gjWkWklll0tVXXVVV^ahkXlXlmmm'055Ss7K7KLLL0==Ss?S?STTT0>>cPS_b_j@k@klll0??sQV]`]htwt  BA  BA  	B  	B  	B0??uSX_hAiAijjj0992>>>01EFFKKK01IJJBOOO0tDDDCVYFZFZ[[[0tLLLTW^aNbNbccc0MMMUX_bnqnyOzOz{{{0NNNVY`cjmju  BE  BM  QN  QN  	O  	O  	O0NNNVY`cjmjuPvPvwww04HHH"MMM01EPTUUUWYZZZ01ITXYYY[]^^^0uEEESWZG[G[\\\0uMMMUX_bOcOcddd0NNNVY`corozP{P{|||0OOOWZafmpmx  EH  EP  RQ  RQ  	R  	R  	R0OOOW\choxQyQyzzz05III2NNN01EPUVVVXZ[[[01ITYZZZ\^___	 	 	 +cl++C#++a*?*?@@@,cl.FGGG0993Z]Ze;f;fggg04HHHPSZ]ilitJuJuvvv05IIIQT[^jmjuKvKvwwwwwr   c                 <   t           }|                     t          j        |          ddd           |                     t          j        |j                  ddd           |                     t          j        |j                  dddd           |                     t          j        |j                  ddddd           |                     t          j        |j                  ddd	d
           |                     t          j        |j                  i            |                     t          j        |j	                  i            |                     t          j        |d          t          t          d           |                     t          j        |j        d          t          t          d           |                     t          j        |j        d          t          t          |j        d           |                     t          j        |j        d          t          d|j        |j        d           |                     t          j        |j        d          dddd
           |                     t          j        |j        d          i            |                     t          j        |j	        d          i            |                     t          j        |d          ddd           |                     t          j        |j        d          ddd           |                     t          j        |j        d          dddd           |                     t          j        |j        d          ddddd           |                     t          j        |j        d          ddd	d
           |                     t          j        |j        d          i            |                     t          j        |j	        d          i            t          }|                     t          j        |          i            |                     t          j        |d          i            |                     t          j        |d          i            d } ||j                  }|                      |dd          |                    dd                     |                     |j        |j        j                   |                     t          j        |          dddd           |                     t          j        |d          t          t          |j        d           |                     t          j        |d          dddd           |                     t          j        |j                  ddi           |                     t          j        |j        d          dt          i           d S )Nr   r   r   rh  rf  'str'rg  'int'	'MyClass'ri  Trj  Fc                 F     t          j                    fd            }|S )Nc                 (     | dz  |dz            S r#  r7   rm  s     r   rn  znTestClassesAndFunctions.test_get_annotations_with_stringized_annotations.<locals>.times_three.<locals>.wrapper  ro  r   rp  rq  s   ` r   rr  z]TestClassesAndFunctions.test_get_annotations_with_stringized_annotations.<locals>.times_three  rs  r   r&   r   r>  rt  mytype)r   r  rJ   ru  rh  r2  rv  rw  rx  ry  r   r   r   rz  r{  MyClassWithLocalAnnotations)rP   r|  isa2rr  r  s        r   0test_get_annotations_with_stringized_annotationszHTestClassesAndFunctions.test_get_annotations_with_stringized_annotationse  s   ,055U7O7OPPP0==UQV?W?WXXX0>>eRWcl@m@mnnn0??uSZajv  BA  BA  	B  	B  	B0??wU\cnAoAoppp01EFFKKK01IJJBOOO0tDDDCVYFZFZ[[[0tLLLTW^aNbNbccc0MMMUX_bnqnyOzOz{{{0NNNVY`elolw  DG  DO  QP  QP  	Q  	Q  	Q0NNNV[bgnwPxPxyyy01EPTUUUWYZZZ01ITXYYY[]^^^0uEEEUY^G_G_```0uMMMUZafOgOghhh0NNNV[bgs|P}P}~~~0OOOW\cjqz  GP  RQ  RQ  	R  	R  	R0OOOW^els~QQ  	A  	A  	A01EPUVVVXZ[[[01ITYZZZ\^___/066;;;0EEErJJJ0FFFKKK	 	 	 +cl++C#++a*?*?@@@,cl.FGGG099U^g;h;hiii04HHHPSZ]ilitJuJuvvv05IIIQV]bnwKxKxyyy 	01PQQTWYaSbccc01P[_```cfhkblmmmmmr   ) rG   r\   r]   r8  rH  rU  r\  rg  rq  r   r  r   r|  r   r  r  r  r  r  r  r  r  r  r  r*  r9  r?  rL  rW  r_  r}  r  r7   r   r   r(  r(    s`       	( 	( 	( BF,0T24259*,	% % % %H H H01 1 15 5 5A A A X_)MO O	I 	IO O	I X_)MO O6 6O O \6 X_)MO O, ,O O \,	> 	> 	>OK OK OKb. . .(H H HM M MH H HH H H!# !# !#F+ + +( ( (@	K 	K 	KM M M$R R R"+ + +1x 1x 1xf.n .n .n .n .nr   r(  c                       e Zd Zd ZdS )TestFormatAnnotationc                     ddl m}m} |                     t	          j        |          d           |                     t	          j        |          d           d S )Nr   )rG  ann1zUnion[List[str], int]z%Union[List[testModule.typing.A], int])test.typinganndata.ann_module9rG  r  r  rJ   formatannotation)rP   rG  r  s      r   test_typing_replacementz,TestFormatAnnotation.test_typing_replacement  sd    <<<<<<<<1#668OPPP1$779`aaaaar   N)rG   r\   r]   r  r7   r   r   r  r    s(        b b b b br   r  c                   &    e Zd Zd Zd Zd Zd ZdS )TestIsDataDescriptorc                     G d d          } G d d          } G d d          } G d d          }|                      t          j         |                      d	           |                     t          j         |                      d
           |                     t          j         |                      d           |                     t          j         |                      d           d S )Nc                       e Zd ZddZdS )GTestIsDataDescriptor.test_custom_descriptors.<locals>.NonDataDescriptorNc                     d S r   r7   )rP   valuer   s      r   r  zOTestIsDataDescriptor.test_custom_descriptors.<locals>.NonDataDescriptor.__get__  rl  r   r   rG   r\   r]   r  r7   r   r   NonDataDescriptorr    s        555555r   r  c                       e Zd Zd ZdS )ETestIsDataDescriptor.test_custom_descriptors.<locals>.DataDescriptor0c                     d S r   r7   )rP   r  r  s      r   r  zMTestIsDataDescriptor.test_custom_descriptors.<locals>.DataDescriptor0.__set__  rl  r   NrG   r\   r]   r  r7   r   r   DataDescriptor0r    s        00000r   r  c                       e Zd Zd ZdS )ETestIsDataDescriptor.test_custom_descriptors.<locals>.DataDescriptor1c                     d S r   r7   )rP   r  s     r   
__delete__zPTestIsDataDescriptor.test_custom_descriptors.<locals>.DataDescriptor1.__delete__  rl  r   N)rG   r\   r]   r  r7   r   r   DataDescriptor1r    s        ,,,,,r   r  c                       e Zd ZdZdS )ETestIsDataDescriptor.test_custom_descriptors.<locals>.DataDescriptor2Nr  r7   r   r   DataDescriptor2r    s        GGGr   r  z-class with only __get__ not a data descriptorz'class with __set__ is a data descriptorz*class with __delete__ is a data descriptorz.class with __set__ = None is a data descriptor)rO   rJ   r   rF   )rP   r  r  r  r  s        r   test_custom_descriptorsz,TestIsDataDescriptor.test_custom_descriptors  sv   	6 	6 	6 	6 	6 	6 	6 	6	1 	1 	1 	1 	1 	1 	1 	1	- 	- 	- 	- 	- 	- 	- 	-	 	 	 	 	 	 	 	12C2C2E2EFFH	J 	J 	J01B1BCCA	C 	C 	C01B1BCCD	F 	F 	F01B1BCCH	J 	J 	J 	J 	Jr   c                 z     G d d          }|                      t          j        |j                  d           d S )Nc                       e Zd ZdZdS )/TestIsDataDescriptor.test_slot.<locals>.Slottedr(   Nr   r7   r   r   Slottedr    s        IIIr   r  za slot is a data descriptor)rF   rJ   r   r(   )rP   r  s     r   	test_slotzTestIsDataDescriptor.test_slot  s\    	 	 	 	 	 	 	 	0==5	7 	7 	7 	7 	7r   c                 z     G d d          }|                      t          j        |j                  d           d S )Nc                   $    e Zd Zed             ZdS )6TestIsDataDescriptor.test_property.<locals>.Propertiedc                     d S r   r7   rZ   s    r   
a_propertyzATestIsDataDescriptor.test_property.<locals>.Propertied.a_property  r   r   N)rG   r\   r]   r  r  r7   r   r   
Propertiedr    s-          X  r   r  za property is a data descriptor)rF   rJ   r   r  )rP   r  s     r   test_propertyz"TestIsDataDescriptor.test_property  s_    	 	 	 	 	 	 	 	 	01FGG9	; 	; 	; 	; 	;r   c                     G d dt                     }d }d }|                     t          j         |            j                  d           |                     t          j         |            j                  d           |                     t          j         |            j                  d           |                     t          j        |          d           |                     t          j        |          d	           d S )
Nc                   @    e Zd Zd Zed             Zed             ZdS )1TestIsDataDescriptor.test_functions.<locals>.Testc                     d S r   r7   rZ   s    r   instance_methodzATestIsDataDescriptor.test_functions.<locals>.Test.instance_method  rl  r   c                     d S r   r7   r  s    r   class_methodz>TestIsDataDescriptor.test_functions.<locals>.Test.class_method  s    #'4r   c                      d S r   r7   r7   r   r   static_methodz?TestIsDataDescriptor.test_functions.<locals>.Test.static_method  s    !%r   N)rG   r\   r]   r  r  r  r  r  r7   r   r   Testr    s?        +++'' ['%% \%%%r   r  c                      d S r   r7   r7   r   r   r2  z5TestIsDataDescriptor.test_functions.<locals>.function  r`  r   c                      d S r   r7   r7   r   r   r   z5TestIsDataDescriptor.test_functions.<locals>.<lambda>  s    4 r   z*a instance method is not a data descriptorz'a class method is not a data descriptorz(a static method is not a data descriptorz#a function is not a data descriptorz!a lambda is not a data descriptor)r   rO   rJ   r   r  r  r  )rP   r  r2  a_lambdas       r   test_functionsz#TestIsDataDescriptor.test_functions  s;   	& 	& 	& 	& 	&6 	& 	& 	&	 	 	<1$$&&2HIIE	G 	G 	G1$$&&2EFFB	D 	D 	D1$$&&2FGGC	E 	E 	E1(;;>	@ 	@ 	@1(;;<	> 	> 	> 	> 	>r   N)rG   r\   r]   r  r  r  r  r7   r   r   r  r    sS        J J J$7 7 7; ; ;> > > > >r   r  c                   J    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 ZdS )TestGetClosureVarsc                     d }t                      }d|i}dt          i}dt          i}dh}t          j        ||||          }|                     t          j         ||                    |           d S )Nc                       fd}|S )Nc                 @    t          | t          t                     d S r   print_global_refunbound_ref	local_refnonlocal_refs    r   rQ  z=TestGetClosureVars.test_name_resolution.<locals>.f.<locals>.g  s    i{KHHHHHr   r7   r  rQ  s   ` r   rP  z2TestGetClosureVars.test_name_resolution.<locals>.f  s&    I I I I IHr   r  r  r  r  r   r  r  rJ   ClosureVarsr  getclosurevarsrP   rP  _argnonlocal_varsglobal_varsbuiltin_varsunbound_namesr6  s           r   test_name_resolutionz'TestGetClosureVars.test_name_resolution  s    	 	 	 xx'.$k2'&&}k'3]D D/$88(CCCCCr   c                     d }t                      }d|i}dt          i}dt          i}dh}t          j        ||||          }|                     t          j         ||                    |           d S )Nc                       fd}|S )Nc              3   L   K   t          | t          t                     d V  d S r   r  r  s    r   rQ  z?TestGetClosureVars.test_generator_closure.<locals>.f.<locals>.g  s(      i{KHHHr   r7   r  s   ` r   rP  z4TestGetClosureVars.test_generator_closure.<locals>.f  s#         Hr   r  r  r  r  r  r  s           r   test_generator_closurez)TestGetClosureVars.test_generator_closure  s    	 	 	
 xx'.$k2'&&}k'3]D D/$88(CCCCCr   c                 "    G d d          }t                      }d|i}dt          i}dt          i}dh}t          j        ||||          }|                     t          j         |                                |                    |           d S )Nc                       e Zd Zd ZdS )1TestGetClosureVars.test_method_closure.<locals>.Cc                     fd}|S )Nc                 @    t          | t          t                     d S r   r  r  s    r   rQ  z>TestGetClosureVars.test_method_closure.<locals>.C.f.<locals>.g  s    )\;LLLLLr   r7   )rP   r  rQ  s    ` r   rP  z3TestGetClosureVars.test_method_closure.<locals>.C.f  s&    M M M M Mr   Nr>  r7   r   r   r   r    s#            r   r   r  r  r  r  )r   r  r  rJ   r  r  r  rP  )rP   r   r  r  r  r  r  r6  s           r   test_method_closurez&TestGetClosureVars.test_method_closure  s    	 	 	 	 	 	 	 	
 xx'.$k2'&&}k'3]D D/d<<hGGGGGr   c                    	 d 	d }d }d }fd	 fd} |d          } |d          } ||d	          }                       	|          d
di                                  	|          d
di                                  	|          d	|d                                  	 d d                    d
di            |           d S )Nc                 4    t          j        |           j        S r   )rJ   r  	nonlocalsrP  s    r   _nonlocal_varsz=TestGetClosureVars.test_nonlocal_vars.<locals>._nonlocal_vars  s    )!,,66r   c                       fd}|S )Nc                     | z   S r   r7   rD  r   s    r   addzFTestGetClosureVars.test_nonlocal_vars.<locals>.make_adder.<locals>.add  s    1ur   r7   )r   r  s   ` r   
make_adderz9TestGetClosureVars.test_nonlocal_vars.<locals>.make_adder
  s!        Jr   c                       fdS )Nc                      |           S r   r7   )rK  rJ  r  s    r   r   zFTestGetClosureVars.test_nonlocal_vars.<locals>.curry.<locals>.<lambda>  s    T4 0 0 r   r7   )r  rJ  s   ``r   curryz4TestGetClosureVars.test_nonlocal_vars.<locals>.curry  s    000000r   c                     | |k     S r   r7   r   s     r   	less_thanz8TestGetClosureVars.test_nonlocal_vars.<locals>.less_than  s    q5Lr   c                 4      fd}|_          ||          S )Nc                 "       fd          S )Nc                 ,                |           S r   r7   )r   rP  s    r   r   zMTestGetClosureVars.test_nonlocal_vars.<locals>.Y.<locals>.g.<locals>.<lambda>  s    DAAaDDGG r   r7   )rP  les   `r   rQ  z;TestGetClosureVars.test_nonlocal_vars.<locals>.Y.<locals>.g  s    r++++,,,r   )g_ref)r  rQ  Ys   ` r   r  z0TestGetClosureVars.test_nonlocal_vars.<locals>.Y  s1    - - - - -AG1Q44Kr   c                 T                          |           dj        i           d S )NrP  )r  r  )r  r  r  rP   s    r   check_y_combinatorzATestGetClosureVars.test_nonlocal_vars.<locals>.check_y_combinator  s/    ^^D11C>BBBBBr   r&   r'   r   r   )rJ  r  c                       fdS )Nc                     | z   S r   r7   r  s    r   r   zITestGetClosureVars.test_nonlocal_vars.<locals>.<lambda>.<locals>.<lambda>'  s    QU r   r7   r   s   `r   r   z7TestGetClosureVars.test_nonlocal_vars.<locals>.<lambda>'  s    ???? r   r>  )r  )
rP   r  r  r  r  incadd_twogreater_than_fiver  r  s
   `       @@r   test_nonlocal_varsz%TestGetClosureVars.test_nonlocal_vars  s{   	7 	7 	7	 	 	
	1 	1 	1	 	 		 	 	 	 		C 	C 	C 	C 	C 	C 	C jmm*Q--!E)Q//,,sAh777003(;;;(9::"#Y77	9 	9 	9)B)B)BA(F(FGGq	# 	# 	#	
r   c                     d }t          j        i i i t                                }|                     t          j        d           |           |                     t          j        |          |           d S )Nc                      d S r   r7   r7   r   r   r(   z9TestGetClosureVars.test_getclosurevars_empty.<locals>.foo,  rl  r   c                      dS NTr7   r7   r   r   r   z>TestGetClosureVars.test_getclosurevars_empty.<locals>.<lambda>.  s     r   )rJ   r  rI   r  r  )rP   r(   _emptys      r   test_getclosurevars_emptyz,TestGetClosureVars.test_getclosurevars_empty+  sm    $RR77/==vFFF/44f=====r   c                     G d d          }|                      t          t          j        d           |                      t          t          j        t                     |                      t          t          j        i            d S )Nc                       e Zd ZdS )7TestGetClosureVars.test_getclosurevars_error.<locals>.TNr   r7   r   r   Tr  2  r   r   r	  r&   )r  r  rJ   r  r   )rP   r	  s     r   test_getclosurevars_errorz,TestGetClosureVars.test_getclosurevars_error1  sj    )W%;Q???)W%;TBBB)W%;R@@@@@r   c                 >    d}i }t          ||           |d         |fS )Nzdef f(): print(path)rP  )r-   )rP   r  r  s      r   _private_globalsz#TestGetClosureVars._private_globals7  s'    )T2#w{r   c                     |                                  \  }}|                    dd            t          j        i i dt          idh          }|                     t          j        |          |           d S )Nr  r  r  )r  poprJ   r  r  r  r  rP   rP  r  r6  s       r   test_builtins_fallbackz)TestGetClosureVars.test_builtins_fallback=  sn    %%''2
~t$$$&r2II/22H=====r   c                     |                                  \  }}ddi|d<   t          j        i i ddidh          }|                     t          j        |          |           d S )Nr  r&   r  r  )r  rJ   r  r  r  r  s       r   test_builtins_as_dictz(TestGetClosureVars.test_builtins_as_dictC  sh    %%''2$QZ>&r2qzG9EE/22H=====r   c                     |                                  \  }}t          |d<   t          j        i i dt          j        idh          }|                     t          j        |          |           d S )Nr  r  r  )r  r  rJ   r  r  r  r  r  s       r   test_builtins_as_modulez*TestGetClosureVars.test_builtins_as_moduleI  sg    %%''2>&r2rw/?'KK/22H=====r   N)rG   r\   r]   r  r  r  r  r  r
  r  r  r  r  r7   r   r   r  r    s        D D DD D DH H H$ $ $L> > >A A A  > > >> > >> > > > >r   r  c                   N    e Zd ZddZddZd Zd Zd Zd Zd Z	d	 Z
d
 Zd ZdS )TestGetcallargsFunctionsNc                     t          |pi |          }t          d|z  d |          }t          d|z  d |          }|                     ||           d S )Nr  func(%s)inspect.getcallargs(func, %s))r   rE   r  )rP   r  call_params_stringlocsr1r2s         r   assertEqualCallArgsz,TestGetcallargsFunctions.assertEqualCallArgsR  sh    DJBT****114>>14FF R     r   c                     t          |pi |          }	 t          d|z  d |           |                     d           n# t          $ r}|}Y d }~nd }~ww xY w	 t          d|z  d |           |                     d           n# t          $ r}|}Y d }~nd }~ww xY w|                     t          |          t          |                     |                     t          |          t          |                     ~~d S )Nr  r  zException not raisedr  )r   rE   failr   r-  r   r  r   )rP   r  call_param_stringr  r   ex1ex2s          r   assertEqualExceptionz-TestGetcallargsFunctions.assertEqualExceptionY  s7   DJBT***	.//t<<< II,----  	 	 	CCCCCC		.03DDd  
 II,----  	 	 	CCCCCC	 	d3iic+++S3s88,,,s-   ? 
A	AAB 
BBBc                 ,    	 d}t          ||z            S )Nzlambda %s: locals())rE   )rP   r  r  s      r   makeCallablez%TestGetcallargsFunctions.makeCallablel  s    9$D9$%%%r   c                 H   |                      d          }|                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d	           |                     |d
           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           d S )Na, b=122, 3a=2zb=3, a=2z2, b=3z*(2,)z*[2]z*(2, 3)z*[2, 3]z	**{"a":2}zb=3, **{"a":2}z2, **{"b":3}z**{"b":3, "a":2}z*collections.UserList([2])z*collections.UserList([2, 3])z**collections.UserDict(a=2)z2, **collections.UserDict(b=3)z b=2, **collections.UserDict(a=3)r'  r  rP   rP  s     r   
test_plainz#TestGetcallargsFunctions.test_plainq  s   h''  C(((  F+++  E***  J///  H---  G,,,  F+++  I...  I...  K000  $4555  N333  $6777  $@AAA  $CDDD  $ABBB  $DEEE  $FGGGGGr   c                 8   |                      d          }|                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           d S )Nz
a, b=1, *cr*  r+  2, 3, 4z*(2,3,4)z	2, *[3,4]z 2, 3, *collections.UserList([4])r-  r.  s     r   test_varargsz%TestGetcallargsFunctions.test_varargs  s    l++  C(((  F+++  I...  J///  K000  $FGGGGGr   c                    |                      d          }|                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d	           |                     |d
           d S )Nza, b=1, **cr,  z2, b=3, c=4zb=3, a=2, c=4zc=4, **{"a":2, "b":3}z2, c=4, **{"b":3}zb=2, **{"a":3, "c":4}z%**collections.UserDict(a=2, b=3, c=4)z#2, c=4, **collections.UserDict(b=3)z%b=2, **collections.UserDict(a=3, c=4)r-  r.  s     r   
test_varkwz#TestGetcallargsFunctions.test_varkw  s    m,,  E***  M222  O444  $;<<<  $7888  $;<<<  $KLLL  $IJJJ  $KLLLLLr   c                 8   |                      d          }|                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           d S )N**cr   za=1za=1, b=2zc=3, **{"a": 1, "b": 2}z **collections.UserDict(a=1, b=2)z%c=3, **collections.UserDict(a=1, b=2)r-  r.  s     r   test_varkw_onlyz(TestGetcallargsFunctions.test_varkw_only  s    e$$  B'''  E***  J///  $=>>>  $FGGG  $KLLLLLr   c                 >   |                      d          }|                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d	           |                      d
          }|                     |d           |                     |d           |                     |d           d S )Nza=3, *, c, d=2zc=3zc=3, a=3za=2, c=4z4, c=4r   3za=3zd=4z	*, c, d=2zc=3, d=4zd=4, c=3)r'  r  r%  r.  s     r   test_keyword_onlyz*TestGetcallargsFunctions.test_keyword_only  s!   .//  E***  J///  J///  H---!!!R(((!!!S)))!!!U+++!!!U+++k**  E***  J///  J/////r   c                    |                      d          }|                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                      d	          }|                     |d           |                     |d           |                     |d
           |                     |d           |                     |d           |                     |d           d S )Nza, b=2, *f, **gz2, 3, 7z	2, 3, x=8z2, 3, x=8, *[(4,[5,6]), 7]z2, x=8, *[3, (4,[5,6]), 7], y=9zx=8, *[2, 3, (4,[5,6])], y=9z@x=8, *collections.UserList([2, 3, (4,[5,6])]), **{"y":9, "z":10}zP2, x=8, *collections.UserList([3, (4,[5,6])]), **collections.UserDict(y=9, z=10)za, b=2, *f, x, y=99, **gz%2, x=8, *[3, (4,[5,6]), 7], y=9, z=10z"x=8, *[2, 3, (4,[5,6])], y=9, z=10zEx=8, *collections.UserList([2, 3, (4,[5,6])]), q=0, **{"y":9, "z":10}zU2, x=8, *collections.UserList([3, (4,[5,6])]), q=0, **collections.UserDict(y=9, z=10)r-  r.  s     r   test_multiple_featuresz/TestGetcallargsFunctions.test_multiple_features  s   /00  I...  K000  $@AAA  $EFFF  $BCCC   %I 	J 	J 	J   %. 	/ 	/ 	/ 899  K000  $@AAA  $KLLL  $HIII   %N 	O 	O 	O   %. 	/ 	/ 	/ 	/ 	/r   c                 @	   |                      d          }|                      d          }|                      d          }|                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           ||fD ]!}|                     |d	           |                     |d
           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           #|                      d          }|                     |d           |                     |d           |                      d          }|                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           |                     |d           d }|                     t          d           5  t	          j        |           d d d            n# 1 swxY w Y   d! }|                     t          d"          5  t	          j        |           d d d            n# 1 swxY w Y   |                     t          d#          5  t	          j        d$t          j        j        d%&           d d d            n# 1 swxY w Y   |                     t          d'          5  t	          j        d(d)d%&           d d d            n# 1 swxY w Y   |                     t          d*          5  t	          j        d+d,-           d d d            d S # 1 swxY w Y   d S ).Nr   za, br)  r  r  z1,x=1r,  zb=3r1  z1, 2, 3, a=1z2, 3, 4, c=5z2, 3, 4, a=1, c=5zc=2z2, c=3z	2, 3, c=4z2, c=4, b=3u   **{u"πι": 4}z1, a=2z1, **{"a":2}z	1, 2, b=3z1, c=3, a=2r6  z1, 2z1, 2, a=1, b=2z	*, a, b=0za=1, a=3za=1, c=3za=1, a=3, b=4za=1, b=2, a=3, b=4za=1, a=2, a=3, b=4c                     d S r   r7   rk  s    r   f5z0TestGetcallargsFunctions.test_errors.<locals>.f5  rl  r   zmissing 1 required keyword-onlyc                     d S r   r7   ri  s      r   f6z0TestGetcallargsFunctions.test_errors.<locals>.f6  r`  r   z'a', 'b' and 'c'z6variadic keyword parameters cannot have default valuesr(   r   kinddefaultz%value 5 is not a valid Parameter.kindr    r   zname must be a str, not a int{   r   rC  )	r'  r%  r  r  rJ   getcallargs
ValueErrorrb  VAR_KEYWORD)	rP   f0f1f2rP  f3f4r?  rA  s	            r   test_errorsz$TestGetcallargsFunctions.test_errors  s   r""v&&x((!!"c***!!"e,,,!!"g...!!"b)))!!"c***!!"e,,,!!"e,,,!!"b)))!!"e,,,R 	8 	8A%%a333%%a888%%a888%%a)<===%%a///%%a222%%a555%%a777%%a)ABBB%%a222%%a888%%a555%%a7777u%%!!"f---!!"&6777{++!!"f---!!"&6777!!"j111!!"j111!!"o666!!"&:;;;!!"&:;;; 	##I$EG G 	$ 	$###	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$	 	 	##I/ABB 	$ 	$###	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ ##J%;< < 	* 	* e'*;*G&(* * * *	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	*
 ##J$KM M 	9 	9e!R8888	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 ##I#BD D 	+ 	+c****	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+sZ   ;MM #M N&&N*-N*'O??PP%Q		QQ/RRRr   )rG   r\   r]   r  r%  r'  r/  r2  r4  r7  r:  r<  rO  r7   r   r   r  r  P  s        ! ! ! !   && & &
H H H.H H H
M 
M 
MM M M0 0 0 / / /0H+ H+ H+ H+ H+r   r  c                   $     e Zd Zd Z fdZ xZS )TestGetcallargsMethodsc                 X     G d dt                     }|| _         |            | _        d S )Nc                       e Zd ZdS ))TestGetcallargsMethods.setUp.<locals>.FooNr   r7   r   r   FoorT    r  r   rU  )r   r   inst)rP   rU  s     r   ra  zTestGetcallargsMethods.setUp  sD    	 	 	 	 	& 	 	 	CEE			r   c                     t          t          |           j        } |d|z             | j        _        | j        j        S )Nzself, )r  rQ  r'  r   r  rV  )rP   r  mkr  s      r   r'  z#TestGetcallargsMethods.makeCallable!  s9    )400="X	122yr   )rG   r\   r]   ra  r'  r	  r
  s   @r   rQ  rQ    sG                           r   rQ  c                   >     e Zd Z fdZd fd	Zd fd	ZddZ xZS )TestGetcallargsUnboundMethodsc                 l    t          t          |                               |           | j        j        S r   )r  rZ  r'  r   r  )rP   r  r  s     r   r'  z*TestGetcallargsUnboundMethods.makeCallable)  s,    +T22??	JJJxr   Nc                 h     t          t          |           j        |                     |||           S r   )r  rZ  r  _getAssertEqualParamsrP   r  r  r  r  s       r   r  z1TestGetcallargsUnboundMethods.assertEqualCallArgs-  s8    Mu2D99M''.@$GGI 	Ir   c                 h     t          t          |           j        |                     |||           S r   )r  rZ  r%  r]  r^  s       r   r%  z2TestGetcallargsUnboundMethods.assertEqualException1  s8    Nu2D99N''.@$GGI 	Ir   c                 B    t          |pi | j                  }|d|z   |fS )N)rV  zinst,)r   rV  )rP   r  r  r  s       r   r]  z3TestGetcallargsUnboundMethods._getAssertEqualParams5  s-    DJBTY///g 22D99r   r   )rG   r\   r]   r'  r  r%  r]  r	  r
  s   @r   rZ  rZ  '  s            I I I I I II I I I I I: : : : : : : :r   rZ  c                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdS )TestGetattrStaticc                     G d dt                     } |            }|                     t          j        |d          |j                   |                     t          j        |dd           |j                   |                     t                    5  t          j        |d           d d d            n# 1 swxY w Y   |                     t          j        |dd          d           d S )Nc                   "    e Zd Z e            ZdS )+TestGetattrStatic.test_basic.<locals>.ThingNrG   r\   r]   r   r   r7   r   r   Thingre  >          AAAr   rg  r   rD  r>  )r   r  rJ   rT  r   r  r  rP   rg  things      r   
test_basiczTestGetattrStatic.test_basic=  s.   	 	 	 	 	F 	 	 	 /s;;UWEEE/sDAA57KKK~.. 	/ 	/"5#...	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/sA>>BBBBBs   B77B;>B;c                      G d dt                     } G d d|          } |            }|                     t          j        |d          |j                   d S )Nc                   "    e Zd Z e            ZdS )/TestGetattrStatic.test_inherited.<locals>.ThingNrf  r7   r   r   rg  rn  J  rh  r   rg  c                       e Zd ZdS )4TestGetattrStatic.test_inherited.<locals>.OtherThingNr   r7   r   r   
OtherThingrp  L  r  r   rq  r   r   r  rJ   rT  r   )rP   rg  rq  	somethings       r   test_inheritedz TestGetattrStatic.test_inheritedI  s    	 	 	 	 	F 	 	 		 	 	 	 	 	 	 	 JLL	/	3??IIIIIr   c                      G d dt                     } |d          }|                     t          j        |d          d           |`|                     t          j        |d          d           d S )Nc                       e Zd ZdZd ZdS )3TestGetattrStatic.test_instance_attr.<locals>.Thingr'   c                     || _         d S r   r  rP   r   s     r   r   z<TestGetattrStatic.test_instance_attr.<locals>.Thing.__init__U  s    r   N)rG   r\   r]   r   r   r7   r   r   rg  rw  S  s(        A    r   rg  r>  r   r'   rr  ri  s      r   test_instance_attrz$TestGetattrStatic.test_instance_attrR  s    	 	 	 	 	F 	 	 	 a/s;;Q???G/s;;Q?????r   c                      G d dt                     } |            }|                     t          j        |d          |j                   d S )Nc                   $    e Zd Zed             ZdS ).TestGetattrStatic.test_property.<locals>.Thingc                      t          d          NzI'm pretending not to existr  rZ   s    r   r   z0TestGetattrStatic.test_property.<locals>.Thing.x^  s    $%BCCCr   N)rG   r\   r]   r  r   r7   r   r   rg  r}  ]  s2        D D XD D Dr   rg  r   rr  ri  s      r   r  zTestGetattrStatic.test_property\  sl    	D 	D 	D 	D 	DF 	D 	D 	D /s;;UWEEEEEr   c                      G d dt                     } |             G fddt                     } |            }|                     t          j        |d                     d S )Nc                       e Zd Zd ZdS )KTestGetattrStatic.test_descriptor_raises_AttributeError.<locals>.descriptorc                       t          d          r  r  )r9  s    r   r  zSTestGetattrStatic.test_descriptor_raises_AttributeError.<locals>.descriptor.__get__f  s    $%BCCCr   Nr  r7   r   r   
descriptorr  e  s(        D D D D Dr   r  c                       e Zd Z ZdS )FTestGetattrStatic.test_descriptor_raises_AttributeError.<locals>.ThingNrG   r\   r]   r   )descs   r   rg  r  i  s        AAAr   rg  r   )r   r  rJ   rT  )rP   r  rg  rj  r  s       @r   %test_descriptor_raises_AttributeErrorz7TestGetattrStatic.test_descriptor_raises_AttributeErrord  s    	D 	D 	D 	D 	D 	D 	D 	D z||	 	 	 	 	 	 	F 	 	 	/s;;TBBBBBr   c                      G d dt                     }|                     t          j        |d          |j                   d S )Nc                   "    e Zd Z e            ZdS )4TestGetattrStatic.test_classAttribute.<locals>.ThingNrf  r7   r   r   rg  r  o  rh  r   rg  r   rr  rP   rg  s     r   test_classAttributez%TestGetattrStatic.test_classAttributen  sY    	 	 	 	 	F 	 	 	 	/s;;UWEEEEEr   c                      G d dt                     }|                     t          j        |d          |j        d                    d S )Nc                   B    e Zd Zej        d             Z e            ZdS );TestGetattrStatic.test_classVirtualAttribute.<locals>.Thingc                     | j         S r   )_xrZ   s    r   r   z=TestGetattrStatic.test_classVirtualAttribute.<locals>.Thing.xv  s	    wr   N)rG   r\   r]   r   r  r   r   r  r7   r   r   rg  r  u  s6        (  )(BBBr   rg  r   )r   r  rJ   rT  r  r  s     r   test_classVirtualAttributez,TestGetattrStatic.test_classVirtualAttributet  s^    	 	 	 	 	F 	 	 	 	/s;;U^C=PQQQQQr   c                      G d dt                     } G d d|          }|                     t          j        |d          |j                   d S )Nc                   "    e Zd Z e            ZdS )>TestGetattrStatic.test_inherited_classattribute.<locals>.ThingNrf  r7   r   r   rg  r  ~  rh  r   rg  c                       e Zd ZdS )CTestGetattrStatic.test_inherited_classattribute.<locals>.OtherThingNr   r7   r   r   rq  r    r  r   rq  r   rr  rP   rg  rq  s      r   test_inherited_classattributez/TestGetattrStatic.test_inherited_classattribute}  s    	 	 	 	 	F 	 	 		 	 	 	 	 	 	 	 	/
C@@%'JJJJJr   c                 N    G d dt                     } |            }|                     t          j        |d          |j                   |                     t          j        |d          d           |`|                     t          j        |d          |j                   d S )Nc                       e Zd ZdZdgZd ZdS )+TestGetattrStatic.test_slots.<locals>.Thingr    r   c                     d| _         d S Nr(   r  rZ   s    r   r   z4TestGetattrStatic.test_slots.<locals>.Thing.__init__      r   N)rG   r\   r]   rD  r   r   r7   r   r   rg  r    s/        AI    r   rg  r   rD  r    rr  ri  s      r   
test_slotszTestGetattrStatic.test_slots  s    	 	 	 	 	F 	 	 	
 /s;;UWEEE/s;;UCCCG/s;;UWEEEEEr   c                     G d dt                     } G d dt          |          }|                     t          j        |d          d            G d d	|          } G d
 dt          |          }|                     t          j        |d          d            G d d|          }|                     t          j        |d          d           d S )Nc                       e Zd ZdZdS ).TestGetattrStatic.test_metaclass.<locals>.metar(   N)rG   r\   r]   r   r7   r   r   metar    s        DDDr   r  c                       e Zd ZdS )/TestGetattrStatic.test_metaclass.<locals>.ThingNr   r7   r   r   rg  r    r  r   rg  r   r   r(   c                       e Zd ZdS )-TestGetattrStatic.test_metaclass.<locals>.subNr   r7   r   r   subr    r  r   r  c                       e Zd ZdZdS )4TestGetattrStatic.test_metaclass.<locals>.OtherThingr>  Nr  r7   r   r   rq  r            AAAr   rq  c                       e Zd ZdS )9TestGetattrStatic.test_metaclass.<locals>.OtherOtherThingNr   r7   r   r   OtherOtherThingr    r  r   r  r   r>  r   r   r  rJ   rT  )rP   r  rg  r  rq  r  s         r   test_metaclassz TestGetattrStatic.test_metaclass  sS   	 	 	 	 	4 	 	 		 	 	 	 	Fd 	 	 	 	/v>>FFF	 	 	 	 	$ 	 	 		 	 	 	 	3 	 	 	 	/
FCCUKKK	 	 	 	 	j 	 	 	 	/EEqIIIIIr   c                     |                      t          j        ddd           d            |                     t          j        dd          d            d S )Nr&   r(   lower)r  rJ   rT  assertNotEqualrZ   s    r   test_no_dict_no_slotsz'TestGetattrStatic.test_no_dict_no_slots  sP    /5$??FFFG25'BBDIIIIIr   c                     t          t          d          5 }|                     t          j        |d          t          |          j                   d d d            d S # 1 swxY w Y   d S )NrX  rY  r  )r[  r1  r  rJ   rT  r   r  )rP   handles     r   %test_no_dict_no_slots_instance_memberz7TestGetattrStatic.test_no_dict_no_slots_instance_member  s    (W--- 	XW3FFCCT&\\EVWWW	X 	X 	X 	X 	X 	X 	X 	X 	X 	X 	X 	X 	X 	X 	X 	X 	X 	Xs   <A  A$'A$c                      G d dt                     } G d d|          }|                     t          j         |            d          |j                   d S )Nc                       e Zd ZdgZd ZdS )5TestGetattrStatic.test_inherited_slots.<locals>.Thingr   c                     d| _         d S r  r  rZ   s    r   r   z>TestGetattrStatic.test_inherited_slots.<locals>.Thing.__init__  r  r   N)rG   r\   r]   r   r   r7   r   r   rg  r    s*        I    r   rg  c                       e Zd ZdS ):TestGetattrStatic.test_inherited_slots.<locals>.OtherThingNr   r7   r   r   rq  r    r  r   rq  r   rr  r  s      r   test_inherited_slotsz&TestGetattrStatic.test_inherited_slots  s    	 	 	 	 	F 	 	 	
	 	 	 	 	 	 	 	 	/

cBBEGLLLLLr   c                     G d dt                      G fddt                     } |            }d|j        d<   |                     t          j        |d          d           d _        |                     t          j        |d          |j        d                    `d _        |                     t          j        |d          |j        d                    d S )	Nc                       e Zd Zd ZdS )5TestGetattrStatic.test_descriptor.<locals>.descriptorc                     dS r#  r7   rP   instanceowners      r   r  z=TestGetattrStatic.test_descriptor.<locals>.descriptor.__get__      qr   Nr  r7   r   r   r  r    #            r   r  c                   $    e Zd Z              ZdS ).TestGetattrStatic.test_descriptor.<locals>.FooNrG   r\   r]   rO  r  s   r   rU  r            
AAAr   rU  r&   rO  c                     d S r   r7   )r  r/   vs      r   r   z3TestGetattrStatic.test_descriptor.<locals>.<lambda>  s    T r   c                     d S r   r7   )r  r/   r   s      r   r   z3TestGetattrStatic.test_descriptor.<locals>.<lambda>  s     r   )r   r  r  rJ   rT  r  r  )rP   rU  r(   r  s      @r   test_descriptorz!TestGetattrStatic.test_descriptor  s   	 	 	 	 	 	 	 		 	 	 	 	 	 	& 	 	 	 cee S/S991=== 21
/S993<;LMMM 4 4
/S993<;LMMMMMr   c                      G d dt                      G fddt                    } G d dt           |          }|                     t          j        |d          |j        d                    d S )	Nc                       e Zd Zd ZdS )DTestGetattrStatic.test_metaclass_with_descriptor.<locals>.descriptorc                     dS r#  r7   r  s      r   r  zLTestGetattrStatic.test_metaclass_with_descriptor.<locals>.descriptor.__get__  r  r   Nr  r7   r   r   r  r    r  r   r  c                   $    e Zd Z              ZdS )>TestGetattrStatic.test_metaclass_with_descriptor.<locals>.metaNr  r  s   r   r  r    r  r   r  c                       e Zd ZdS )?TestGetattrStatic.test_metaclass_with_descriptor.<locals>.ThingNr   r7   r   r   rg  r    r  r   rg  r   rO  )r   r   r  rJ   rT  r  )rP   r  rg  r  s      @r   test_metaclass_with_descriptorz0TestGetattrStatic.test_metaclass_with_descriptor  s    	 	 	 	 	 	 	 		 	 	 	 	 	 	4 	 	 		 	 	 	 	Fd 	 	 	 	/s;;T]3=OPPPPPr   c                 4    G d dt                     } G d d|          } |            }|                     t          j        |d          d           |                     |j                   |                     t          j        |d          d           d S )Nc                       e Zd ZdZdS )6TestGetattrStatic.test_class_as_property.<locals>.Baser>  Nr   r7   r   r   Baser            CCCr   r  c                   (    e Zd ZdZed             ZdS );TestGetattrStatic.test_class_as_property.<locals>.SomethingFc                     d| _         t          S r  )executedr   rZ   s    r   r  zETestGetattrStatic.test_class_as_property.<locals>.Something.__class__  s     $r   N)rG   r\   r]   r  r  r  r7   r   r   	Somethingr    s2        H  X  r   r  r(   r>  )r   r  rJ   rT  rO   r  )rP   r  r  r  s       r   test_class_as_propertyz(TestGetattrStatic.test_class_as_property  s    	 	 	 	 	6 	 	 		 	 	 	 	 	 	 	 9;;/%@@!DDD*+++/	5AA1EEEEEr   c                 &    G d dt                     } G d dt                    } G d d||          }|                     t          j         |            d          d	           |                     t          j        |d          d	           d S )
Nc                   $    e Zd Zed             ZdS )4TestGetattrStatic.test_mro_as_property.<locals>.Metac                     t           fS r   r4  rZ   s    r   __mro__z<TestGetattrStatic.test_mro_as_property.<locals>.Meta.__mro__  s
    y r   N)rG   r\   r]   r  r  r7   r   r   r  r    s-        ! ! X! ! !r   r  c                       e Zd ZdZdS )4TestGetattrStatic.test_mro_as_property.<locals>.Baser>  Nr   r7   r   r   r  r    r  r   r  c                       e Zd ZdS )9TestGetattrStatic.test_mro_as_property.<locals>.SomethingNr   r7   r   r   r  r    r  r   r  r   r(   r>  r  )rP   r  r  r  s       r   test_mro_as_propertyz&TestGetattrStatic.test_mro_as_property  s    	! 	! 	! 	! 	!4 	! 	! 	!
	 	 	 	 	6 	 	 		 	 	 	 	 	 	 	 	 	/		UCCQGGG/	5AA1EEEEEr   c                     | d_          G fddt                    } |            }d|_        |                     t	          j        |d          d           |                     j                    d S )NFc                   .    e Zd ZdZe fd            ZdS )4TestGetattrStatic.test_dict_as_property.<locals>.Foor>  c                     d_         i S r  calledrP   r_  s    r   r  z=TestGetattrStatic.test_dict_as_property.<locals>.Foo.__dict__   s    "	r   N)rG   r\   r]   r   r  r  r_  s   r   rU  r    s=        A    X  r   rU  r   r   r>  )r  r   r   r  rJ   rT  rO   )rP   rU  r(   r_  s      @r   test_dict_as_propertyz'TestGetattrStatic.test_dict_as_property  s    	 	 	 	 	 	 	$ 	 	 	 cee/S991===%%%%%r   c                 "   | d_          G fddt                    } G d dt                    } |            } |            |_        |                     t          j        |d          d           |                     j                    d S )NFc                   $     e Zd Zd fd	Z xZS )9TestGetattrStatic.test_custom_object_dict.<locals>.CustomNc                 Z    d_         t                                          ||           d S r  )r  r  get)rP   keyrD  r  r_  s      r   r  z=TestGetattrStatic.test_custom_object_dict.<locals>.Custom.get  s(    "C)))))r   r   )rG   r\   r]   r  r	  )r  r_  s   @r   Customr    sC        * * * * * * * * * * *r   r  c                       e Zd ZdZdS )6TestGetattrStatic.test_custom_object_dict.<locals>.Foor>  N)rG   r\   r]   r   r7   r   r   rU  r    r  r   rU  r   r>  )r  r   r   r  r  rJ   rT  rO   )rP   r  rU  r(   r_  s       @r   test_custom_object_dictz)TestGetattrStatic.test_custom_object_dict
  s    	* 	* 	* 	* 	* 	* 	*T 	* 	* 	*
	 	 	 	 	& 	 	 	ceevxx/S991===%%%%%r   c                      G d dt                     } G d d|          } |            }|                     t          j        |d          d           |                     |j                   d S )Nc                   $    e Zd Zed             ZdS )?TestGetattrStatic.test_metaclass_dict_as_property.<locals>.Metac                     d| _         d S r  )r  rZ   s    r   r  zHTestGetattrStatic.test_metaclass_dict_as_property.<locals>.Meta.__dict__  s     $r   NrG   r\   r]   r  r  r7   r   r   r  r    r  r   r  c                       e Zd ZdZd ZdS )@TestGetattrStatic.test_metaclass_dict_as_property.<locals>.ThingFc                     d| _         d S Nr   rr   rZ   s    r   r   zITestGetattrStatic.test_metaclass_dict_as_property.<locals>.Thing.__init__#  s    			r   N)rG   r\   r]   r  r   r7   r   r   rg  r     s(        H    r   rg  r   rr   r   )r   r  rJ   rT  rO   r  )rP   r  rg  r  s       r   test_metaclass_dict_as_propertyz1TestGetattrStatic.test_metaclass_dict_as_property  s    	% 	% 	% 	% 	%4 	% 	% 	%
	 	 	 	 	d 	 	 	 	 577/&AA2FFF(((((r   c                     t                      }|                     t          j        t          d|          |           d S )Nversion)r   rz  rJ   rT  r  )rP   sentinels     r   test_modulezTestGetattrStatic.test_module*  sA    88/YII!	# 	# 	# 	# 	#r   c                 6    G d dt                     } G d dt           |          } G d d|          }|                     t                    5  t          j        |d           d d d            n# 1 swxY w Y   |                     |j                   d S )	Nc                   $    e Zd Zed             ZdS )WTestGetattrStatic.test_metaclass_with_metaclass_with_dict_as_property.<locals>.MetaMetac                 0    d| _         t          d          S )NTr   r  )r  r   rZ   s    r   r  z`TestGetattrStatic.test_metaclass_with_metaclass_with_dict_as_property.<locals>.MetaMeta.__dict__1  s     $}}}$r   Nr	  r7   r   r   MetaMetar  0  s-        % % X% % %r   r  c                       e Zd ZdZdS )STestGetattrStatic.test_metaclass_with_metaclass_with_dict_as_property.<locals>.MetaFN)rG   r\   r]   r  r7   r   r   r  r  6  s        HHHr   r  r   c                       e Zd ZdS )TTestGetattrStatic.test_metaclass_with_metaclass_with_dict_as_property.<locals>.ThingNr   r7   r   r   rg  r  9  r  r   rg  rr   )r   r  r  rJ   rT  rO   r  )rP   r  r  rg  s       r   3test_metaclass_with_metaclass_with_dict_as_propertyzETestGetattrStatic.test_metaclass_with_metaclass_with_dict_as_property/  s&   	% 	% 	% 	% 	%t 	% 	% 	%	 	 	 	 	48 	 	 	 		 	 	 	 	d 	 	 	 	 ~.. 	2 	2"5&111	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2(((((s   A44A8;A8c                 
   | d_          G fdd          }|                     t                    5  t          j         |            d           d d d            n# 1 swxY w Y   |                     j                    d S )NFc                       e Zd Z fdZdS )6TestGetattrStatic.test_custom___getattr__.<locals>.Fooc                     d_         i S r  r  rP   r   r_  s     r   r   zBTestGetattrStatic.test_custom___getattr__.<locals>.Foo.__getattr__E      "	r   Nr   r  s   r   rU  r   D  .              r   rU  whateverr  r  r  rJ   rT  rO   rP   rU  r_  s     @r   test_custom___getattr__z)TestGetattrStatic.test_custom___getattr__@  s    	 	 	 	 	 	 	 	 	 	
 ~.. 	6 	6"3355*555	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	6 	%%%%%   AA"%A"c                 
   | d_          G fdd          }|                     t                    5  t          j         |            d           d d d            n# 1 swxY w Y   |                     j                    d S )NFc                       e Zd Z fdZdS );TestGetattrStatic.test_custom___getattribute__.<locals>.Fooc                     d_         i S r  r  r"  s     r   __getattribute__zLTestGetattrStatic.test_custom___getattribute__.<locals>.Foo.__getattribute__S  r#  r   N)rG   r\   r]   r.  r  s   r   rU  r,  R  r$  r   rU  really_could_be_anythingr&  r'  s     @r   test_custom___getattribute__z.TestGetattrStatic.test_custom___getattribute__N  s    	 	 	 	 	 	 	 	 	 	
 ~.. 	F 	F"3355*DEEE	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	%%%%%r)  N)rG   r\   r]   rk  rt  rz  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r(  r0  r7   r   r   rb  rb  ;  s       
C 
C 
CJ J J@ @ @F F FC C CF F FR R RK K KF F FJ J J$J J JX X X
M M MN N N,Q Q QF F F F F F& & & & & & ) ) ) # # #
) ) )"& & && & & & &r   rb  c                   P    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
 Zd ZdS )TestGetGeneratorStatec                 *    d } |            | _         d S )Nc               3   6   K   t          d          D ]} | V  d S Nr   rk   numbers    r   number_generatorz5TestGetGeneratorState.setUp.<locals>.number_generator`  s0      ((   r   )	generator)rP   r8  s     r   ra  zTestGetGeneratorState.setUp_  s'    	 	 	 *)++r   c                 4    t          j        | j                  S r   )rJ   getgeneratorstater9  rZ   s    r   _generatorstatez%TestGetGeneratorState._generatorstatee      (888r   c                 j    |                      |                                 t          j                   d S r   )r  r<  rJ   GEN_CREATEDrZ   s    r   test_createdz"TestGetGeneratorState.test_createdh  s-    --//1DEEEEEr   c                     t          | j                   |                     |                                 t          j                   d S r   )nextr9  r  r<  rJ   GEN_SUSPENDEDrZ   s    r   test_suspendedz$TestGetGeneratorState.test_suspendedk  s=    T^--//1FGGGGGr   c                 ~    | j         D ]}|                     |                                 t          j                   d S r   )r9  r  r<  rJ   
GEN_CLOSEDrl   s     r   test_closed_after_exhaustionz2TestGetGeneratorState.test_closed_after_exhaustiono  sA     	 	A--//1CDDDDDr   c                    |                      t                    5  | j                            t                     d d d            n# 1 swxY w Y   |                     |                                 t          j                   d S r   )r  r  r9  r8   r  r<  rJ   rF  rZ   s    r   %test_closed_after_immediate_exceptionz;TestGetGeneratorState.test_closed_after_immediate_exceptiont  s    |,, 	/ 	/N  ...	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/--//1CDDDDD    AAAc                       fd} |             _         t           j                    t           j                    d S )Nc               3      K   t          d          D ]j}                                                     t          j                   | V                                                      t          j                   kd S r5  )r)   r  r<  rJ   GEN_RUNNING)r7  rP   s    r   running_check_generatorzCTestGetGeneratorState.test_running.<locals>.running_check_generator~  s      (( N N  !5!5!7!79LMMM  !5!5!7!79LMMMMN Nr   )r9  rB  )rP   rN  s   ` r   test_runningz"TestGetGeneratorState.test_runningy  sY    
	N 	N 	N 	N 	N
 1022T^T^r   c                     d                                 }|D ]]}t          t          |          }|                     |t	          |                     |                     |t          |                     ^d S )Nz0GEN_CREATED GEN_RUNNING GEN_SUSPENDED GEN_CLOSEDrd  r  rJ   r   reprr   rP   namesr  states       r   test_easy_debuggingz)TestGetGeneratorState.test_easy_debugging  sr    BHHJJ 	, 	,DGT**EMM$U,,,MM$E

++++	, 	,r   c           	         d
d} |g d          }|                      t          j        |          d g dd           t          |           |                      t          j        |          d g dddd           t          |           |                      t          j        |          d g dddd           t          |           |                      t          j        |          d g ddddd	           	 t          |           n# t          $ r Y nw xY w|                      t          j        |          i            d S )Nc              3   0   K   d}| D ]}|dk    rd}|V  d S )NrN  r>  r$  r7   )lstr   r   r  r   s        r   eachz;TestGetGeneratorState.test_getgeneratorlocals.<locals>.each  s=      A  66A r   rN  )r   rY  r&   )r   rY  r  r   r'   r>  r$  )r   rY  r  r   r   r   r  rJ   getgeneratorlocalsrB  StopIteration)rP   rZ  numberss      r   test_getgeneratorlocalsz-TestGetGeneratorState.test_getgeneratorlocals  s   	 	 	 	 $yyy//3G<<#III66	8 	8 	8W3G<<#IIIA(* *	+ 	+ 	+ 	W3G<<#IIIA(* *	+ 	+ 	+ 	W3G<<#IIIA(r3 3	4 	4 	4	MMMM 	 	 	D	3G<<bAAAAAs   ;D 
DDc                    d } |            }|                      t          j        |          i            	 t          |           n# t          $ r Y nw xY w|                      t          j        |          i            d S )Nc               3      K   dV  d S r   r7   r7   r   r   	yield_onezFTestGetGeneratorState.test_getgeneratorlocals_empty.<locals>.yield_one  s      GGGGGr   r[  )rP   rb  r  s      r   test_getgeneratorlocals_emptyz3TestGetGeneratorState.test_getgeneratorlocals_empty  s    	 	 	ikk3C88"===	IIII 	 	 	D	3C88"=====s   A 
AAc                 B   |                      t          t          j        d           |                      t          t          j        d            |                      t          t          j        t                     |                      t          t          j        d           d S )Nr&   c                     dS r  r7   r  s    r   r   zETestGetGeneratorState.test_getgeneratorlocals_error.<locals>.<lambda>  s    4 r   )r'   r>  )r  r  rJ   r\  rI   rZ   s    r   test_getgeneratorlocals_errorz3TestGetGeneratorState.test_getgeneratorlocals_error  sv    )W%?CCC)W%?PPP)W%?EEE)W%?GGGGGr   N)rG   r\   r]   ra  r<  r@  rD  rG  rI  rO  rV  r_  rc  rf  r7   r   r   r2  r2  ]  s        , , ,9 9 9F F FH H HE E E
E E E
   , , ,B B B:	> 	> 	>H H H H Hr   r2  c                   D    e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zd
S )TestGetCoroutineStatec                 Z    t           j        d             fd} |            | _        d S )Nc               3   6   K   t          d          D ]} | V  d S r5  rk   r6  s    r   number_coroutinez5TestGetCoroutineState.setUp.<locals>.number_coroutine  s0      ((   r   c                  ,   K                  d {V  d S r   r7   )rk  s   r   	coroutinez.TestGetCoroutineState.setUp.<locals>.coroutine  s.      ""$$$$$$$$$$$r   )r   rm  )rP   rm  rk  s     @r   ra  zTestGetCoroutineState.setUp  sH    		 	 
		% 	% 	% 	% 	%"r   c                 8    | j                                          d S r   )rm  r   rZ   s    r   r  zTestGetCoroutineState.tearDown  s    r   c                 4    t          j        | j                  S r   )rJ   getcoroutinestaterm  rZ   s    r   _coroutinestatez%TestGetCoroutineState._coroutinestate  r=  r   c                 j    |                      |                                 t          j                   d S r   )r  rq  rJ   CORO_CREATEDrZ   s    r   r@  z"TestGetCoroutineState.test_created  s-    --//1EFFFFFr   c                     | j                             d            |                     |                                 t          j                   d S r   )rm  sendr  rq  rJ   CORO_SUSPENDEDrZ   s    r   rD  z$TestGetCoroutineState.test_suspended  sC    D!!!--//1GHHHHHr   c                     	 	 | j                             d            n# t          $ r Y nw xY w-|                     |                                 t
          j                   d S r   )rm  ru  r]  r  rq  rJ   CORO_CLOSEDrZ   s    r   rG  z2TestGetCoroutineState.test_closed_after_exhaustion  sw    	##D))))    	 	--//1DEEEEEs    
++c                    |                      t                    5  | j                            t                     d d d            n# 1 swxY w Y   |                     |                                 t          j                   d S r   )r  r  rm  r8   r  rq  rJ   rx  rZ   s    r   rI  z;TestGetCoroutineState.test_closed_after_immediate_exception  s    |,, 	/ 	/N  ...	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/--//1DEEEEErJ  c                     d                                 }|D ]]}t          t          |          }|                     |t	          |                     |                     |t          |                     ^d S )Nz4CORO_CREATED CORO_RUNNING CORO_SUSPENDED CORO_CLOSEDrQ  rS  s       r   rV  z)TestGetCoroutineState.test_easy_debugging  sr    FLLNN 	, 	,DGT**EMM$U,,,MM$E

++++	, 	,r   c                 >   t           j        d                          dfd	} |            }|                     t          j        |          d d           |                    d            |                     t          j        |          d dd           d S )Nc               3      K   d V  d S r   r7   r7   r   r   gencoroz>TestGetCoroutineState.test_getcoroutinelocals.<locals>.gencoro  s      EEEEEr   c                     K   d} d {V  d S rq   r7   )r   r   r}  s     r   r  z;TestGetCoroutineState.test_getcoroutinelocals.<locals>.func  s!      AMMMMMMMMMr   )r   r}  rr   )r   r}  r   r   )r   rm  r  rJ   getcoroutinelocalsru  )rP   r  r   r}  s      @r   test_getcoroutinelocalsz-TestGetCoroutineState.test_getcoroutinelocals  s    		 	 
	 '))	 	 	 	 	 	 tvv3D99#88	: 	: 	:		$3D99#fEE	G 	G 	G 	G 	Gr   N)rG   r\   r]   ra  r  rq  r@  rD  rG  rI  rV  r  r7   r   r   rh  rh    s        % % %  9 9 9G G GI I IF F FF F F
, , ,G G G G Gr   rh  c                       e Zd ZdS )MySignatureNr   r7   r   r   r  r   	           	Dr   r  c                       e Zd ZdS )MyParameterNr   r7   r   r   r  r  	  r  r   r  c                   T   e Zd Zed             Zd Zd Zd Zd Zd Z	d Z
d Zd	 Ze ej        ed
          d                         Ze ej        ed
          d                         Zed             Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z! ej        ed
          d             Z" ej        ed
          d             Z#d Z$d Z%d  Z&d! Z'd" Z(d# Z)d$ Z*d% Z+d& Z,d' Z-d( Z.d) Z/d* Z0 ej        ed
          d+             Z1d, Z2d- Z3d. Z4d/ Z5d0 Z6d1 Z7d2S )3TestSignatureObjectc                     t          j        | fi |}t          d |j                                        D                       |j        |j        u rdn|j        fS )Nc              3      K   | ]]}|j         |j        |j        u rd n|j        |j        |j        u rd n|j        t	          |j                                                  fV  ^dS ).N)r  rD  empty
annotationr   rC  r  )r}  params     r   	<genexpr>z0TestSignatureObject.signature.<locals>.<genexpr>	  s       J J
 ). z$};;$/5;>>=B=M5:,,..	0 J J J J J Jr   .)rJ   r  tupler.   valuesreturn_annotationr  )r  kwsigs      r   r  zTestSignatureObject.signature	  s    ++++ J J
 251F1F1H1HJ J J J J -::141FI 	Ir   c                 	   t           j        }t           j        }|                     t	           |                      d           |                     t           |            j                  d           dddd}t          j        |          }|                     t          |          	                    d                     |                     dt          |          v            dd
}t          j        |          }|                     t          |          	                    d                     |                     dt          |          v            |j        d         }|j        d         }|j        d         }	|j        d         }
|j        d         }|j        d         }|j        d         }|j        d         } |||	|||f            |||	||f            ||||f            ||||f            ||||f            |||f            |||||f            |||f            ||||f            ||||f           | 
                    t          d          5   ||	||||f           d d d            n# 1 swxY w Y   | 
                    t          d          5   ||||	||f           d d d            n# 1 swxY w Y   | 
                    t          d          5   ||||	||f           d d d            n# 1 swxY w Y   | 
                    t          d          5   |||	|||f           d d d            n# 1 swxY w Y   |                    d          }| 
                    t          d          5   |||	|||f           d d d            n# 1 swxY w Y   | 
                    t          d          5   |||f           d d d            n# 1 swxY w Y   | 
                    t          d          5   |||	f           d d d            n# 1 swxY w Y   | 
                    t          d          5   ||||	f           d d d            n# 1 swxY w Y   | 
                    t          d          5   |||
|	f           d d d            n# 1 swxY w Y   | 
                    t          d          5   ||
|	f           d d d            d S # 1 swxY w Y   d S )N()zmappingproxy(OrderedDict())d   r  )kodc                   d S r   r7   )popkpkdkor  r   r  s          r   r_  z7TestSignatureObject.test_signature_object.<locals>.test 	  r`  r   z
<Signaturez
(po, /, pkr   c                    d S r   r7   )pods    r   test2z8TestSignatureObject.test_signature_object.<locals>.test2)	  r`  r   z(pod=42, /)r  r  r  r  r   r  r  r  zwrong parameter orderr  zduplicate parameter namezfollows default argument)r  )r   )rJ   rd  rb  r  r   rR  r.   r  rF   r  r  rH  replace)rP   SPr_  r  r  sig2r  r  r  r  r   r  r  r  kwargs2s                   r   test_signature_objectz)TestSignatureObject.test_signature_object	  s   QQSS4(((aaccn--/LMMM	B 	 	 	 	 	 %%S		,,\::;;;S		1222	 	 	 	  ''T

--l;;<<<d3444^D!oe$^D!nU#~f%^D!nU#)	2r4V
$%%%	2r2s
	2sB-	2sC.	3C.	3*	3c6
"### 	
3)	3F
	4b/##J0GHH 	* 	*Ar2tR()))	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* ##J0GHH 	* 	*Ar4R()))	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* ##J0GHH 	* 	*AtRR()))	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* ##J0GHH 	* 	*Ar2tVR()))	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* ..f.--##J0JKK 	+ 	+Ar2tWb)***	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ ##J0JKK 	 	AsBiLLL	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ##J0JKK 	 	AsBiLLL	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ##J0JKK 	 	Ar3m	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ##J0JKK 	 	Ar3m	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ##J0JKK 	 	AsBiLLL	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   *JJJ-K

KK0LLL3MMMN))N-0N-O))O-0O-P))P-0P-Q**Q.1Q.R++R/2R/S,,S03S0c                    i ddddddifd}t          j        |d          }t          j        |          }t	          t
          j        dz             D ]n}|                     |d	
          5  t          j        t          j	        ||                    }| 
                    ||           d d d            n# 1 swxY w Y   ot          j        |          }t          dt          j        j                  }t          j        |j        |          }t#                                          |                                |j                  }|                     t-          |t"                               |                     t-          |j        d         t                               t	          t
          j        dz             D ]}|                     |d
          5  t          j        t          j	        ||                    }| 
                    ||           |                     t-          |t"                               |                     t-          |j        d         t                               d d d            n# 1 swxY w Y   d S )Nr   r   r&   ri  r   rY  c                    d S r   r7   r   r   r   r  s       r   r(   z=TestSignatureObject.test_signature_object_pickle.<locals>.foof	  rl  r   rk  F)
pickle_versubclassr%   )r  rC  )r.   r  T)r   r   rJ   r  r)   pickleHIGHEST_PROTOCOLsubTestloadsdumpsr  r  rb  rc  collectionsOrderedDictr.   r  r  r  r  rF   r  )	rP   r(   foo_partialr  versig_pickledmyparammyparamsmysigs	            r   test_signature_object_picklez0TestSignatureObject.test_signature_object_picklee	  s   :::1:2e*::::'q111,,01455 	3 	3Cu== 3 3$l6<S+A+ABB  k2223 3 3 3 3 3 3 3 3 3 3 3 3 3 3
 $$3W->-NOOO*3>WEEE%%1B1B8;8M & O O
5+66777
5#3C#8+FFGGG01455 	9 	9Ct<< 9 9$l6<s+C+CDD  444
; D DEEE
;+A#+F+6!8 !8 9 9 9	9 9 9 9 9 9 9 9 9 9 9 9 9 9 9	9 	9s%   ->B77B;	>B;	BJJ	J	c                     d }t          j        |          }|                     t                    5  d|_        d d d            n# 1 swxY w Y   |                     t
                    5  d |j        d<   d d d            d S # 1 swxY w Y   d S )Nc                     d S r   r7   rk  s    r   r_  z=TestSignatureObject.test_signature_immutability.<locals>.test	  r`  r   r    r   )rJ   r  r  r  r(   r  r.   rP   r_  r  s      r   test_signature_immutabilityz/TestSignatureObject.test_signature_immutability	  s   	 	 	%%~.. 	 	CG	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 y)) 	' 	'"&CN3	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	's#   AA
A
+BB
Bc                 ^    d }|                      |                     |          d           d S )Nc                      d S r   r7   r7   r   r   r_  z9TestSignatureObject.test_signature_on_noarg.<locals>.test	  r`  r   r7   .r  r  r  s     r   test_signature_on_noargz+TestSignatureObject.test_signature_on_noarg	  s9    	 	 	--y99999r   c                 `    dd}|                      |                     |          d           d S )Nr   r(   ri  rE  c                     d S r   r7   r   s     r   r_  z9TestSignatureObject.test_signature_on_wargs.<locals>.test	  r`  r   ))r   ..positional_or_keyword)r   .r(   r  rE  )r   r(   ri  rE  r  r  s     r   test_signature_on_wargsz+TestSignatureObject.test_signature_on_wargs	  sK    	 	 	 	--	  	  	  	  	 r   c                     dt           dt          dt          fd}|                     |                     |          ddt           dfddt          dfft          f           d S )Nr   r   ri  c                     d S r   r7   r   s     r   r_  z;TestSignatureObject.test_signature_on_wkwonly.<locals>.test	  r`  r   .keyword_only)floatr   r   r  r  r  s     r   test_signature_on_wkwonlyz-TestSignatureObject.test_signature_on_wkwonly	  s    	e 	s 	s 	 	 	 	--e^<c>:< 	! 	! 	! 	! 	!r   c                     ddddddddd	d
t           fd}|                     |                     |          dddddd
dt           dffdf           d S )Nr  rE  )rY  r   r(   r   r    rr   bazr  c                    d S r   r7   )r   r   rr   rY  r   r  s         r   r_  z@TestSignatureObject.test_signature_on_complex_args.<locals>.test	  r`  r   r  )r   r  r(   r  )r   .r    var_positional)rr   .r  r  )rY  rE  .r  .var_keywordr  )r   r  r  r  s     r   test_signature_on_complex_argsz2TestSignatureObject.test_signature_on_complex_args	  s    	S 	 	 	e 	e 	% 	3 	 	 	 	--CDA?<$c3>@ 	  	  	  	  	 r   c                 J   d d  G fdd          }|                      |                               d           |                      |                               d           |                      |                     |j                  d           |                      |                     |j                  d           |                      |                     |j                  d           |                      |                     |j                  d           d S )Nc                      d S r   r7   r  s    r   test_args_onlyzGTestSignatureObject.test_signature_without_self.<locals>.test_args_only	  r`  r   c                      d S r   r7   r   r  s     r   test_args_kwargs_onlyzNTestSignatureObject.test_signature_without_self.<locals>.test_args_kwargs_only	  r`  r   c                       e Zd Zed             Zed             Z ej        ed          Z	 ej        d          Z
 ej        ed          Z ej         d          ZdS ):TestSignatureObject.test_signature_without_self.<locals>.Ac                      d S r   r7   r  s    r   test_classmethodzKTestSignatureObject.test_signature_without_self.<locals>.A.test_classmethod	  r   r   c                      d S r   r7   r  s    r   test_staticmethodzLTestSignatureObject.test_signature_without_self.<locals>.A.test_staticmethod	  r   r   r&   N)rG   r\   r]   r  r  r  r  r   partialmethodrK  rL  rM  rN  )r  r  s   r   r,  r  	  s          [   \ )(*:Q??B((.1==B((*;a@@B((*?CCBBBr   r,  )r   ..r  .)r  r  ..r  .)r  r  rK  rL  rM  rN  )rP   r,  r  r  s     @@r   test_signature_without_selfz/TestSignatureObject.test_signature_without_self	  s   	 	 		 	 		D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	D 	77G	I 	I 	I(=>>F	G 	G 	G 	--G	I 	I 	I--G	I 	I 	I--G	I 	I 	I--G	H 	H 	H 	H 	Hr   rr  c                     dd l } fd} fd} ||j                  fd}                      |d          d                                 |d          d                                 |d	          d
                                 |d          d                                 |d          d                                  |d          d                                 |d          d                                 |d          d                                 |d          t          j                                         |d          t          j        dz
              |t
                      |t          j        j                   t          j        t          j
                              } ||j                    |t          j                    |dj                    |t          j                    |i j                    |t          j                    |t"          j                    |dj                    |t&          j                                        t*          d          5   G d d          } | |                       d d d            n# 1 swxY w Y    |t          j                    |t.          j                    ||j                   d S )Nr   c                    	 t          j        |           }                    t          |t           j                                                 t          |j                                                  d         j	        d           |S Nr   rP   )
rJ   r  rF   r  rd  r  r   r.   r  r  r   r  rP   s     r   test_unbound_methodzKTestSignatureObject.test_signature_on_builtins.<locals>.test_unbound_method	  sp    S)!,,IOOJy'2CDDEEET)"6"="="?"?@@CH&QQQr   c                 $   	 t          j        |           }                    t          |t           j                             |j        rE                    t          |j                                                  d         j	        d           |S r  )
rJ   r  rF   r  rd  r.   r  r   r  r  r  s     r   test_callablezETestSignatureObject.test_signature_on_builtins.<locals>.test_callable	  s}    d)!,,IOOJy'2CDDEEE# Y##D)=)D)D)F)F$G$G$J$OQWXXXr   c                 (    j         |          j        S r   )r.   rD  )r  r  s    r   r0   z9TestSignatureObject.test_signature_on_builtins.<locals>.p	  s    I06>>r   r  r~  r   s   bytesrO  gQ	@r/   #   nr$  TrP  Flocalr>  r  rR   r&   s   abczno signature foundc                       e Zd ZeZdS )DTestSignatureObject.test_signature_on_builtins.<locals>.ThisWorksNowN)rG   r\   r]   r   __call__r7   r   r   ThisWorksNowr  
  s        r   r  )r  r  r  r  maxsizer   rv  rw  rx  ry  StringIObytes	maketransr   fromkeysr   r  r   r  minr  rH  __delitem__r  r  #docstring_with_signature_but_no_doc)rP   r  r  r  r0   rO  r  r  s   `      @r   test_signature_on_builtinsz.TestSignatureObject.test_signature_on_builtins	  sv    		 	 	 	 		 	 	 	 	 "M)"RSS	>>>>>3+++3***3&&&3$$$3&&&3&&&3'''7Q'''53;///53;?333f 	GO0111OBKMM**af 	eo&&&f&''' 	dm$$$bk""" 	DM***CK(((qk""" 	cl### ##J0DEE 	* 	*               M,,..)))	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	D,---H/000 	iCDDDDDs   !J33J7:J7c                 :   dd l }|j        }d } ||          }|                     t          j        |          t          j        |                     dt
          fd}|                     t          j        |d          t          j        |                     d S )Nr   c                 V     t          j                   dt          f fd            }|S )Nri  c                       | i |S r   r7   r   r  r  s     r   rn  z\TestSignatureObject.test_signature_on_decorated_builtins.<locals>.decorator.<locals>.wrapper!
      tT,V,,,r   r   r[  r   r  rn  s   ` r   	decoratorzKTestSignatureObject.test_signature_on_decorated_builtins.<locals>.decorator 
  B    _T""-C - - - - - #"-Nr   ri  c                      d S r   r7   r  s     r   wrapper_likezNTestSignatureObject.test_signature_on_decorated_builtins.<locals>.wrapper_like+
  rl  r   Ffollow_wrapped)r  r  r  rJ   r  r   )rP   r  r  r  decorated_funcr  s         r   $test_signature_on_decorated_builtinsz8TestSignatureObject.test_signature_on_decorated_builtins
  s     	?	 	 	 #4*400 *>::	< 	< 	< 	7S6666*>:?A A A *<88	: 	: 	: 	: 	:r   c                 @   dd l }|                     t          d          5  t          j        |j                   d d d            n# 1 swxY w Y   |                     t          d          5  t          j        t                     d d d            d S # 1 swxY w Y   d S )Nr   zno signature found for builtin)r  r  rH  rJ   r  r  r   )rP   r  s     r   'test_signature_on_builtins_no_signaturez;TestSignatureObject.test_signature_on_builtins_no_signature0
  s9   ##J$DF F 	@ 	@i>???	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ 	@ ##J$DF F 	# 	#c"""	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	#s#   AA
A
,BBBc                     |                      t          d          5  t          j        d           d d d            d S # 1 swxY w Y   d S )Nis not a callable objectr   )r  r  rJ   r  rZ   s    r   test_signature_on_non_functionz2TestSignatureObject.test_signature_on_non_function;
  s    ##I/IJJ 	" 	"b!!!	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	"s   >AAc                 ^   ddd} G d d          }t           j                            |          }t           j                             ||                    }|                     ||           t          j         ||                    }|                     ||            ||          }|`|                     |                     |          d           t           j        fd}t          j        	                    d|          5   ||          }| 
                    t          j        |                     d|_        |                     t          j        |                     |                     t          j        |          |           d d d            d S # 1 swxY w Y   d S )	NTkwonlyc                    d S r   r7   r   r   r  	kwonlyreqr   r  s         r   r  zITestSignatureObject.test_signature_from_functionlike_object.<locals>.func@
  r`  r   c                       e Zd Zd Zd ZdS )MTestSignatureObject.test_signature_from_functionlike_object.<locals>.funclikec                     |j         | _         |j        | _        |j        | _        |j        | _        |j        | _        || _        d S r   rG   r  rn  __defaults____kwdefaults__r  rP   r  s     r   r   zVTestSignatureObject.test_signature_from_functionlike_object.<locals>.funclike.__init__H
  @     $ $'+';$$($5!&*&9# 			r   c                      | j         |i |S r   r  r  s      r   r  zVTestSignatureObject.test_signature_from_functionlike_object.<locals>.funclike.__call__P
       ty$1&111r   NrG   r\   r]   r   r  r7   r   r   funcliker  C
  2        
! ! !2 2 2 2 2r   r#  r  c                 >    t          | d          rdS  |           S )N_builtinmockTr   )rS   _orig_isdescs    r   _isdesczLTestSignatureObject.test_signature_from_functionlike_object.<locals>._isdescg
  s*    sN++ t<$$$r   zinspect.ismethoddescriptor)rJ   rd  from_callabler  r  r  r8  r   r   r  rO   r&  rF   )	rP   r  r#  sig_funcsig_funclikeflr)  builtin_funcr(  s	           @r   'test_signature_from_functionlike_objectz;TestSignatureObject.test_signature_from_functionlike_object?
  s(   $( 	 	 	 	 		2 	2 	2 	2 	2 	2 	2 	2  $22488(66xx~~FFx000($88x000
 Xd^^O++ 	! 	! 	! 1	% 	% 	% 	% 	%
 ]  !=wGG 	H 	H#8D>>LW7EEFFF(,L%OOG6|DDEEEW.|<<hGGG	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	Hs   B	F""F&)F&c                     ddd G fdd          }|                      t          t          j        |                    d           d S )NTr  c                    d S r   r7   r  s         r   r  zCTestSignatureObject.test_signature_functionlike_class.<locals>.funcx
  r`  r   c                   \    e Zd Zd Z j         Z  j        Z j        Z j        Z j        ZdS )GTestSignatureObject.test_signature_functionlike_class.<locals>.funclikec                     d S r   r7   )rP   markers     r   r   zPTestSignatureObject.test_signature_functionlike_class.<locals>.funclike.__init__|
  r   r   N)rG   r\   r]   r   r  rn  r  r  r  s   r   r#  r3  {
  sF           }H}H"2O,L!0NNNr   r#  z(marker))r  r   rJ   r  )rP   r#  r  s     @r   !test_signature_functionlike_classz5TestSignatureObject.test_signature_functionlike_classt
  s     %) 	 	 	 	 		1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	W.x8899:FFFFFr   c                     G d d          }|                      |                      |            j                  dt          f           |                      |                      |            j                  d           |                      |                     |          d           |                     t          d          5  |                      |                       d d d            d S # 1 swxY w Y   d S )Nc                   .    e Zd Zd ZddefdZd Zd ZdS )	:TestSignatureObject.test_signature_on_method.<locals>.Testc                      d S r   r7   r  s    r   r   zCTestSignatureObject.test_signature_on_method.<locals>.Test.__init__
  r   r   r&   ri  c                     d S r   r7   rP   rJ  rK  s      r   r  z=TestSignatureObject.test_signature_on_method.<locals>.Test.m1
  r   r   c                      d S r   r7   r  s    r   m2z=TestSignatureObject.test_signature_on_method.<locals>.Test.m2
  r   r   c                     d S r   r7   rk  s    r   r  zCTestSignatureObject.test_signature_on_method.<locals>.Test.__call__
  r   r   Nr{  )rG   r\   r]   r   r   r  r>  r  r7   r   r   r  r9  
  sa           #          r   r  rJ  ..r  )rK  r&   .r  r  zinvalid method signature)r  r  r  r   r>  r  rH  )rP   r  s     r   test_signature_on_methodz,TestSignatureObject.test_signature_on_method
  s_   	 	 	 	 	 	 	 	 		22F	  	  	 
 		22	  	  	  	--	  	  	  ##J0JKK 	# 	#NN4466"""	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	#s   C00C47C4c                      G d d          }t          j         |            j                  d             }|                     |                     |          dt
          f           d S )Nc                       e Zd ZddefdZdS )ETestSignatureObject.test_signature_wrapped_bound_method.<locals>.Testr&   ri  c                     d S r   r7   r<  s      r   r  zHTestSignatureObject.test_signature_wrapped_bound_method.<locals>.Test.m1
  r   r   Nr{  )rG   r\   r]   r   r  r7   r   r   r  rE  
  s4         #      r   r  c                      d S r   r7   r  s     r   m1dzDTestSignatureObject.test_signature_wrapped_bound_method.<locals>.m1d
  rZ  r   r@  )r   r[  r  r  r  r   )rP   r  rH  s      r   #test_signature_wrapped_bound_methodz7TestSignatureObject.test_signature_wrapped_bound_method
  s    	 	 	 	 	 	 	 	 
	#	#	 	 
$	#	,,F	  	  	  	  	 r   c                      G d d          } |            j         }|                     |                     |          d           |j         }|                     |                     |          d           d S )Nc                   *    e Zd Zeddd            ZdS )?TestSignatureObject.test_signature_on_classmethod.<locals>.Testr&   )rK  c                    d S r   r7   )r   rJ  rK  s      r   r(   zCTestSignatureObject.test_signature_on_classmethod.<locals>.Test.foo
  r   r   N)rG   r\   r]   r  r(   r7   r   r   r  rL  
  s:        '(     [  r   r  ))rA  )rK  r&   .r  .r(   r  r  rP   r  meths      r   test_signature_on_classmethodz1TestSignatureObject.test_signature_on_classmethod
      	 	 	 	 	 	 	 	
 tvvz--	  	  	 
 x--	  	  	  	  	 r   c                      G d d          } |            j         }|                     |                     |          d           |j         }|                     |                     |          d           d S )Nc                   $    e Zd Zed             ZdS )@TestSignatureObject.test_signature_on_staticmethod.<locals>.Testc                    d S r   r7   )r   rL  s     r   r(   zDTestSignatureObject.test_signature_on_staticmethod.<locals>.Test.foo
  r   r   N)rG   r\   r]   r  r(   r7   r   r   r  rU  
  s-          \  r   r  )))r   ..r  )rL  ..r  .rN  rO  s      r   test_signature_on_staticmethodz2TestSignatureObject.test_signature_on_staticmethod
  rR  r   c                     ddl m} d }|                     |                      ||                    d           |                     t
          d          5  t          j         ||d                     d d d            n# 1 swxY w Y   |                     t
          d          5  t          j         ||d                     d d d            n# 1 swxY w Y   d }|                     |                      ||                    d	           |                     |                      ||d                    d
           |                     |                      ||dd                    d           |                     |                      ||dd                    d           |                     |                      ||ddd                    d           |                     |                      ||d                    d           d }|                     |                      ||d                    d           |                     |                      ||d                    d           |                     |                      ||ddd                    d           |                     |                      ||dddd                    d           |                     |                      ||ddddd                    d           |                     |                      ||d                    d           |                     |                      ||dd                    d           dt          ddfd }t          j        |          x}|_        |                     |                      | ||d                              d!dd"t          d#ffdf           |                     |                      | ||d          d                    dd"t          d#ffdf           d$ } | ||d%          d&          }|                     |                     |          d'           |                      |            d&           d( } | ||dd&          d)          }|                     |                     |          d*           |                      |d%          d+           d, } | ||d&d&-          d%d).          }|                     |                     |          d/           t          j        |          	                    d0d12          }|                      ||j
        i |j        d3           dBd4} ||d5          }t          j        |          	                    d1          }|                      ||j
        i |j        d6           t          j        |          	                    d1d7          }|                      ||j
        i |j        d8           t          j        |          	                    d1d7          }|                      ||j
        i |j        d8           t          j        |          	                    d7          }|                      ||j
        i |j        d9            ||d%d&          }t          j        |          	                    d7          }|                      ||j
        i |j        d:           d; }t          j        |          }|                     t          |          d<           |                     |                      ||d                    d=           |                     |                      ||dd                    d>           |                     |                      ||ddd                    d?           |                     |                      ||ddd                    d@           |                     |                      ||dd                    dA           d S )CNr   )r   c                      d S r   r7   r7   r   r   r_  z;TestSignatureObject.test_signature_on_partial.<locals>.test
  r`  r   r  has incorrect argumentsr&   rk  c                    d S r   r7   rM  s       r   r_  z;TestSignatureObject.test_signature_on_partial.<locals>.test
  r`  r   ))r  r   ..r  r   ..r  rO  ..r  .))r\  r]  r^  .r'   r  ))r\  r   r'   .r  r^  .)r   r   ))r  r   r&   .r  r_  r^  .))r`  r_  r^  .))r   r&   .r  r   ..r  r]  r^  .c                    d S r   r7   )r   r   r   r  s       r   r_  z;TestSignatureObject.test_signature_on_partial.<locals>.test  r`  r   ))r  rb  r  .))ra  rb  r  .r>  Tr  )r_  r   ))r  r   r   .r  r  .r   ))r  r  rd  r  .)r   r_  r   ri  r   c                     d S r   r7   ri  s      r   r_  z;TestSignatureObject.test_signature_on_partial.<locals>.test:  r`  r   r\  .r  c                     | S r   r7   rk  s    r   r(   z:TestSignatureObject.test_signature_on_partial.<locals>.fooH  s    Hr   r     )))r   rh  .r  .c                     | ||fS r   r7   ri  s      r   r(   z:TestSignatureObject.test_signature_on_partial.<locals>.fooR      a7Nr   r1  )))r   r1  .r  r]  .)r&   r1  r  c                    | |||fS r   r7   rM  s       r   r(   z:TestSignatureObject.test_signature_on_partial.<locals>.foo\  s    aA:r   )rO  r   )r   rO  ))r  )r   r  .r  )r   rh  .r  )rO  r1  .r  .   rE  r   )rl  rE  rh  r1  c                     | ||fS r   r7   ri  s      r   r(   z:TestSignatureObject.test_signature_on_partial.<locals>.fooi  rj  r   r@  )rE  r'   r@  r$  )rE  r$  r@  )r&   r$  r@  )r$  r  rh  c                    d S r   r7   )r   r   r   rO  r  s        r   r(   z:TestSignatureObject.test_signature_on_partial.<locals>.foo~  r`  r   z(a, b, /, c, d, **kwargs)))r   ..positional_onlyr   ..r  rO  ..r  r  .))rq  rr  r  .))rr  r  .))r   r>  .r  r^  r  .))ro  rs  r^  r  .rN  )r   r   r  r  r  rH  rJ   r   re  bindr   r  r   )rP   r   r_  r  r(   _foobas          r   test_signature_on_partialz-TestSignatureObject.test_signature_on_partial
  sU
   %%%%%%	 	 	 	66	BBB##J0IJJ 	0 	0ggdA..///	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 ##J0IJJ 	2 	2ggda000111	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2	 	 	 	66	  	  	  	a(8(899	  	  	  	a1(=(=(=>>	  	  	  	Q(?(?(?@@	  	  	  	a1(B(B(BCC	  	  	  	(:(:(:;;	  	  	 	 	 	 	a(8(899	  	  	  	(:(:(:;;	  	  	  	aA(>(>??	  	  	  	aAD(I(I(IJJ	  	  	  	aAA(K(K(KLL	  	  	  	(:(:(:;;	  	  	  	(B(B(BCC	  	  	 	 	 	 	 	 	 $+#4T#:#::d a0@0@(A(ABBCc+BCE	 	 	
 	a0@0@!(D(DEEc+BCE	 	 		 	 	wwwsb)))R000--	  	  	 
 	$$$	 	 	wwwsA,,,333--	  	  	  	[111	 	 	wwwsbB///2<<<--	  	  	  t$$))C2)66rw4")446GHHH	 	 	 	wsb!!!t$$))B)//rw4")44kBBBt$$))"b11rw4")44lCCCt$$))")33rw4")44lCCCt$$))B)//rw4")44kBBBwtrR(((t$$))"--rw4")44lCCC	 	 	$$S#>???Q88	 	 	 	Q(:(:;;	 	 	 	Q1(=(=>>	 	 	
 	QQ(?(?(?@@	 	 	 	Q!(<(<(<==	 	 	 	 	s$   BB	B( CCCc                 6   ddl m  G fdd          }|                     t          d          5  t	          j        |j                   d d d            n# 1 swxY w Y    G fdd          }|                     |                     |j        d          d	           |                     |                      |            j        d          d
            G fdd          }|                     |                     |j        d          d           d S )Nr   r  c                   ,    e Zd Zd Z  e          ZdS )ATestSignatureObject.test_signature_on_partialmethod.<locals>.Spamc                      d S r   r7   r7   r   r   r_  zFTestSignatureObject.test_signature_on_partialmethod.<locals>.Spam.test  r   r   NrG   r\   r]   r_  rY  ry  s   r   Spamr{    s-          -%%CCCr   r~  rZ  c                   2    e Zd ZddZ  ed          ZdS )r{  ri  rr   c                    d S r   r7   )itr   r   s      r   r_  zFTestSignatureObject.test_signature_on_partialmethod.<locals>.Spam.test  r   r   r&   r  N)ri  rr   r}  ry  s   r   r~  zATestSignatureObject.test_signature_on_partialmethod.<locals>.Spam  s7           -***CCCr   Frj  )))r  ..r  r  r   r&   .r  rr   ))r  r  rr   c                   0    e Zd ZddZ  ed          ZdS )r{  rP   annoc                     d S r   r7   ry  s     r   r_  zFTestSignatureObject.test_signature_on_partialmethod.<locals>.Spam.test  r   r   r&   N)rP   r  )rG   r\   r]   r_  rQ  ry  s   r   r~  zATestSignatureObject.test_signature_on_partialmethod.<locals>.Spam  s6            dA&&AAAr   )))rP   .r  r  .)	r   r  r  rH  rJ   r  rY  r  rQ  )rP   r~  r  s     @r   test_signature_on_partialmethodz3TestSignatureObject.test_signature_on_partialmethod  s   ++++++	& 	& 	& 	& 	& 	& 	& 	& 	& 	&
 ##J0IJJ 	( 	(dh'''	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+
 	5AA"	# 	# 	# 	
UCC"	# 	# 	#
	' 	' 	' 	' 	' 	' 	' 	' 	' 	' 	??	  	  	  	  	 s   AAAc                     d }d|_         |                     t          t          j        |                    d           d S )Nc                     d S r   r7   rk  s    r   r(   zETestSignatureObject.test_signature_on_fake_partialmethod.<locals>.foo  rl  r   rr   z(a))_partialmethodr  r   rJ   r  rP   r(   s     r   $test_signature_on_fake_partialmethodz8TestSignatureObject.test_signature_on_fake_partialmethod  sB    #W.s3344e<<<<<r   c                 2   d  G fdd          }  |            j                   }|                     |                     |j                   d           |                     |                      |            j                   d           |                     |                     |j         d          d           |                     |                     |          d           d	  G fd
d          }|                     |                     |j                  d           |                     |                      |            j                  d           d }|j        |_        |                     |                     |          d           d S )Nc                 V     t          j                   dt          f fd            }|S )Nri  c                       | i |S r   r7   r  s     r   rn  zSTestSignatureObject.test_signature_on_decorated.<locals>.decorator.<locals>.wrapper  r  r   r  r  s   ` r   r  zBTestSignatureObject.test_signature_on_decorated.<locals>.decorator  r  r   c                   &    e Zd Z d             ZdS )<TestSignatureObject.test_signature_on_decorated.<locals>.Fooc                     d S r   r7   rP   r   r   s      r   r    z@TestSignatureObject.test_signature_on_decorated.<locals>.Foo.bar  r   r   N)rG   r\   r]   r    r  s   r   rU  r    .          Y  r   rU  ))rP   ..r  r  r\  .))r  r\  .Fr	  r  c                     t          j                   dt          f fd            }t          j                   }t          |j                                                  dd          }|                    |          |_	        |S )Nri  c                       dg| R i |S r  r7   r  s     r   rn  zSTestSignatureObject.test_signature_on_decorated.<locals>.decorator.<locals>.wrapper  s#    tB0000000r   r&   ra  )
r   r[  r   rJ   r  r  r.   r  r  re  )r  rn  r  
new_paramss   `   r   r  zBTestSignatureObject.test_signature_on_decorated.<locals>.decorator  s    _T""1C 1 1 1 1 1 #"1#D))Cs~446677;J$'KK:K$F$FG!Nr   c                   &    e Zd Z d             ZdS )r  c                     d S r   r7   r  s      r   r  zETestSignatureObject.test_signature_on_decorated.<locals>.Foo.__call__  r   r   NrG   r\   r]   r  r  s   r   rU  z<TestSignatureObject.test_signature_on_decorated.<locals>.Foo  r  r   )r\  .c                      d S r   r7   r7   r   r   wrapped_foo_callzITestSignatureObject.test_signature_on_decorated.<locals>.wrapped_foo_call
  r`  r   )r    r  r  r  __wrapped__)rP   rU  r    r  r  s       @r   test_signature_on_decoratedz/TestSignatureObject.test_signature_on_decorated  s   	 	 		 	 	 	 	 	 	 	 	 	
 i	""00	  	  	  		22	  	  	 
 	FF	  	  	  	,,	  	  	 	 	 		 	 	 	 	 	 	 	 	 	
 	55	  	  	 
 	77	  	  	 
	 	 	'*|$(899	  	  	  	  	 r   c                     G d d          }|                      |                     |          d            G d dt                    } G d d|          }|                      |                     |          d            G d dt                    } G d	 d|          }|                      |                     |          d
           |                      |                     |          d            G d dt                    } G d dt          |          } G d d|          }|                      |                     |          d           |                      |                     |          d           |                      |                     |          d
            G d dt                    } G d d|          }|                      |                     |          d           d S )Nc                       e Zd Zd ZdS )6TestSignatureObject.test_signature_on_class.<locals>.Cc                     d S r   r7   rP   r   s     r   r   z?TestSignatureObject.test_signature_on_class.<locals>.C.__init__  r   r   NrG   r\   r]   r   r7   r   r   r   r    r   r   r   )r  .c                       e Zd Zd ZdS )7TestSignatureObject.test_signature_on_class.<locals>.CMc                     d S r   r7   )r   r   s     r   r  z@TestSignatureObject.test_signature_on_class.<locals>.CM.__call__  r   r   Nr  r7   r   r   r  r    r   r   r  c                       e Zd Zd ZdS )r  c                     d S r   r7   rP   r   s     r   r   z?TestSignatureObject.test_signature_on_class.<locals>.C.__init__!  r   r   Nr  r7   r   r   r   z6TestSignatureObject.test_signature_on_class.<locals>.C   r   r   r   c                   $     e Zd Zdd fd
Z xZS )r  r&   r  c                L    t                                          | |||          S r   r  r  mclsr  basesdctr(   r  s        r   r  z?TestSignatureObject.test_signature_on_class.<locals>.CM.__new__)      wwtT5#>>>r   rG   r\   r]   r  r	  r
  s   @r   r  z7TestSignatureObject.test_signature_on_class.<locals>.CM(  E        78 ? ? ? ? ? ? ? ? ? ? ?r   c                       e Zd Zd ZdS )r  c                     d S r   r7   r  s     r   r   z?TestSignatureObject.test_signature_on_class.<locals>.C.__init__,  r   r   Nr  r7   r   r   r   z6TestSignatureObject.test_signature_on_class.<locals>.C+  r   r   r  ))r  ..r  r  ..r  r  ..r  )r(   r&   .r  .c                   *     e Zd Zdd fd
Zd Z xZS )8TestSignatureObject.test_signature_on_class.<locals>.CMMr&   r  c                L    t                                          | |||          S r   r  r  s        r   r  z@TestSignatureObject.test_signature_on_class.<locals>.CMM.__new__;  r  r   c                 $    t          |||          S r   )r   )r   nmbsdts       r   r  zATestSignatureObject.test_signature_on_class.<locals>.CMM.__call__=  s    BB'''r   )rG   r\   r]   r  r  r	  r
  s   @r   CMMr  :  sT        78 ? ? ? ? ? ? ?( ( ( ( ( ( (r   r  c                   $     e Zd Zdd fd
Z xZS )r  r'   r    c                L    t                                          | |||          S r   r  )r  r  r  r  r    r  s        r   r  z?TestSignatureObject.test_signature_on_class.<locals>.CM.__new__@  r  r   r  r
  s   @r   r  z7TestSignatureObject.test_signature_on_class.<locals>.CM?  r  r   c                       e Zd Zd ZdS )r  c                     d S r   r7   r  s     r   r   z?TestSignatureObject.test_signature_on_class.<locals>.C.__init__C  r   r   Nr  r7   r   r   r   z6TestSignatureObject.test_signature_on_class.<locals>.CB  r   r   )))r  ..r  )r  ..r  )r  ..r  .c                   $     e Zd Zdd fd
Z xZS )r  r'   r  c                J    t                                          |||          S r   r  r   )r   r  r  r  r    r  s        r   r   z@TestSignatureObject.test_signature_on_class.<locals>.CM.__init__X  s    ww''eS999r   rG   r\   r]   r   r	  r
  s   @r   r  z7TestSignatureObject.test_signature_on_class.<locals>.CMW  sE        78 : : : : : : : : : : :r   c                       e Zd Zd ZdS )r  c                     d S r   r7   r  s     r   r   z?TestSignatureObject.test_signature_on_class.<locals>.C.__init__[  r   r   Nr  r7   r   r   r   z6TestSignatureObject.test_signature_on_class.<locals>.CZ  r   r   ))r  r  r  )r    r'   .r  .)r  r  r   )rP   r   r  r  s       r   test_signature_on_classz+TestSignatureObject.test_signature_on_class  s1   	 	 	 	 	 	 	 	 	**	  	  	 	 	 	 	 	 	 	 		 	 	 	 	" 	 	 	 	 	**	  	  	 	? 	? 	? 	? 	? 	? 	? 	?	 	 	 	 	" 	 	 	 	 	**	  	  	  	++	  	  	 	( 	( 	( 	( 	($ 	( 	( 	(
	? 	? 	? 	? 	? 	? 	? 	? 	?	 	 	 	 	" 	 	 	 	 	,,	  	  	  	++	  	  	  	**	  	  	 	: 	: 	: 	: 	: 	: 	: 	:	 	 	 	 	" 	 	 	 	 	++	  	  	  	  	 r   c                 j    G d d          } G d d|          } G d d|          } G d d|          }|                      |                     |          d	           |                      |                     |          d
           |                      |                     |          d           d S )Nc                       e Zd ZddZdS )9TestSignatureObject.test_signature_on_subclass.<locals>.Ar&   c                 6    t                               |           S r   r   r  )r   r   r   r  s       r   r  zATestSignatureObject.test_signature_on_subclass.<locals>.A.__new__g      ~~c***r   Nr{  rG   r\   r]   r  r7   r   r   r,  r  f  (        + + + + + +r   r,  c                       e Zd Zd ZdS )9TestSignatureObject.test_signature_on_subclass.<locals>.Bc                     d S r   r7   r  s     r   r   zBTestSignatureObject.test_signature_on_subclass.<locals>.B.__init__j  r   r   Nr  r7   r   r   r/  r  i  r   r   r/  c                       e Zd ZddZdS )9TestSignatureObject.test_signature_on_subclass.<locals>.Cr&   r'   c                 6    t                               |           S r   r  )r   r   r   r   r  s        r   r  zATestSignatureObject.test_signature_on_subclass.<locals>.C.__new__m  r  r   Nr&   r'   r  r7   r   r   r   r  l  r  r   r   c                       e Zd ZdS )9TestSignatureObject.test_signature_on_subclass.<locals>.DNr   r7   r   r   r4  r  o  r  r   r4  r  ))r   r&   .r  )r   r'   .r  r  r  .))r  r  r  .r  )rP   r,  r/  r   r4  s        r   test_signature_on_subclassz.TestSignatureObject.test_signature_on_subclasse  s9   	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+	 	 	 	 	 	 	 		+ 	+ 	+ 	+ 	+ 	+ 	+ 	+	 	 	 	 	 	 	 	 	**	  	  	  	**	  	  	  	**	  	  	  	  	 r   c                     ddl m}m}  |d          } G d d||                   }|                     |                     |          ddt
          dffd f           d S )	Nr   )GenericTypeVarr	  c                       e Zd ZdeddfdZdS )ATestSignatureObject.test_signature_on_generic_subclass.<locals>.Ar   ri  Nc                    d S r   r7   r  s     r   r   zJTestSignatureObject.test_signature_on_generic_subclass.<locals>.A.__init__  r   r   )rG   r\   r]   r   r   r7   r   r   r,  r    s6        S T      r   r,  r   .r  )typingr  r  r  r  r   )rP   r  r  r	  r,  s        r   "test_signature_on_generic_subclassz6TestSignatureObject.test_signature_on_generic_subclass  s    ++++++++GCLL	 	 	 	 	
 	 	 	 	**c>:< 	! 	! 	! 	! 	!r   c                     G d d          }|                      t          t          j        |                    d            G d d|          }|                      t          t          j        |                    d            G d dt                    } G d d|          }|                     t          d          5  |                      t          j        |          d            d d d            n# 1 swxY w Y   |                     t          d          5  |                      t          j        |          d            d d d            d S # 1 swxY w Y   d S )	Nc                       e Zd ZdS CTestSignatureObject.test_signature_on_class_without_init.<locals>.CNr   r7   r   r   r   r    r   r   r   r  c                       e Zd ZdS CTestSignatureObject.test_signature_on_class_without_init.<locals>.DNr   r7   r   r   r4  r    r   r   r4  c                       e Zd ZdS r  r   r7   r   r   r   zCTestSignatureObject.test_signature_on_class_without_init.<locals>.C  r   r   c                       e Zd ZdS r  r   r7   r   r   r4  zCTestSignatureObject.test_signature_on_class_without_init.<locals>.D  r   r   zcallable.*is not supported)r  r   rJ   r  r   r  rH  )rP   r   r4  s      r   $test_signature_on_class_without_initz8TestSignatureObject.test_signature_on_class_without_init  s    	W.q1122D999W.q1122D999 	##J0LMM 	9 	9W.q114888	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9##J0LMM 	9 	9W.q114888	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9s$   )C77C;>C;)EEEc                    d}|                      t          t          j        t          j                            |            G d dt          j                  } G d d          } G d d||          }|                      t          t          j        |                    |           |                      t          t          j        |                    |            G d d	|          }|                      t          t          j        |                    d
            G d dt                    } G d d||          }|                      t          t          j        |                    d           d S )Nz=(file, protocol=None, fix_imports=True, buffer_callback=None)c                       e Zd ZdS )>TestSignatureObject.test_signature_on_builtin_class.<locals>.PNr   r7   r   r   r  r    r   r   r  c                       e Zd ZdS )GTestSignatureObject.test_signature_on_builtin_class.<locals>.EmptyTraitNr   r7   r   r   
EmptyTraitr    r   r   r  c                       e Zd ZdS )?TestSignatureObject.test_signature_on_builtin_class.<locals>.P2Nr   r7   r   r   P2r    r   r   r  c                       e Zd Zd ZdS )?TestSignatureObject.test_signature_on_builtin_class.<locals>.P3c                     d S r   r7   )rP   rr   s     r   r   zHTestSignatureObject.test_signature_on_builtin_class.<locals>.P3.__init__  r   r   Nr  r7   r   r   P3r     r   r   r  z(spam)c                       e Zd Zd ZdS )BTestSignatureObject.test_signature_on_builtin_class.<locals>.MetaPc                     d S r   r7   )r   r(   r    s      r   r  zKTestSignatureObject.test_signature_on_builtin_class.<locals>.MetaP.__call__  r   r   Nr  r7   r   r   MetaPr    r   r   r  c                       e Zd ZdS )?TestSignatureObject.test_signature_on_builtin_class.<locals>.P4Nr   r7   r   r   P4r    r  r   r	  r   z
(foo, bar))r  r   rJ   r  rv  rw  r   )rP   r6  r  r  r  r  r  r	  s           r   test_signature_on_builtin_classz3TestSignatureObject.test_signature_on_builtin_class  s   ,W.w??@@(KKK&&&&&&&&%%%%%Q%%%W.q1122H===W.r2233X>>>	 	 	 	 	 	 	 	 	W.r2233X>>>	 	 	 	 	D 	 	 		 	 	 	 	u 	 	 	 	W.r2233\BBBBBr   c                     G d d          }|                      |                      |                      d            G d d          }|                     t          d          5  t	          j         |                       d d d            n# 1 swxY w Y    G d d||          }|                      |                      |                      d            G d	 d
          }d |_        |                      |                     |          d           ||_        |                     t          d          5  |                     |           d d d            d S # 1 swxY w Y   d S )Nc                       e Zd Zd ZdS )CTestSignatureObject.test_signature_on_callable_objects.<locals>.Fooc                     d S r   r7   r  s     r   r  zLTestSignatureObject.test_signature_on_callable_objects.<locals>.Foo.__call__  r   r   Nr  r7   r   r   rU  r    r   r   rU  r  c                       e Zd ZdS )DTestSignatureObject.test_signature_on_callable_objects.<locals>.SpamNr   r7   r   r   r~  r    r  r   r~  r  c                       e Zd ZdS )CTestSignatureObject.test_signature_on_callable_objects.<locals>.BarNr   r7   r   r   Barr    r  r   r  c                       e Zd ZdS )GTestSignatureObject.test_signature_on_callable_objects.<locals>.WrappedNr   r7   r   r   Wrappedr    r  r   r  c                     d S r   r7   rk  s    r   r   zHTestSignatureObject.test_signature_on_callable_objects.<locals>.<lambda>  s     r   wrapper loop)r  r  r  r  rJ   r  rH  )rP   rU  r~  r  r  s        r   "test_signature_on_callable_objectsz6TestSignatureObject.test_signature_on_callable_objects  sZ   	 	 	 	 	 	 	 	 	..	  	  	 	 	 	 	 	 	 	 	##I/IJJ 	& 	&ddff%%%	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	&	 	 	 	 	$ 	 	 	 	..	  	  	 	 	 	 	 	 	 	 	,n00	  	  	  &##J?? 	$ 	$NN7###	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$s$   'BBB;EE"%E"c                 \    |                      |                     dd          d           d S )Nr  c                     | S r   r7   rk  s    r   r   z?TestSignatureObject.test_signature_on_lambdas.<locals>.<lambda>  s    a r   )))r   r  .r  .r  r  rZ   s    r   test_signature_on_lambdasz-TestSignatureObject.test_signature_on_lambdas  s;    99	  	  	  	  	 r   c           	         t           j                                        t           j                                        t           j                                        fD ]e}|                     |          5  |                     t          t          j	        |                    d           d d d            n# 1 swxY w Y   fd S )Nr   z(*args, **kwargs))
r   r   r   r   	MagicMockr  r  r   rJ   r  rP   r   s     r   test_signature_on_mocksz+TestSignatureObject.test_signature_on_mocks  s     M  M##%%M##%%
 	T 	TD
 4(( T T  W%6t%<%<!=!=?RSSST T T T T T T T T T T T T T T	T 	Ts   26B44B8	;B8	c                 l   t           j                                        t           j                                        fD ]v}|                     |          5  |                     t                    5  t          j        |           d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   wd S )Nr  )	r   r   NonCallableMockNonCallableMagicMockr  r  r  rJ   r  r   s     r   #test_signature_on_noncallable_mocksz7TestSignatureObject.test_signature_on_noncallable_mocks  s%   M))++M..00
 	, 	,D 4(( , ,&&y11 , ,%d+++, , , , , , , , , , , , , , ,, , , , , , , , , , , , , , ,		, 	,s6   B(0BB(BB(BB((B,	/B,	c                 R   dt           dt          fd}|                     t          j        |          dk               |                     t          j        |          dk               |                     t          j        |          t          k               |                     t          j        |          t          k               dt           dt          fd}|                     t          j        |          t          j        |          k               |                     t          j        |          t          j        |          k               |                     t          t          j        |                    t          t          j        |                               dt           dt           fd}|                     t          j        |          t          j        |          k               |                     t          j        |          t          j        |          k               | 	                    t          t          j        |                    t          t          j        |                               dt           fd}|                     t          j        |          t          j        |          k               |                     t          j        |          t          j        |          k               | 	                    t          t          j        |                    t          t          j        |                               dddt           dt          fd	}|                     t          j        |          t          j        |          k               |                     t          j        |          t          j        |          k               | 	                    t          t          j        |                    t          t          j        |                               dt          fd
}|                     t          j        |          t          j        |          k               |                     t          j        |          t          j        |          k               | 	                    t          t          j        |                    t          t          j        |                               dt           dt          fd}|                     t          j        |          t          j        |          k               |                     t          j        |          t          j        |          k               | 	                    t          t          j        |                    t          t          j        |                               dt           dt          fd}|                     t          j        |          t          j        |          k               |                     t          j        |          t          j        |          k               | 	                    t          t          j        |                    t          t          j        |                               d }d }|                     t          j        |          t          j        |          k               |                     t          j        |          t          j        |          k               |                     t          t          j        |                    t          t          j        |                               ddd}ddd}|                     t          j        |          t          j        |          k               |                     t          j        |          t          j        |          k               |                     t          t          j        |                    t          t          j        |                               ddd}ddd}|                     t          j        |          t          j        |          k               |                     t          j        |          t          j        |          k               |                     t          t          j        |                    t          t          j        |                               d }ddd}|                     t          j        |          t          j        |          k               |                     t          j        |          t          j        |          k               | 	                    t          t          j        |                    t          t          j        |                               dddt           fd}dddt           fd}|                     t          j        |          t          j        |          k               |                     t          j        |          t          j        |          k               |                     t          t          j        |                    t          t          j        |                               d S )Nr   ri  c                    d S r   r7   r   s     r   r(   z8TestSignatureObject.test_signature_equality.<locals>.foo  rl  r   r   c                    d S r   r7   r   s     r   r    z8TestSignatureObject.test_signature_equality.<locals>.bar  rl  r   c                    d S r   r7   r   s     r   r    z8TestSignatureObject.test_signature_equality.<locals>.bar  rl  r   c                    d S r   r7   r   s     r   r    z8TestSignatureObject.test_signature_equality.<locals>.bar  rl  r   re  c                    d S r   r7   r   s     r   r    z8TestSignatureObject.test_signature_equality.<locals>.bar	  rl  r   c                    d S r   r7   r   r   s     r   r    z8TestSignatureObject.test_signature_equality.<locals>.bar  rl  r   c                     d S r   r7   r   s     r   r    z8TestSignatureObject.test_signature_equality.<locals>.bar  rl  r   c                     d S r   r7   r   r   s     r   rr   z9TestSignatureObject.test_signature_equality.<locals>.spam  rl  r   c                     d S r   r7   ri  s      r   r(   z8TestSignatureObject.test_signature_equality.<locals>.foo   rl  r   c                     d S r   r7   r   r   r   s      r   r    z8TestSignatureObject.test_signature_equality.<locals>.bar!  rl  r   r&   rk  c                     d S r   r7   ri  s      r   r(   z8TestSignatureObject.test_signature_equality.<locals>.foo'  rl  r   c                     d S r   r7   r3  s      r   r    z8TestSignatureObject.test_signature_equality.<locals>.bar(  rl  r   c                    d S r   r7   posr   r   r   s       r   r(   z8TestSignatureObject.test_signature_equality.<locals>.foo.  rl  r   c                    d S r   r7   r8  r   r   r   s       r   r    z8TestSignatureObject.test_signature_equality.<locals>.bar/  rl  r   c                    d S r   r7   r7  s       r   r(   z8TestSignatureObject.test_signature_equality.<locals>.foo5  rl  r   c                    d S r   r7   r:  s       r   r    z8TestSignatureObject.test_signature_equality.<locals>.bar6  rl  r   r  c                    d S r   r7   )r8  r   r   r   r   r  s         r   r(   z8TestSignatureObject.test_signature_equality.<locals>.foo<  rl  r   c                    d S r   r7   )r8  r   r   r   r   r  s         r   r    z8TestSignatureObject.test_signature_equality.<locals>.bar=  rl  r   )
r   r  rO   rJ   r  rF   r   r  hashr  )rP   r(   r    rr   s       r   test_signature_equalityz+TestSignatureObject.test_signature_equality  s	   ++++++*3//25666)#.."4555)#..);<<<*3//9<===++++++)#..'2CC2H2HHIII*3//73DS3I3IIJJJ"3''(($w/@/E/E*F*F	H 	H 	H 	*)))))*3//73DS3I3IIJJJ)#..'2CC2H2HHIII"3''(($w/@/E/E*F*F	H 	H 	H 	#""""*3//73DS3I3IIJJJ)#..'2CC2H2HHIII"3''(($w/@/E/E*F*F	H 	H 	H ....5....*3//73DS3I3IIJJJ)#..'2CC2H2HHIII"3''(($w/@/E/E*F*F	H 	H 	H 	(E''''*3//73DS3I3IIJJJ)#..'2CC2H2HHIII"3''(($w/@/E/E*F*F	H 	H 	H 	)S(U((((*3//73DS3I3IIJJJ)#..'2CC2H2HHIII"3''(($w/@/E/E*F*F	H 	H 	H)3)e))))*400G4Ec4J4JJKKK)$//73DS3I3IIJJJ"4(())40A#0F0F+G+G	I 	I 	I 	"!!!!!)#..'2CC2H2HHIII*3//73DS3I3IIJJJ"3''(($w/@/E/E*F*F	H 	H 	H ##########)#..'2CC2H2HHIII*3//73DS3I3IIJJJ"3''(($w/@/E/E*F*F	H 	H 	H ((((( !((((()#..'2CC2H2HHIII*3//73DS3I3IIJJJ"3''(($w/@/E/E*F*F	H 	H 	H 	'&& !(((((*3//73DS3I3IIJJJ)#..'2CC2H2HHIII"3''(($w/@/E/E*F*F	H 	H 	H !;;;;;;;$&;;;;;;;)#..'2CC2H2HHIII*3//73DS3I3IIJJJ"3''(($w/@/E/E*F*F	H 	H 	H 	H 	Hr   c                 x   t           j        }t           j        }d }t          j        |          } | |d|j                  g          }|                     t          |          t          |                     |                     t          |          t          |                    d                               dd}|                     t          |          t          t          j        |                               i fd	}| 	                    t          d
          5  t          t          j        |                     d d d            n# 1 swxY w Y   di fd}| 	                    t          d
          5  t          t          j        |                     d d d            d S # 1 swxY w Y   d S )Nc                     d S r   r7   rk  s    r   r(   z8TestSignatureObject.test_signature_hashable.<locals>.fooG  rl  r   r   ra  rr   r  ri  r&   c                     d S r   r7   rk  s    r   r    z8TestSignatureObject.test_signature_hashable.<locals>.barP  rl  r   c                     d S r   r7   rk  s    r   r(   z8TestSignatureObject.test_signature_hashable.<locals>.fooS  rl  r   unhashable typec                     d S r   r7   rk  s    r   r(   z8TestSignatureObject.test_signature_hashable.<locals>.fooW  rl  r   )ri  r&   )rJ   rd  rb  r  POSITIONAL_OR_KEYWORDr  r?  r  r  r  r  )rP   r  r  r(   foo_sig
manual_sigr    s          r   test_signature_hashablez+TestSignatureObject.test_signature_hashableC  s*   #C((Q11S!*A#B#B"CDDD
gZ(8(8999DMM !3!3f!3!M!MNN	P 	P 	P 	DMM40A#0F0F+G+GHHH##I/@AA 	) 	)"3''(((	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	b##I/@AA 	) 	)"3''(((	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	)s$   &"EEE "F//F36F3c                     dd ddt           ddfd}|                     t          t          j        |                    d           dd ddt           ddfd}|                     t          t          j        |                    d	           d
 }|                     t          t          j        |                    d           dt
          t                   dt          t          t          f         fd}|                     t          t          j        |                    d           ddlm	} dt
          t                   d|t          t          f         fd}|                     t          t          j        |                    d           d S )Nr&   r  r   ri  r   c                    d S r   r7   r   r   r   r  s       r   r(   z3TestSignatureObject.test_signature_str.<locals>.foo\  r`  r   z*(a: int = 1, *, b, c=None, **kwargs) -> 42c                    d S r   r7   )r   r   r   r   r  s        r   r(   z3TestSignatureObject.test_signature_str.<locals>.fooa  r`  r   z.(a: int = 1, *args, b, c=None, **kwargs) -> 42c                      d S r   r7   r7   r   r   r(   z3TestSignatureObject.test_signature_str.<locals>.foof  r`  r   r  c                     d S r   r7   rk  s    r   r(   z3TestSignatureObject.test_signature_str.<locals>.fooj  r`  r   z#(a: list[str]) -> tuple[str, float]r   )Tuplec                     d S r   r7   rk  s    r   r(   z3TestSignatureObject.test_signature_str.<locals>.foop  r`  r   z#(a: list[str]) -> Tuple[str, float]r{  )
r   r  r   rJ   r  r   r  r  r  rR  )rP   r(   rR  s      r   test_signature_strz&TestSignatureObject.test_signature_str[  s   	 	 	 	# 	B 	 	 	 	W.s3344E	G 	G 	G	T 	 	 	# 	 	 	 	 	W.s3344I	K 	K 	K	 	 	W.s3344d;;;	49 	sEz!2 	 	 	 	W.s3344>	@ 	@ 	@ 	!     	49 	sEz!2 	 	 	 	W.s3344>	@ 	@ 	@ 	@ 	@r   c                 T   t           j        }t           j        }d }|                     t	          t          j        |                    d           |                     t	           | |d|j                  g                    d           |                     t	           | |d|j                   |d|j                  g                    d           |                     t	           | |d|j                   |d|j                  g                    d           d S )	Nc               
    | |fS r   r7   )a_por   r  s      r   r_  zDTestSignatureObject.test_signature_str_positional_only.<locals>.testy      <r   z(a_po, /, *, b, **kwargs)r(   ra  z(foo, /)r    z(foo, /, **bar)z(foo, /, *bar))	rJ   rb  rd  r  r   r  rc  rI  VAR_POSITIONAL)rP   r  r  r_  s       r   "test_signature_str_positional_onlyz6TestSignatureObject.test_signature_str_positional_onlyu  sp   	  	  	  	W.t44554	6 	6 	6 	QQ11UA4E+F+F*GHHHII#	% 	% 	% 	QQ !%): ; ; !% 7 7+9 : : : ; ; +	, 	, 	,
 	QQ !%): ; ; !%)9 : :+< = = = > > *	+ 	+ 	+ 	+ 	+r   c                    dd}t          j        |          }|                    d           }|                     |j        d            |                    |j                  }|                     |j        |j                   |                    d          }|                     |j        d           |                     |t          j        |                     d S )Nri  r   c                      d S r   r7   r7   r   r   r_  z=TestSignatureObject.test_signature_replace_anno.<locals>.test  r`  r   rC  )ri  r   )rJ   r  r  r-  r  r  r  r  s      r   test_signature_replace_annoz/TestSignatureObject.test_signature_replace_anno  s    	 	 	 	 %%kkDk11c+T222kkCIk66c+SY777kkBk//.333g/5566666r   c                     d }t          j        dt           j        j                  }t          j        |f          x}|_        |                     |t          j        |                     d S )Nc                      d S r   r7   r7   r   r   r_  z9TestSignatureObject.test_signature_replaced.<locals>.test  r`  r   rr   ra  )rJ   rb  rc  rd  re  r  r  )rP   r_  rf  r  s       r   test_signature_replacedz+TestSignatureObject.test_signature_replaced  so    	 	 	 &vw/@/PQQ
#*#4#N#N#NNd g/5566666r   c                 $    G d d          } G d d|          }|                      |                     |j                  d           |                      |                     |j                  |                     |j                             d S )Nc                       e Zd Zd	ddd
dZdS )FTestSignatureObject.test_signature_on_mangled_parameters.<locals>.Spamr'   r>  )	_Spam__p2	_Spam__p1r&   rd  c                    d S r   r7   )rP   re  rd  s      r   r(   zJTestSignatureObject.test_signature_on_mangled_parameters.<locals>.Spam.foo  r   r   N)r'   )re  r&   rd  r'   r   r7   r   r   r~  rc    s9        a        r   r~  c                       e Zd ZdS )ETestSignatureObject.test_signature_on_mangled_parameters.<locals>.HamNr   r7   r   r   Hamrh    r  r   ri  ))r  )re  r'   r&   r  )rd  r>  r'   r  .)r  r  r(   )rP   r~  ri  s      r   $test_signature_on_mangled_parametersz8TestSignatureObject.test_signature_on_mangled_parameters  s    	 	 	 	 	 	 	 		 	 	 	 	$ 	 	 	 	11	  	  	  	1100	2 	2 	2 	2 	2r   c                      G d dt           j                  }dd}|                    |          }|                     ||           d S )Nc                       e Zd ZdS )PTestSignatureObject.test_signature_from_callable_python_obj.<locals>.MySignatureNr   r7   r   r   r  rm    r   r   r  r   r&   c                    d S r   r7   r   s     r   r(   zHTestSignatureObject.test_signature_from_callable_python_obj.<locals>.foo  rl  r   r   r&   rJ   rd  r*  assertIsInstancerP   r  r(   rI  s       r   'test_signature_from_callable_python_objz;TestSignatureObject.test_signature_from_callable_python_obj  sZ    22222'+222    ++C00g{33333r   c                      G d dt           j                  } G d d          }|                    |          }|                     ||           d S )Nc                       e Zd ZdS )KTestSignatureObject.test_signature_from_callable_class.<locals>.MySignatureNr   r7   r   r   r  rv    r   r   r  c                       e Zd ZdS )CTestSignatureObject.test_signature_from_callable_class.<locals>.fooNr   r7   r   r   r(   rx    r   r   r(   rp  rr  s       r   "test_signature_from_callable_classz6TestSignatureObject.test_signature_from_callable_class  s_    22222'+222++C00g{33333r   c                      G d dt           j                  }|                    t          j                  }|                     ||           d S )Nc                       e Zd ZdS )QTestSignatureObject.test_signature_from_callable_builtin_obj.<locals>.MySignatureNr   r7   r   r   r  r|    r   r   r  )rJ   rd  r*  rv  rw  rq  )rP   r  r  s      r   (test_signature_from_callable_builtin_objz<TestSignatureObject.test_signature_from_callable_builtin_obj  sR     	32222'+222''88c;/////r   c                 |   t                      D ]d}t          j        |          }t          |j                  }t          |          }|                     |           |                     ||           et          j        t                    }t          |j                  }|                     |t                     d S r   )
r5   rJ   r  r   r.   r  rF   r  r?   r  r  s        r   3test_signature_definition_order_preserved_on_kwonlyzGTestSignatureObject.test_signature_definition_order_preserved_on_kwonly  s    GII 	* 	*B)"--IY)**AayyHOOAQ))))%&IJJ	%&&<=====r   c                     t          j        d           j        }t          j        d           j        }|                     ||           d S )Nc                     d S r   r7   rX  s     r   r   zITestSignatureObject.test_signater_parameters_is_ordered.<locals>.<lambda>      D r   c                     d S r   r7   r  s     r   r   zITestSignatureObject.test_signater_parameters_is_ordered.<locals>.<lambda>  r  r   )rJ   r  r.   r  )rP   p1p2s      r   #test_signater_parameters_is_orderedz7TestSignatureObject.test_signater_parameters_is_ordered  sL    0011<0011<B#####r   c                 r    G d d          }d|dt           fd}d|dddt           fd}t          j        t          j        j        fD ]n}|                     |	          5   ||          }|                     |j        t                      |                     |j        d         j	        |            ||t                      
          }|                     |j        t                      |                     |j        d         j	        |            ||dt           it                                }|                     |j        t                      |                     |j        d         j	        |           |                     |j        d         j	        d           d d d            n# 1 swxY w Y   pd S )Nc                       e Zd ZdS )QTestSignatureObject.test_signature_annotations_with_local_namespaces.<locals>.FooNr   r7   r   r   rU  r    r   r   rU  r(   ri  c                     d S r   r7   r  s    r   r  zRTestSignatureObject.test_signature_annotations_with_local_namespaces.<locals>.func  rl  r   r    r  c                     d S r   r7   r(   r    s     r   func2zSTestSignatureObject.test_signature_annotations_with_local_namespaces.<locals>.func2  rl  r   signature_func)rL  )re  rL  )r   rJ   r  rd  r*  r  r  r  r.   r  rL  )rP   rU  r  r  r  sig1r  sig3s           r   0test_signature_annotations_with_local_namespaceszDTestSignatureObject.test_signature_annotations_with_local_namespaces  s   'c'c''''4s4434444&0'2C2QR 	K 	KN~>> K K%~d++  !7===  !7!BCHHH%~d688<<<  !7===  !7!BCHHH%~eeS\&((SSS  !7===  !7!BCHHH  !7!BEJJJK K K K K K K K K K K K K K K	K 	Ks    D>F**F.	1F.	c                 \	   t           }t          j        }t          j        }t          j        j        }t          j        t          j        j        fD ]\}|                     |          5  |                      ||j	                   | |d|           |d|          f                     |                      ||j
                   |d |d|d           |d|d          f	                     |                      ||j                   |d |d|d           |d|d
           |d|d          f	                     |                      ||j                   | |d|d           |d|d
           |d|d          f                     |                      ||j                   |                       |                      ||j                   | |d|           |d|           |d|          f                     |                      ||j	        d           | |d|           |d|          f                     |                      ||j
        d           ||j	         |d|t                     |d|t                     f	                     |                      ||j        d           ||j	         |d|t                     |d|d           |d||j	                  f	                     |                      ||j        d           | |d|d           |d|d           |d|d          f                     t"          t$          d}t&          t(          d}|                     t,                    5   ||j
        d|           d d d            n# 1 swxY w Y   |                      ||j
        d|           |t(           |d|t                     |d|t&                    f	                     |                      ||j
        d||           |t(           |d|t"                     |d|t&                    f	                     d d d            n# 1 swxY w Y   ^d S )Nr  r   r   ra  rh  r   r  r   )r  r.   r  r   r  r  Trj  )r   r   )r   rh  rd  rb  )rc  re  rL  )r   rJ   rd  rb  rH  r  r*  r  r  rh  r2  rv  rw  rx  ry  r   r   r  complexr  r   r  	NameError)rP   r|  r  parPORKr  globalnslocalnss           r   test_signature_eval_strz+TestSignatureObject.test_signature_eval_str  s   , 6&0'2C2QR b	 b	N~>> a a  "N3;//CCTNNCTNN$       "N3<00C*3CTe<<<CTe<<<$       "N3=11C*3CTe<<<CTg>>>CTi@@@$       "N3=11CCTg>>>CTg>>>CTkBBB$       0D!E!EssuuMMM  0H!I!ICCTNNCTNNCTNN$       "N3;>>>CCTNNCTNN$       "N3<$???C*-+CTc:::CTc:::$       "N3=4@@@C*-+CTc:::CTe<<<CTckBBB$       "N3=4@@@CCTe<<<CTe<<<CTi@@@$     $)99"'D99&&y11 R R"N3<$QQQQR R R R R R R R R R R R R R R   "N3<$wOOOC*.CTc:::CTe<<<$       "N3<$Y`aaaC*.CTe<<<CTe<<<$    ua a a a a a a a a a a a a a ab	 b	s8   'M
R1OROROB:RR#	&R#	c                     G d d          }d } ||          }d |_         t          j        t          j        j        fD ]`}|                     |          5  |                      ||          t          j                               d d d            n# 1 swxY w Y   a|                     t          j        |          i            d S )Nc                       e Zd Zd Zd ZdS )DTestSignatureObject.test_signature_none_annotation.<locals>.funclikec                     |j         | _         |j        | _        |j        | _        |j        | _        |j        | _        || _        d S r   r  r  s     r   r   zMTestSignatureObject.test_signature_none_annotation.<locals>.funclike.__init__X  r  r   c                      | j         |i |S r   r  r  s      r   r  zMTestSignatureObject.test_signature_none_annotation.<locals>.funclike.__call__`  r!  r   Nr"  r7   r   r   r#  r  S  r$  r   r#  c                      d S r   r7   r7   r   r   r(   z?TestSignatureObject.test_signature_none_annotation.<locals>.fooc  rl  r   r  )rn  rJ   r  rd  r*  r  r  ru  )rP   r#  r(   r  s       r   test_signature_none_annotationz2TestSignatureObject.test_signature_none_annotationR  s2   	2 	2 	2 	2 	2 	2 	2 	2  	hsmm"&0'2C2QR 	K 	KN~>> K K  !4!4g6G6I6IJJJK K K K K K K K K K K K K K K055r:::::s   1BB	B	c                      G d d          } G d d|          } G d d|          }|                      t          j        |          t          j        |                     d S )Nc                   $     e Zd Z fdZd Z xZS )@TestSignatureObject.test_signature_on_derived_classes.<locals>.Bc                 F    t                                          |           S r   r  )rP   r   r  r  s      r   r  zHTestSignatureObject.test_signature_on_derived_classes.<locals>.B.__new__o  s    wwt,,,r   c                     || _         d S r   )r  )rP   r  s     r   r   zITestSignatureObject.test_signature_on_derived_classes.<locals>.B.__init__q  s    "


r   )rG   r\   r]   r  r   r	  r
  s   @r   r/  r  n  sG        - - - - -# # # # # # #r   r/  c                        e Zd Z fdZ xZS )ATestSignatureObject.test_signature_on_derived_classes.<locals>.D1c                 J    t                                          |           d S r   r  )rP   r  r  s     r   r   zJTestSignatureObject.test_signature_on_derived_classes.<locals>.D1.__init__u  s!      '''''r   r  r
  s   @r   D1r  t  s8        ( ( ( ( ( ( ( ( (r   r  c                       e Zd ZdS )ATestSignatureObject.test_signature_on_derived_classes.<locals>.D2Nr   r7   r   r   D2r  x  r  r   r  )r  rJ   r  )rP   r/  r  r  s       r   !test_signature_on_derived_classesz5TestSignatureObject.test_signature_on_derived_classesk  s    	# 	# 	# 	# 	# 	# 	# 	#	( 	( 	( 	( 	( 	( 	( 	(	 	 	 	 	 	 	 	 	*2..0A"0E0EFFFFFr   N)8rG   r\   r]   r  r  r  r  r  r  r  r  r  r  r   r   r  r   r  r  r  r  r/  r6  rB  rI  rQ  rW  rw  r  r  r  r  r  r  r  r
  r  r  r!  r%  r@  rK  rT  rZ  r]  r`  rj  rs  ry  r}  r  r  r  r  r  r  r7   r   r   r  r  	  s       	I 	I \	IJ J JX9 9 98	' 	' 	': : :
     ! ! !
  
  
 "H "H "HF X_)MO ODE DEO O \DEL X_)MO O: :O O \:( # # \#" " "3H 3H 3HjG G G&# # #6          $     $M M M^#  #  # J= = =
E  E  E PO  O  O b     8! ! ! X_)MO O9 9O O9 X_)MO OC CO OC.$ $ $@     
T T T, , ,QH QH QHf) ) )0@ @ @4+ + +.7 7 77 7 72 2 2 4 4 44 4 4 X_)MO O0 0O O0
	> 	> 	>$ $ $
K K K(g g gR; ; ;2G G G G Gr   r  c                   N    e Zd Zd Zd Zd Zd Zd Zd Ze	d             Z
d Zd	S )
TestParameterObjectc                 T   t           j        }|                     |j        |j        cxk     o"|j        cxk     o|j        cxk     o
|j        k     nc            |                     t          |j                  d           |                     dt          |j                  v            d S )Nrc  )rJ   rb  rF   rc  rH  rY  KEYWORD_ONLYrI  r  r   rR  )rP   r  s     r   test_signature_parameter_kindsz2TestParameterObject.test_signature_parameter_kinds  s    )A,C J J J J(J J J J+,>J J J J<=MJ J J J 	K 	K 	K 	Q.//1BCCC)T!2C-D-DDEEEEEr   c                 h   t          j        ddt           j        j                  }|                     |j        d           |                     |j        d           |                     |j        |j                   |                     |j	        t           j        j                   | 
                    t          d          5  t          j        ddd           d d d            n# 1 swxY w Y   | 
                    t          d          5  t          j        dt           j        j                   d d d            n# 1 swxY w Y   | 
                    t          d          5  t          j        d	t           j        j                   d d d            n# 1 swxY w Y   | 
                    t          d
          5  t          j        d t           j        j                   d d d            n# 1 swxY w Y   | 
                    t          d          5  t          j        dt           j        j                   d d d            n# 1 swxY w Y   | 
                    t          d          5  t          j        dt           j        j                   d d d            n# 1 swxY w Y   | 
                    t          d          5  t          j        ddt           j        j                   d d d            n# 1 swxY w Y   | 
                    t          d          5  t          j        ddt           j        j                   d d d            n# 1 swxY w Y   t          j        ddt           j        j                  }| 
                    t          d          5  |                    t           j        j                   d d d            n# 1 swxY w Y   |                     t%          |                              d                     |                     dt%          |          v            d S )Nr(   r  rD  rC  z)value '123' is not a valid Parameter.kind123znot a valid parameter namer  rF  fromname must be a strzis not a valid parameter name$z.azcannot have default valuesr   r   z
<Parameterz"a=42")rJ   rb  rc  r  r  rD  r-  r  r  rC  r  rH  rI  r  rY  rH  r  rF   rR  r  rP   r0   s     r   test_signature_parameter_objectz3TestParameterObject.test_signature_parameter_object  s}   eR#*#4#DF F F'''B'''alAG,,,!2!BCCC##J 1A B B 	= 	=eRe<<<<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= ##J0LMM 	G 	Gc(9(EFFFF	G 	G 	G 	G 	G 	G 	G 	G 	G 	G 	G 	G 	G 	G 	G ##J0LMM 	J 	Jf7+<+HIIII	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J 	J ##I/CDD 	H 	Hd):)FGGGG	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H ##J$CE E 	G 	Gc(9(EFFFF	G 	G 	G 	G 	G 	G 	G 	G 	G 	G 	G 	G 	G 	G 	G ##J$CE E 	H 	Hd):)FGGGG	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H 	H ##J0LMM 	B 	Bc2#*#4#@B B B B	B 	B 	B 	B 	B 	B 	B 	B 	B 	B 	B 	B 	B 	B 	B ##J0LMM 	E 	Ec2#*#4#CE E E E	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E 	E c2#*#4#JL L L##J0LMM 	= 	=II7,;I<<<	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	= 	Q**<88999DGG+,,,,,s   C&&C*-C*&D>>EE$&FFF<&G..G25G2&II
I
,&JJ"%J"'K77K;>K;'MMM&OOOc           
         t           j        } |d|j                  }|                     t	          |          t	           |d|j                                       |                     t	          |          t	           |d|j        d                               |                     t	          |          t	          |                    |j                                       d S )Nr(   rF  r   rB  )rJ   rb  rc  r  r?  r  r  rY  )rP   r  r(   s      r   !test_signature_parameter_hashablez5TestParameterObject.test_signature_parameter_hashable  s    aA-...cD5q7H)I)I)I$J$JKKKDIItAAe!:K68-: -: -: (; (; 	< 	< 	<DII !2B!C!CDD	F 	F 	F 	F 	Fr   c                 h   t           j        } |ddt           j        j                  }|                     ||k               |                     ||k               |                     |dk               |                     |dk               |                     |t
          k               |                     |t
          k               |                     | |ddt           j        j                  k               |                     | |ddt           j        j                  k               d S )Nr(   r   r  )rJ   rb  r  rF   rO   r   )rP   r  r0   s      r   !test_signature_parameter_equalityz5TestParameterObject.test_signature_parameter_equality  sF   AeRg&7&DEEEQa   b!!!R   Y'''i(((QQub$+$5$BD D D D 	E 	E 	Eaar%,%6%CE E E E 	F 	F 	F 	F 	Fr   c                    t          j        ddt           j        j                  }|                     ||                                           |                     ||                                           |                    d          }|                     |j        d           |                    |j                  }|                     ||           |                    d          }|                     |j        d           | 	                    ||           | 
                    t          d          5  |                    |j                  }d d d            n# 1 swxY w Y   |                    dd 	          }|                     |j        d            | 	                    ||           |                    d|j        	          }|                     |j        |j                   |                    d|j                  }|                     |j        |j                   | 	                    ||           | 
                    t          d
          5  |                    |j                  }d d d            n# 1 swxY w Y   |                    |j                  }|                     ||           d S )Nr(   r   r  r&   r  r    r  zname is a required attribute)r  rD  z<value <class 'inspect._empty'> is not a valid Parameter.kindrF  )rJ   rb  r  rz  r  r  r  r  r  r  r  rH  r-  rD  rH  rC  )rP   r0   r  s      r    test_signature_parameter_replacez4TestParameterObject.test_signature_parameter_replace  s   eR#*#4#AC C C 	AIIKK(((AIIKK(((YY!Y$$***ZZ28Z,,BZZUZ##%(((B"""##J$BD D 	+ 	+**B	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ ZZUDZ11bj$'''B"""ZZUBHZ55bj"(+++ ZZ)AZBB"":;;;B"""##J%DE E 	+ 	+ **B	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+
 ZZR_Z--Qs$   ;E##E'*E'JJJc                     |                      t          d          5  t          j        d t          j        j                   d d d            d S # 1 swxY w Y   d S )Nr  rF  )r  r  rJ   rb  rc  rZ   s    r   (test_signature_parameter_positional_onlyz<TestParameterObject.test_signature_parameter_positional_only  s    ##I/CDD 	L 	Ld):)JKKKK	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	Ls   &AAAc                    |                      t          d          5  t          j        dt          j        j                   d d d            n# 1 swxY w Y   t          j        dt          j        j                  }|                     |j        t          j        j                   |                     |j        d           d S )NzYimplicit arguments must be passed as positional or keyword arguments, not positional-onlyz.0rF  	implicit0)	r  rH  rJ   rb  rc  rH  r  rC  r  )rP   r  s     r   !test_signature_parameter_implicitz5TestParameterObject.test_signature_parameter_implicit  s   ##J%:; ; 	L 	L d):)JKKKK		L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L 	L !w(>@ @ @W%6%FGGG[11111s   &AAAc                 6   t          j        dt           j        j                  }|                     t                    5  d|_        d d d            n# 1 swxY w Y   |                     t                    5  d|_        d d d            d S # 1 swxY w Y   d S )Nrr   rF  r    rE  )rJ   rb  r  r  r  r(   rC  r  s     r   %test_signature_parameter_immutabilityz9TestParameterObject.test_signature_parameter_immutability  s   f7+<+IJJJ~.. 	 	AE	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ~.. 	 	AF	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s$    AAA9BBBN)rG   r\   r]   r  r  r  r  r  r  r   r  r  r7   r   r   r  r  ~  s        F F F+- +- +-ZF F FF F F &  &  & PL L L 
2 
2 \
2    r   r  c                       e Zd Zed             Zd Zd Zd Zd Zd Z	d Z
d Zd	 Zd
 Zd Zd Zd Zed             Zd ZdS )TestSignatureBindc                 h    t          j        |           } |j        |i |} | |j        i |j        S r   )rJ   r  rt  r   r  )r  r   r  r  rv  s        r   callzTestSignatureBind.call  sA    %%SXt&v&&tRW*	***r   c                    d }|                      |                     |          d           |                     t          d          5  |                     |d           d d d            n# 1 swxY w Y   |                     t          d          5  |                     |dd           d d d            n# 1 swxY w Y   |                     t          d          5  |                     |d           d d d            d S # 1 swxY w Y   d S )Nc                      dS r  r7   r7   r   r   r_  z9TestSignatureBind.test_signature_bind_empty.<locals>.test  s    2r   r   too many positional argumentsr&   r  r  )got an unexpected keyword argument 'spam'r  r  r  r  r  s     r   test_signature_bind_emptyz+TestSignatureBind.test_signature_bind_empty  s   	 	 	 	4"---##I/NOO 	 	IIdA	 	 	 	 	 	 	 	 	 	 	 	 	 	 	##I/NOO 	( 	(IIdABI'''	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(##BD D 	$ 	$ IIdI###	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$s6   A++A/2A/B66B:=B:DDDc                    d }|                      |                     |          di f           |                      |                     |d          di f           |                      |                     |dd          di f           |                      |                     |d          dd	dif           |                      |                     |dd          dd	dif           |                      |                     |d
          ddd
if           |                      |                     |ddd          dd	dif           d S )Nc                  
    | |fS r   r7   r  s     r   r_  z7TestSignatureBind.test_signature_bind_var.<locals>.test&  rX  r   r7   r&   r{  r'   r  r    r  r(   r  r  r   r  r  r  s     r   test_signature_bind_varz)TestSignatureBind.test_signature_bind_var%  s\   	  	  	  	42r(3334++dBZ8884A..===4U33b5%.5IJJJ466u~8NOOO4b11B3EFFF4A599 5%.1	3 	3 	3 	3 	3r   c                    d }|                      |                     |ddd          d           |                     t          d          5  |                     |dddd           d d d            n# 1 swxY w Y   |                     t          d          5  |                     |d           d d d            n# 1 swxY w Y   |                     t          d	          5  |                     |           d d d            n# 1 swxY w Y   dd}|                      |                     |ddd          d           |                      |                     |dd          d           dd}|                      |                     |d
d          d           |                      |                     |d
          d           |                      |                     |d
          d           d S )Nc                     | ||fS r   r7   ri  s      r   r_  z=TestSignatureBind.test_signature_bind_just_args.<locals>.test3  rj  r   r&   r'   r>  rN  r  r   z missing a required argument: 'b'z missing a required argument: 'a'r  c                     | ||fS r   r7   ri  s      r   r_  z=TestSignatureBind.test_signature_bind_just_args.<locals>.testC  rj  r   )r&   r'   r  c                     | ||fS r   r7   ri  s      r   r_  z=TestSignatureBind.test_signature_bind_just_args.<locals>.testH  rj  r   r@  r-  )r  r'   r@  rk  )r  r'   r>  re  )r&   r  r>  r  r  r  s     r   test_signature_bind_just_argsz/TestSignatureBind.test_signature_bind_just_args2  s   	 	 	 	4Aq119===##I/NOO 	( 	(IIdAq!Q'''	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( ##I$FH H 	 	IIdA	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 ##I$FH H 	 	IIdOOO	 	 	 	 	 	 	 	 	 	 	 	 	 	 		 	 	 	4Aq119===4A..
;;;	 	 	 	4244kBBB42..
;;;42..
;;;;;s6   A11A58A5B::B>B> DD	Dc                     d }|                      |                     |          d           |                      |                     |ddd          d           d S )Nc                      | S r   r7   r  s    r   r_  zATestSignatureBind.test_signature_bind_varargs_order.<locals>.testO  s    Kr   r7   r&   r'   r>  rN  r  r  s     r   !test_signature_bind_varargs_orderz3TestSignatureBind.test_signature_bind_varargs_orderN  sa    	 	 	 	4"---4Aq119=====r   c           
         dd}|                      |                     |ddddd          d           |                      |                     |dd          d           |                      |                     |dd	          d
           |                      |                     |dd          d           |                     t          d          5  |                     |dddd           d d d            d S # 1 swxY w Y   d S )Nr>  c                     | |||fS r   r7   )r   r   r   r   s       r   r_  zDTestSignatureBind.test_signature_bind_args_and_varargs.<locals>.testV  s    aD= r   r&   r'   r   r   )r&   r'   r>  )r   r   )r&   r'   r>  r7   r0  )r'   r&   r>  r7   re  z multiple values for argument 'c'r  r>  r  r  s     r   $test_signature_bind_args_and_varargsz6TestSignatureBind.test_signature_bind_args_and_varargsU  sX   	! 	! 	! 	! 	4Aq!Q779JKKK4A..>>>4122MBBB4a00-@@@##I%GI I 	* 	*IIdAq!qI)))	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	*s   C99C= C=c                     d }|                      |                     |          i            |                      |                     |dd          ddd           d S )Nc                      | S r   r7   )r  s    r   r_  z?TestSignatureBind.test_signature_bind_just_kwargs.<locals>.testc  s    Mr   r    rY  r(   rr   r  r  s     r   test_signature_bind_just_kwargsz1TestSignatureBind.test_signature_bind_just_kwargsb  st    	 	 	 	4"---4U??!&66	8 	8 	8 	8 	8r   c           
      J   dd}|                      |                     |dd          dddi f           |                      |                     |dddd          ddddddf           |                      |                     |dddd          ddddddf           |                      |                     |dddd	          ddddddf           |                      |                     |dddd
          ddddddf           |                      |                     |ddddd          ddddddf           |                      |                     |dddd          dddddif           |                      |                     |ddd          dddi f           d S )Nr>  c                     | |||fS r   r7   rN  s       r   r_  zCTestSignatureBind.test_signature_bind_args_and_kwargs.<locals>.testk  s    aF?"r   r&   r'   r    rY  r  )r   r   r(   rr   )r   r   r(   rr   )r   r(   rr   r   )r   r   r(   rr   r  r(   r   )r   r   r   r  r  r  s     r   #test_signature_bind_args_and_kwargsz5TestSignatureBind.test_signature_bind_args_and_kwargsj  s.   	# 	# 	# 	# 	4A..Aq">>>4A5uEEQ5%#@#@A	C 	C 	C41u5IIQ5%#@#@A	C 	C 	C41u5IIQ5%#@#@A	C 	C 	C4aUGGQ5%#@#@A	C 	C 	C4a1%eLLQ5%#@#@A	C 	C 	C4Aqe<<QE5>2	4 	4 	441Q77Q2	( 	( 	( 	( 	(r   c           	         d }|                      t          d          5  |                     |d           d d d            n# 1 swxY w Y   |                     |                     |d          d           ddd}|                      t          d          5  |                     |d           d d d            n# 1 swxY w Y   d }|                     |                     |dd	          d
           |                     |                     |dd          d
           |                      t          d          5  |                     |ddd           d d d            n# 1 swxY w Y   |                      t          d          5  |                     |dd           d d d            n# 1 swxY w Y   |                      t          d          5  |                     |ddd	           d d d            n# 1 swxY w Y   |                      t          d          5  |                     |ddd           d d d            n# 1 swxY w Y   |                      t          d          5  |                     |d           d d d            n# 1 swxY w Y   d }|                     |                     |dd	          ddi f           |                     |                     |dd          ddi f           |                     |                     |ddd          ddddif           |                     |                     |ddd          ddddif           |                      t          d          5  |                     |dd           d d d            n# 1 swxY w Y   |                     |                     |dddd          dddddf           d S )Nc                     | S r   r7   r  s    r   r_  z:TestSignatureBind.test_signature_bind_kwonly.<locals>.test      Jr   r  r&   r  c                    |S r   r7   )r   r(   r    s      r   r_  z:TestSignatureBind.test_signature_bind_kwonly.<locals>.test  r  r   z"missing a required argument: 'bar'c                
    | |fS r   r7   r  s     r   r_  z:TestSignatureBind.test_signature_bind_kwonly.<locals>.test  s    8Or   r'   r  r  )r    r(   r  r  )r    r(   rr   rY  )r    rr   c                    | ||fS r   r7   )r(   r    bins      r   r_  z:TestSignatureBind.test_signature_bind_kwonly.<locals>.test  s    S= r   r  rr   )rr   r(   r    z"missing a required argument: 'foo')rr   r    )r    r  rr   )r  rr   )r  r  r  r  r  s     r   test_signature_bind_kwonlyz,TestSignatureBind.test_signature_bind_kwonly~  s;   	 	 	##I%DF F 	 	IIdA	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	4Q//333 	 	 	 	 	##I%IK K 	 	IIdA	 	 	 	 	 	 	 	 	 	 	 	 	 	 		 	 	422F;;;4QA66???##BD D 	3 	3 IIdqrI222	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3
 ##I%DF F 	" 	"IIdAq!!!	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" ##I%DF F 	) 	)IIdAqaI(((	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) 	) ##BD D 	2 	2 IIdA15I111	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2
 ##I%IK K 	 	IIdA	 	 	 	 	 	 	 	 	 	 	 	 	 	 		! 	! 	!422Q2J???4QA66Ar
CCC4>>Q0	2 	2 	24eBBQ0	2 	2 	2##I$HJ J 	/ 	/IIdAI...	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	4qrBBQ2 6 67	9 	9 	9 	9 	9s   AA	AB<<C C =E##E'*E'	F--F14F1G99G= G=II	I	+JJJ9NN"%N"c                 n   ddd}t          j        |          }|                    dddddd	
          }|                     t	          |j                                                  ddddddd	dff           |                     |j        dddd	d
           |                     |j        d           d S )Nr  r%   c                    d S r   r7   )r   r   r%   r   r  s        r   r_  z=TestSignatureBind.test_signature_bind_arguments.<locals>.test  r`  r   r  rh  r1  r>  r  <   )r   r   r   r  r   r  )r   )rh  )r   r1  r  )r   r   r  )r  rh  )	rJ   r  rt  r  r  	argumentsitemsr  r   rP   r_  r  rv  s       r   test_signature_bind_argumentsz/TestSignatureBind.test_signature_bind_arguments  s     # 	 	 	 	 	%%XXb"br"X== 	r|113344#_i#2rR%H%HIK	L 	L 	L 	!B"EE	G 	G 	G(+++++r   c           
         dddd}|                      |                     |dddd	d
          dddd	d
i f           |                      |                     |dd          dddddi f           |                      |                     |dddd	          ddddd	i f           |                     t          d          5  |                     |dddd	d           d d d            n# 1 swxY w Y   |                     t          d          5  |                     |ddd           d d d            n# 1 swxY w Y   |                     t          d          5  |                     |dd           d d d            d S # 1 swxY w Y   d S )Nr>  r   r  r  c                   | |||||fS r   r7   )rW  b_poc_por(   r    r  s         r   r_  zCTestSignatureBind.test_signature_bind_positional_only.<locals>.test  s    tS#v55r   r&   r'   r   r      r  zbut was passed as a keywordr  )r(   r    r  zparameter is positional only)r  )rW  r  )r>  r   r  r  s     r   #test_signature_bind_positional_onlyz5TestSignatureBind.test_signature_bind_positional_only  s   	6r 	6 	6 	6 	6 	6 	4Aq!;;Q1a,	. 	. 	. 	4A..Q2r2.	0 	0 	0 	4A1!<<Q1a,	. 	. 	. ##I/LMM 	9 	9IIdAqaQRI888	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 	9 ##I/MNN 	* 	*IIdAqqI)))	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* ##I/MNN 	, 	,IIdI+++	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	,s6   =C%%C),C)D11D58D5E==FFc                     d }t          j        |          }|                    ddd          }|                     |j        d           |                    ddd          }|                     |j        d           d S )Nc                     d S r   r7   )r   rP   r   s      r   r_  zATestSignatureBind.test_signature_bind_with_self_arg.<locals>.test  r`  r   r&   r'   r>  rN  r  )rJ   r  rt  r  r   r  s       r   !test_signature_bind_with_self_argz3TestSignatureBind.test_signature_bind_with_self_arg  s    	 	 	%%XXaA),,,XXaa1X%%),,,,,r   c                    d }t          j        |          }|                     t          d          5  |                    dd           d d d            n# 1 swxY w Y   d }|                     |                     |d          dd	dif           t          j        |          }|                    d          }|                     |j        d
d	dii           d S )Nc                 
    | |fS r   r7   r   r   s     r   r_  z?TestSignatureBind.test_signature_bind_vararg_name.<locals>.test  s    d7Nr   z)got an unexpected keyword argument 'args'r   r&   r	  c                  
    | |fS r   r7   r  s     r   r_  z?TestSignatureBind.test_signature_bind_vararg_name.<locals>.test  rX  r   r  r7   r   r  )rJ   r  r  r  rt  r  r  r  r  s       r   test_signature_bind_vararg_namez1TestSignatureBind.test_signature_bind_vararg_name  s4   	 	 	%%##BD D 	" 	" HHqqH!!!	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	"
	  	  	 4a002{2CDDD%%XX1X61+'>?????s   AAAc                     d }|j         j        d         }t          j        |i           }t	          t          d                    }|                     |                     ||          h d           d S )Nc                  4    d t          d          D             S )Nc                     h | ]}||z  S r7   r7   )r}  r%   s     r   	<setcomp>zWTestSignatureBind.test_signature_bind_implicit_arg.<locals>.make_set.<locals>.<setcomp>  s    ,,,aAE,,,r   r   rk   r7   r   r   make_setzDTestSignatureBind.test_signature_bind_implicit_arg.<locals>.make_set  s    ,,588,,,,r   r&   r   >   r   r&   r   r  r  )r  	co_constsr   FunctionTypeiterr)   r  r  )rP   r	  setcomp_codesetcomp_funciterators        r    test_signature_bind_implicit_argz2TestSignatureBind.test_signature_bind_implicit_arg  su    	- 	- 	-(215),;;a>><::<L<L<LMMMMMr   c                     d }t          j        |          }|                    dd          }|                     |j        ddi           |                     d|j                                                   d S )Nc                0    | |                     |           fS r   )r  )r    r  s     r   r(   zATestSignatureBind.test_signature_bind_posonly_kwargs.<locals>.foo  s    

3''r   pos-onlykeywordr  r    )r    r	  )rJ   r  rt  r  r  r   r  r  )rP   r(   r  results       r   "test_signature_bind_posonly_kwargsz4TestSignatureBind.test_signature_bind_posonly_kwargs   s    	( 	( 	( $$*)44	(:;;;)6+;+A+A+C+CDDDDDr   N)rG   r\   r]   r  r  r  r  r  r  r  r  r  r  r  r	  r	  r		  r   r	  r	  r7   r   r   r  r    s       + + \+
$ $ $3 3 3< < <8> > >* * *8 8 8( ( ((59 59 59n, , ,, , ,,- - -@ @ @$ N N \NE E E E Er   r  c                   2    e Zd Zd Zd Zd Zd Zd Zd ZdS )TestBoundArgumentsc                     d }t          j        |                              d          }|                     t          d          5  t          |           d d d            d S # 1 swxY w Y   d S )Nc                     d S r   r7   rk  s    r   r(   zITestBoundArguments.test_signature_bound_arguments_unhashable.<locals>.foo  rl  r   r&   rF  )rJ   r  rt  r  r  r?  rP   r(   rv  s      r   )test_signature_bound_arguments_unhashablez<TestBoundArguments.test_signature_bound_arguments_unhashable  s    s##((++##I/@AA 	 	HHH	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   A##A'*A'c                    d }t          j        |                              d          }|                     ||k               |                     ||k               |                     |t
          k               |                     |t
          k               t          j        |                              d          }|                     ||k               |                     ||k               t          j        |                              d          }|                     ||k               |                     ||k               d|j        d<   |                     ||k               |                     ||k               d }t          j        |                              d          }|                     ||k               |                     ||k               d }t          j        |          }|                    dd          }|                    dd          }|                     ||k               |                     ||k               d S )	Nc                     d S r   r7   rk  s    r   r(   zGTestBoundArguments.test_signature_bound_arguments_equality.<locals>.foo  rl  r   r&   r'   r   c                     d S r   r7   re  s    r   r    zGTestBoundArguments.test_signature_bound_arguments_equality.<locals>.bar&  rl  r   c                     d S r   r7   r   s     r   r(   zGTestBoundArguments.test_signature_bound_arguments_equality.<locals>.foo+  rl  r   r   r0  )rJ   r  rt  rF   rO   r   r  )	rP   r(   rv  ba2ba3r    ba4r  ba1s	            r   'test_signature_bound_arguments_equalityz:TestBoundArguments.test_signature_bound_arguments_equality  s#   s##((++b!!!r"""i(((y)))$$))!,,c	"""s###$$))!,,s###c	"""cc	"""s###$$))!,,s###c	"""$$hhah  hhah  s
###$$$$$r   c                    i ddddddifd}t          j        |          }|                    dd	i 
          }t          t          j        dz             D ]m}|                     |          5  t	          j        t	          j        ||                    }| 	                    ||           d d d            n# 1 swxY w Y   nd S )Nr  r   r&   ri  r   rY  c                    d S r   r7   r  s       r   r(   zETestBoundArguments.test_signature_bound_arguments_pickle.<locals>.foo3  rl  r   rh  r1  r  )r  )
rJ   r  rt  r)   r  r  r  r  r  r  )rP   r(   r  rv  r  
ba_pickleds         r   %test_signature_bound_arguments_picklez8TestBoundArguments.test_signature_bound_arguments_pickle2  s   :::1:2e*::::$$XXb"X##01455 	1 	1C-- 1 1#\&,r3*?*?@@
  Z0001 1 1 1 1 1 1 1 1 1 1 1 1 1 1	1 	1s   .>B88B<	?B<	c                     i ddddddifd}t          j        |          }|                    dd	i 
          }|                     t	          |          d           d S )Nr  r   r&   ri  r   rY  c                    d S r   r7   r  s       r   r(   zCTestBoundArguments.test_signature_bound_arguments_repr.<locals>.foo=  rl  r   rh  r1  r  z <BoundArguments \(a=20,.*\}\}\)>)rJ   r  rt  assertRegexrR  rP   r(   r  rv  s       r   #test_signature_bound_arguments_reprz6TestBoundArguments.test_signature_bound_arguments_repr<  so    :::1:2e*::::$$XXb"X##b#FGGGGGr   c           
         di ddd}t          j        |          }|                    d          }|                                 |                     t          |j                                                  ddddi fd	i fg           |                    d
ddd          }|                                 |                     t          |j                                                  ddddi fd	ddifg           d }t          j        |          }|                    d          }|                                 |                     t          |j                                                  dg           d }t          j        |          }|                                }|                                 |                     t          |j                                                  g            dd}t          j        |          }|                                }|                                 |                     t          |j                                                  dg           d S )Nr&   r  r   c                    d S r   r7   )r   r   r   r   r  s        r   r(   zMTestBoundArguments.test_signature_bound_arguments_apply_defaults.<locals>.fooC  rl  r   rh  )r   rh  ro  )r   r7   r  r  r1  )rO  r  )r   rh  )r   )r1  rO  c                     d S r   r7   r   s     r   r(   zMTestBoundArguments.test_signature_bound_arguments_apply_defaults.<locals>.fooV  rl  r   c                      d S r   r7   r7   r   r   r(   zMTestBoundArguments.test_signature_bound_arguments_apply_defaults.<locals>.foo_  rl  r   rr   c                     d S r   r7   rk  s    r   r(   zMTestBoundArguments.test_signature_bound_arguments_apply_defaults.<locals>.foof  rl  r   )r   rr   r{  )r   r&   r  )	rJ   r  rt  apply_defaultsr  r   r  r  bind_partialr2	  s       r   -test_signature_bound_arguments_apply_defaultsz@TestBoundArguments.test_signature_bound_arguments_apply_defaultsB  sZ   22222222$$XXb\\
##%%&&,b	D":F	H 	H 	H XXb"bAX&&
##%%&&	?S"Is1gO	Q 	Q 	Q 	$$b!!
##%%&&K	 	 	
 	$$XXZZ
bl002233R888 	 $$XXZZ
bl002233m_EEEEEr   c                     d }t          j        |                              d          }|                     t	          |j                  t                     d S )Nc                     d S r   r7   rk  s    r   r(   zMTestBoundArguments.test_signature_bound_arguments_arguments_type.<locals>.foom  rl  r   r&   )rJ   r  rt  r-  r   r  r   r 	  s      r   -test_signature_bound_arguments_arguments_typez@TestBoundArguments.test_signature_bound_arguments_arguments_typel  sM    s##((++d2<(($/////r   N)	rG   r\   r]   r!	  r*	  r.	  r3	  r;	  r>	  r7   r   r   r	  r	    su          % % %>1 1 1H H H(F (F (FT0 0 0 0 0r   r	  c                       e Zd Zd Zd ZdS )TestSignaturePrivateHelpersc                     t          j        |          \  }}}|                     ||           |                     ||           |                     ||           d S r   )rJ   "_signature_strip_non_python_syntaxr  )rP   inputclean_signatureself_parameterlast_positional_onlycomputed_clean_signaturecomputed_self_parametercomputed_last_positional_onlys           r   _strip_non_python_syntaxz4TestSignaturePrivateHelpers._strip_non_python_syntaxr  sl    
 6u==	* #)1?CCC0.AAA68LMMMMMr   c                 V   |                      dddd           |                      dddd           |                      ddd d           |                      ddd d            |                      d	dd d            |                      d
d
d d            |                      d d d d            d S )NzZ($module, /, path, mode, *, dir_fd=None, effective_ids=False,
       follow_symlinks=True)zO(module, path, mode, *, dir_fd=None, effective_ids=False, follow_symlinks=True)r   z($module, word, salt, /)z(module, word, salt)r'   z(x, y=None, z=None, /)z(x, y=None, z=None)z!(x,
    y=None,
      z = None  )r   )rJ	  rZ   s    r   &test_signature_strip_non_python_syntaxzBTestSignaturePrivateHelpers.test_signature_strip_non_python_syntax|  s   %%E=	 	 	 	%%&"		 	 	 	%%$!		 	 	 	%%!!		 	 	 	%%1!		 	 	 	%%		 	 	 	%%		 	 	 	 	r   N)rG   r\   r]   rJ	  rL	  r7   r   r   r@	  r@	  q  s5        N N N+ + + + +r   r@	  c                   ^    e Zd Ze ej        ed          d                         Zd Zd Z	dS )TestSignatureDefinitionsrr  c                    t                      }h d}||z  }dh}||z  }dh}||z  }h d}||z  }ddh}||z  }t                      }t          t                    }t          |                                          D ]\  }	}
t          |
          st          |
t                    r|	|vr|                    |	           |	|v rH| 	                    |	          5  | 
                    t          j        |
                     d d d            n# 1 swxY w Y   |D ]J}	| 	                    |	          5  |                     |
j                   d d d            n# 1 swxY w Y   Kd S )N>   r  r	  rB  varsr)   slicer  anextround>   maxr  r  
breakpoint__build_class__r[  
__import__)r  )rI   rP	  r  r  r  callabler  r   r  r  assertIsNotNonerJ   r  r  __text_signature__)rP   no_signatureneeds_groups
needs_nullneeds_semantic_updateneeds_varargsnot_converted_yettypes_with_signaturesr  r  rS   s              r   test_builtins_have_signaturesz6TestSignatureDefinitions.test_builtins_have_signatures  s,    uu0 0 0$Y

"!(	--, , ,% $\2)) #(^^

++ 	= 	=ID#C== #t$$ '$6K*K*K  &&&$$d++ = =$$W%6s%;%;<<<= = = = = = = = = = = = = = = ! 	: 	:Dd++ : :!!#"8999: : : : : : : : : : : : : : :	: 	:s$   (DD	D	5EE 	#E 	c                    d }d|_         t          j        |          }|                     |           |                     t          |          d           d|_         t          j        |          }|                     t          |          d           d|_         t          j        |          }|                     t          |          d           d|_         t          j        |          }|                     t          |          d	           d
|_         |                     t                    5  t          j        |           d d d            n# 1 swxY w Y   d|_         |                     t                    5  t          j        |           d d d            n# 1 swxY w Y   d|_         |                     t                    5  t          j        |           d d d            d S # 1 swxY w Y   d S )Nc                      d S r   r7   r  s     r   r  zNTestSignatureDefinitions.test_python_function_override_signature.<locals>.func  r`  r   z(($self, a, b=1, *args, c, d=2, **kwargs)z*(self, /, a, b=1, *args, c, d=2, **kwargs)z+($self, a, b=1, /, *args, c, d=2, **kwargs)z*(self, a, b=1, /, *args, c, d=2, **kwargs)z"(self, a=1+2, b=4-3, c=1 | 3 | 16)z(self, a=3, b=1, c=19)z(self, a=1,
b=2,


   c=3)z(self, a=1, b=2, c=3)z(self, x=does_not_exist)z(self, x=sys, y=inspect)z(self, 123))rZ	  rJ   r  rY	  r  r   r  rH  )rP   r  r  s      r   'test_python_function_override_signaturez@TestSignatureDefinitions.test_python_function_override_signature  s   	 	 	"L%%S!!!S#OPPP"O%%S#OPPP"F%%S#;<<<"B%%S#:;;;"<z** 	$ 	$d###	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$"<z** 	$ 	$d###	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$"/z** 	$ 	$d###	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$s6   2EEE?F  F$'F$G..G25G2c                     ddl m}  G d d|          }|j        }|                     |d           t	          j        |          }|                     t          |          d           d S )Nr   )BufferedReaderc                       e Zd ZdS )VTestSignatureDefinitions.test_base_class_have_text_signature.<locals>.MyBufferedReaderNr   r7   r   r   MyBufferedReaderri	    s        &&r   rj	  z&(raw, buffer_size=DEFAULT_BUFFER_SIZE)z(raw, buffer_size=8192))test.ann_module7rg	  rZ	  r  rJ   r  r   )rP   rg	  rj	  text_signaturer  s        r   #test_base_class_have_text_signaturez<TestSignatureDefinitions.test_base_class_have_text_signature  s    333333	' 	' 	' 	' 	'~ 	' 	' 	' (:)QRRR 011S#<=====r   N)
rG   r\   r]   r   r   r  r   rb	  re	  rm	  r7   r   r   rN	  rN	    ss         X_)MO O2: 2:O O \2:h$ $ $<	> 	> 	> 	> 	>r   rN	  c                   *    e Zd Zd Zed             ZdS )NTimesUnwrappablec                 "    || _         d | _        d S r   )r  _next)rP   r  s     r   r   zNTimesUnwrappable.__init__  s    


r   c                     | j         dk    rt          d          | j        t          | j         dz
            | _        | j        S )Nr   zUnwrapped too many timesr&   )r  r   rq	  ro	  rZ   s    r   r  zNTimesUnwrappable.__wrapped__  sA    6Q;;6777:*46A:66DJzr   N)rG   r\   r]   r   r  r  r7   r   r   ro	  ro	    s>             X  r   ro	  c                   2    e Zd Zd Zd Zd Zd Zd Zd ZdS )
TestUnwrapc                     d } t          j        d          |          }|                     t          j        |          |           d S )Nc                     | |z   S r   r7   r   s     r   r  z(TestUnwrap.test_unwrap_one.<locals>.func      q5Lr   rh  )r  )r   	lru_cacher-  rJ   unwrap)rP   r  rn  s      r   test_unwrap_onezTestUnwrap.test_unwrap_one  sR    	 	 	1)%b111$77gnW--t44444r   c                     d }|}t          d          D ]}t          j        |          d             } |                     |j        |           |                     t          j        |          |           d S )Nc                     | |z   S r   r7   r   s     r   r  z,TestUnwrap.test_unwrap_several.<locals>.func$  rw	  r   r  c                      d S r   r7   r7   r   r   rn  z/TestUnwrap.test_unwrap_several.<locals>.wrapper(  r   r   )r)   r   r[  rz  r  r-  rJ   ry	  )rP   r  rn  __s       r   test_unwrap_severalzTestUnwrap.test_unwrap_several#  s    	 	 	)) 	 	B_W%%  &% ,d333gnW--t44444r   c                     d }t          j        |          d             }t          j        |          d             }d|_        t          j        |d           }|                     ||           d S )Nc                     | |z   S r   r7   r   s     r   func1z#TestUnwrap.test_stop.<locals>.func1/  rw	  r   c                      d S r   r7   r7   r   r   r  z#TestUnwrap.test_stop.<locals>.func21  rZ  r   c                      d S r   r7   r7   r   r   rn  z%TestUnwrap.test_stop.<locals>.wrapper4  rZ  r   r&   c                 "    t          | d          S )N	stop_herer'  r  s    r   r   z&TestUnwrap.test_stop.<locals>.<lambda>9  s    71k3J3J r   )stop)r   r[  r	  rJ   ry	  r-  )rP   r	  r  rn  	unwrappeds        r   	test_stopzTestUnwrap.test_stop.  s    	 	 					 	 
 						 	 
 		N7)J)JM M M	i'''''r   c                    d }||_         |                     t          d          5  t          j        |           d d d            n# 1 swxY w Y   d }||_         ||_         |                     t          d          5  t          j        |           d d d            n# 1 swxY w Y   |                     t          d          5  t          j        |           d d d            d S # 1 swxY w Y   d S )Nc                      d S r   r7   r7   r   r   r	  z$TestUnwrap.test_cycle.<locals>.func1=  rl  r   r  c                      d S r   r7   r7   r   r   r  z$TestUnwrap.test_cycle.<locals>.func2B  rl  r   )r  r  rH  rJ   ry	  )rP   r	  r  s      r   
test_cyclezTestUnwrap.test_cycle<  s   !##J?? 	" 	"N5!!!	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	!!##J?? 	" 	"N5!!!	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	"##J?? 	" 	"N5!!!	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	"s5   AAA>BB#&B#C''C+.C+c                     d d _          G fdd          }|                     t          j         |                                 d S )Nc                      d S r   r7   r7   r   r   r  z(TestUnwrap.test_unhashable.<locals>.funcK  rl  r   c                       e Zd ZdZ ZdS )%TestUnwrap.test_unhashable.<locals>.CN)rG   r\   r]   __hash__r  r  s   r   r   r	  M  s        HKKKr   r   )r  r  rJ   ry	  )rP   r   r  s     @r   test_unhashablezTestUnwrap.test_unhashableJ  sr    	 	 	 	 	 	 	 	 	 	 	'.--.....r   c                     t          t          j                    dz             }|                     t          d          5  t          j        |           d d d            d S # 1 swxY w Y   d S )Nr&   r  )ro	  r  getrecursionlimitr  rH  rJ   ry	  )rP   rS   s     r   test_recursion_limitzTestUnwrap.test_recursion_limitR  s     5 7 7! ;<<##J?? 	  	 N3	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	  	 s   A!!A%(A%N)	rG   r\   r]   rz	  r	  r	  r	  r	  r	  r7   r   r   rt	  rt	    sn        5 5 5	5 	5 	5( ( (" " "/ / /         r   rt	  c                   ^    e Zd Zd Zd Z ej        edu d          d             Zd Z	d Z
dS )TestMainc                 T   t          j        d          }t          ddd          \  }}}|                                                                }|                     |d d         t          j        |                                                     |                     |d           d S )Nr   -mrJ   r   r   )	importlibimport_moduler   decoder  r  rJ   rj  )rP   modulercr9   errrg  s         r   test_only_sourcezTestMain.test_only_sourceX  s    (44'i(24 4C

''))ssW%6v%>%>%I%I%K%KLLLc"""""r   c                     d }d|_         |                     t                    5  t          j        |           d d d            d S # 1 swxY w Y   d S )Nc                      d S r   r7   r7   r   r   r(   z)TestMain.test_custom_getattr.<locals>.foob  r`  r   r   )re  r  r  rJ   r  r  s     r   test_custom_getattrzTestMain.test_custom_getattra  s    	 	 	y)) 	# 	#c"""	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	# 	#s   AAANz6threads required to test __qualname__ for source filesc                 6   t          ddd          \  }}}|                                                                }|                     |d d         t	          j        t                                                               |                     |d           d S )Nr	  rJ   z%concurrent.futures:ThreadPoolExecutorr   r   )r   r	  r  r  rJ   rj  r   )rP   r	  r9   r	  rg  s        r   test_qualname_sourcezTestMain.test_qualname_sourceh  s     (i%LN NC

''))ss *+=>>IIKK	M 	M 	Mc"""""r   c                     t          ddd          \  }}}|                                                                }|                     |dg           d S )Nr	  rJ   r  z#Can't get info for builtin modules.)r   r	  r  r  )rP   r9  r9   r	  rg  s        r   test_builtinszTestMain.test_builtinss  sW    +D),13 33

''))!F GHHHHHr   c                 z   t          j        d          }t          j                    }t	          g |ddddR  \  }}}|                                }|                     |j        |           |                     |j        |           |                     |j	        |           | 
                    |d           d S )Nr   r	  rJ   z	--detailsr   )r	  r	  r   !optim_args_from_interpreter_flagsr   r	  r   rG   r1  
__cached__r  )rP   r	  r   r	  r9   r	  outputs          r   test_detailszTestMain.test_detailsy  s    (448::' A At AY A(2A4?A A ACfov...fov...f'000c"""""r   )rG   r\   r]   r	  r	  r   r  r   r	  r	  r	  r7   r   r   r	  r	  W  s        # # ## # # X_'4/DF F# #F F#I I I
# 
# 
# 
# 
#r   r	  c                   Z    e Zd Z ej        d          Z ej        d          Zd Zd ZdS )
TestReloadz def foo():
    print("Bla")
    z#def foo():
    print("Oh no!")
    c                    t          j        |          }t          |d          5 }|                     |                                                    d          |                    d                     d d d            d S # 1 swxY w Y   d S )NrX  rY  T)rJ   rj  r[  r  r^  r  )rP   r  r_  inspected_srcr  s        r   assertInspectEqualzTestReload.assertInspectEqual  s    )&11$))) 	S

%%d++((..  	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   ABB	Bc                 p   t          d| j                  5 \  }}t          j        |          }|                     ||           t          |dd          5 }|                    | j                   d d d            n# 1 swxY w Y   |                     ||           d d d            d S # 1 swxY w Y   d S )N
reload_bugr  rX  rY  )r   
src_beforer	  r	  r	  r[  r  	src_after)rP   r  r  r	  r  s        r   test_getsource_reloadz TestReload.test_getsource_reload  s0   lDO<< 	2t,T22F##D&111dC'222 *c		$.)))* * * * * * * * * * * * * * *##D&111	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2s6   A B+A=1B+=B	B+B	B++B/2B/N)	rG   r\   r]   textwrapdedentr	  r	  r	  r	  r7   r   r   r	  r	    sd          " 	 	J
   ! 	 	I
  2 2 2 2 2r   r	  __main__)lr  r  r   r   r	  rJ   ry  r  r  r+  os.pathr   rv  r  r  r  r   r	  r  r   unittest.mockr   concurrent.futuresr   ImportErrortest.supportr   r   r   test.support.import_helperr	   test.support.os_helperr
   test.support.script_helperr   r   r_  r   r{   r   r  r   r   r   r   test.test_importr   r1  r)  r  r   r   r   r5   r?   rd  r  r  rA   rm   ro   rs   rm  ru   rw   r  rV  rm  rs  r
  r  r  r+  rO  r^  r  r  r   r  r  r&  r(  r  r  r  r  r  rQ  rZ  rb  r2  rh  rd  r  rb  r  r  r  r  r	  r@	  rN	  ro	  rt	  r	  r	  rG   mainr7   r   r   <module>r	     s~
                  				     				 



          



            5555555    & % % % % % 8 8 8 8 8 8 8 8 4 4 4 4 4 4 ) ) ) ) ) ) N N N N N N N N & & & & & & ( ( ( ( ( (       * * * * * * / / / / / / 1 1 1 1 1 1 - - - - - - ,
J crclG (7

( ( ( cmoo  $	 	 	 $M#R#R#T#T  M M M M M" M M M0         hA hA hA hA hAZ hA hA hAVB> B> B> B> B>: B> B> B>H8 8 8 8 8H% 8 8 8 7 7 7 7 7 7 7 7
R: R: R: R: R:} R: R: R:h	E 	E 	E 	E 	Ex0 	E 	E 	E0 0 0 0 0 0 0 07 7 7 7 7] 7 7 7(7 (7 (7 (7 (7M (7 (7 (7T
C 
C 
C 
C 
C 
C 
C 
CnO nO nO nO nO] nO nO nO`: : : : : : : :&N N N N N= N N N7 7 7 7 7F 7 7 79 9 9 9 9f 9 9 9> > >vn vn vn vn vnh/ vn vn vnrb b b b b8, b b b5> 5> 5> 5> 5>8, 5> 5> 5>p fhhw> w> w> w> w>* w> w> w>tG+ G+ G+ G+ G+x0 G+ G+ G+R         5      : : : : :$: : : :(_& _& _& _& _&) _& _& _&D	`H `H `H `H `HH- `H `H `HF=G =G =G =G =GH- =G =G =G@	 	 	 	 	'# 	 	 	
	 	 	 	 	'# 	 	 	oG oG oG oG oG(+ oG oG oGd+O O O O O(+ O O OdxE xE xE xE xE) xE xE xEvd0 d0 d0 d0 d0* d0 d0 d0L6 6 6 6 6("3 6 6 6pb> b> b> b> b>x0 b> b> b>J       :  :  :  :  : " :  :  : x,# ,# ,# ,# ,#x  ,# ,# ,#^2 2 2 2 2" 2 2 2< zHMOOOOO s   A A)(A)