Uname:Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64

403WebShell
403Webshell
Server IP : 3.111.61.48  /  Your IP : 216.73.216.67
Web Server : Apache
System : Linux ip-10-0-5-176 6.8.0-1057-aws #60~22.04.1-Ubuntu SMP Wed May 27 08:16:59 UTC 2026 x86_64
User : ubuntu ( 1000)
PHP Version : 8.2.31
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.10/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.10/test/__pycache__/test_call.cpython-310.pyc
o

�9j�h�@s�ddlZddlmZzddlZWneydZYnwddlZddlZddlZddlZddl	Z	Gdd�de
�ZGdd�dej�Z
eGdd�dej��ZGd	d
�d
ej�ZGdd�de�ZGd
d�de�ZGdd�de�ZGdd�de�Zdd�Zdd�ZGdd�d�Ze�Ze�ZGdd�dej�ZdZdZdd�Zdd �ZGd!d"�d"ej�ZGd#d$�d$�Z eGd%d&�d&ej��Z!e"d'kr�e�#�dSdS)(�N)�cpython_onlyc@seZdZdd�Zdd�ZdS)�BadStrcC�dS)NT�)�self�otherrr�%/usr/lib/python3.10/test/test_call.py�__eq__�z
BadStr.__eq__cCst�|�dAS)N�)�str�__hash__�rrrrr
szBadStr.__hash__N)�__name__�
__module__�__qualname__r	r
rrrrrsrc@�eZdZdd�ZdS)�
FunctionCallscCs^t�ddg�}|�d�t|���}dd�}|di|��}|�|t�|�t|���|�dS)N)�a�)�b�rc[�|S�Nr)�kwrrr�fnr
z+FunctionCalls.test_kwargs_order.<locals>.fnr)�collections�OrderedDict�move_to_end�list�items�assertIsInstance�dict�assertEqual)r�od�expectedr�resrrr�test_kwargs_orders
zFunctionCalls.test_kwargs_orderN)rrrr'rrrrrsrc@s$eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGS)H�CFunctionCallsErrorMessagescCsd}|�t|ij�dS)Nz7__contains__\(\) takes exactly one argument \(0 given\)��assertRaisesRegex�	TypeError�__contains__�r�msgrrr�
test_varargs0)�z)CFunctionCallsErrorMessages.test_varargs0cC�d}|�t|ijdd�dS)Nz7__contains__\(\) takes exactly one argument \(2 given\)rrr)r-rrr�
test_varargs2-�z)CFunctionCallsErrorMessages.test_varargs2cCsd}|�t|tjddd�dS)Nz@^from_bytes\(\) takes exactly 2 positional arguments \(3 given\)�a�littleF)r*r+�int�
from_bytesr-rrr�
test_varargs31�z)CFunctionCallsErrorMessages.test_varargs3cCs,d}|�t|ij�d}|�t|ij�dS)Nz'get expected at least 1 argument, got 0zexpected 1 argument, got 0)r*r+�get�__delattr__r-rrr�test_varargs1min5sz,CFunctionCallsErrorMessages.test_varargs1mincCsd}|�t|t�dS)Nz,getattr expected at least 2 arguments, got 0�r*r+�getattrr-rrr�test_varargs2min<sz,CFunctionCallsErrorMessages.test_varargs2mincCsd}|�t|tdd�dS)Nz(input expected at most 1 argument, got 2rr)r*r+�inputr-rrr�test_varargs1max@�z,CFunctionCallsErrorMessages.test_varargs1maxcCsd}|�t|ijddd�dS)Nz'get expected at most 2 arguments, got 3rrr)r*r+r:r-rrr�test_varargs2maxDr9z,CFunctionCallsErrorMessages.test_varargs2maxcC�d}|jt|ijdd�dS)N�+__contains__\(\) takes no keyword argumentsr��xr)r-rrr�test_varargs1_kwHr3z,CFunctionCallsErrorMessages.test_varargs1_kwcC�d}|jt|ijddd�dS)NrEr�rG�yr)r-rrr�test_varargs2_kwLr9z,CFunctionCallsErrorMessages.test_varargs2_kwcC�d}|jt|tdd�dS)Nz#bool\(\) takes no keyword argumentsrrF)r*r+�boolr-rrr�test_varargs3_kwPrBz,CFunctionCallsErrorMessages.test_varargs3_kwcC�d}|jt|gjdd�dS)Nz-^list[.]index\(\) takes no keyword arguments$rrF)r*r+�indexr-rrr�test_varargs4_kwTr3z,CFunctionCallsErrorMessages.test_varargs4_kwcCrM)Nz(^hasattr\(\) takes no keyword arguments$rrF)r*r+�hasattrr-rrr�test_varargs5_kwXrBz,CFunctionCallsErrorMessages.test_varargs5_kwcCrM)Nz(^getattr\(\) takes no keyword arguments$rrFr=r-rrr�test_varargs6_kw\rBz,CFunctionCallsErrorMessages.test_varargs6_kwcCrM)Nz%^next\(\) takes no keyword arguments$rrF)r*r+�nextr-rrr�test_varargs7_kw`rBz,CFunctionCallsErrorMessages.test_varargs7_kwcC�d}|jt|tjdd�dS)Nz/^_struct[.]pack\(\) takes no keyword arguments$rrF)r*r+�struct�packr-rrr�test_varargs8_kwdr3z,CFunctionCallsErrorMessages.test_varargs8_kwcCrX)Nz4^_struct[.]pack_into\(\) takes no keyword arguments$rrF)r*r+rY�	pack_intor-rrr�test_varargs9_kwhr3z,CFunctionCallsErrorMessages.test_varargs9_kwcCs d}|jt|t��jdd�dS)Nz.^deque[.]index\(\) takes no keyword arguments$rrF)r*r+r�dequerQr-rrr�test_varargs10_kwlsz-CFunctionCallsErrorMessages.test_varargs10_kwcCs&d}|jt|tjjt�d�dd�dS)Nz.^Struct[.]pack\(\) takes no keyword arguments$�rrF)r*r+rY�StructrZr-rrr�test_varargs11_kwps"z-CFunctionCallsErrorMessages.test_varargs11_kwcC�d}|jt|ttd�dS)Nz-^staticmethod\(\) takes no keyword arguments$��func)r*r+�staticmethod�idr-rrr�test_varargs12_kwtrBz-CFunctionCallsErrorMessages.test_varargs12_kwcCrc)Nz,^classmethod\(\) takes no keyword arguments$rd)r*r+�classmethodrgr-rrr�test_varargs13_kwxrBz-CFunctionCallsErrorMessages.test_varargs13_kwcCs d}|jt|tjdddd�dS)Nz:^product\(\) takes at most 1 keyword argument \(2 given\)$rrr)�repeat�foo)r*r+�	itertools�productr-rrr�test_varargs14_kw|�

�z-CFunctionCallsErrorMessages.test_varargs14_kwc	C� d}|jt|tddddd�dS)Nz?^ImportError\(\) takes at most 2 keyword arguments \(3 given\)$rrrr)�name�pathrl)r*r+�ImportErrorr-rrr�test_varargs15_kw�rpz-CFunctionCallsErrorMessages.test_varargs15_kwc	Crq)Nz7^min\(\) takes at most 2 keyword arguments \(3 given\)$rrrr)�default�keyrl)r*r+�minr-rrr�test_varargs16_kw�rpz-CFunctionCallsErrorMessages.test_varargs16_kwcCs$d}|jt|tddddddd�	dS)	Nz9^print\(\) takes at most 4 keyword arguments \(5 given\)$rrrr��)�sep�end�file�flushrl)r*r+�printr-rrr�test_varargs17_kw�s
�z-CFunctionCallsErrorMessages.test_varargs17_kwcCsLd}|�t|��tditd�di��Wd�dS1swYdS)Nz'invalid keyword argument for print\(\)$rrrl�,)rr)r*r+r�rr-rrr�test_varargs18_kw��"�z-CFunctionCallsErrorMessages.test_varargs18_kwcCsLd}|�t|��tditd�di��Wd�dS1swYdS)Nz'invalid keyword argument for round\(\)$��?rlr)r�)r*r+�roundrr-rrr�test_varargs19_kw�r�z-CFunctionCallsErrorMessages.test_varargs19_kwcCsd}|�t|ijd�dS)Nz'keys\(\) takes no arguments \(1 given\)r�r*r+�keysr-rrr�test_oldargs0_1�rBz+CFunctionCallsErrorMessages.test_oldargs0_1cCr1)Nz'keys\(\) takes no arguments \(2 given\)rrr�r-rrr�test_oldargs0_2�r3z+CFunctionCallsErrorMessages.test_oldargs0_2cCrD)N�#keys\(\) takes no keyword argumentsrrFr�r-rrr�test_oldargs0_1_kw�r3z.CFunctionCallsErrorMessages.test_oldargs0_1_kwcCrI)Nr�rrJr�r-rrr�test_oldargs0_2_kw�r9z.CFunctionCallsErrorMessages.test_oldargs0_2_kwcCsd}|�t|gj�dS)Nz0count\(\) takes exactly one argument \(0 given\)�r*r+�countr-rrr�test_oldargs1_0�r0z+CFunctionCallsErrorMessages.test_oldargs1_0cCsd}|�t|gjdd�dS)Nz0count\(\) takes exactly one argument \(2 given\)rrr�r-rrr�test_oldargs1_2�r3z+CFunctionCallsErrorMessages.test_oldargs1_2cCrP�N�$count\(\) takes no keyword argumentsrrFr�r-rrr�test_oldargs1_0_kw�r3z.CFunctionCallsErrorMessages.test_oldargs1_0_kwcCsd}|jt|gjidd�dSr�r�r-rrr�test_oldargs1_1_kw�r9z.CFunctionCallsErrorMessages.test_oldargs1_1_kwcCsd}|jt|gjddd�dS)Nr�rrJr�r-rrr�test_oldargs1_2_kw�r9z.CFunctionCallsErrorMessages.test_oldargs1_2_kwN)&rrrr/r2r8r<r?rArCrHrLrOrRrTrUrWr[r]r_rbrhrjroruryr�r�r�r�r�r�r�r�r�r�r�r�rrrrr(&sHr(c@s�eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zd.d/�Zd0d1�Zd2S)3�TestCallingConventionsa�Test calling using various C calling conventions (METH_*) from Python

    Subclasses test several kinds of functions (module-level, methods,
    class methods static methods) using these attributes:
      obj: the object that contains tested functions (as attributes)
      expected_self: expected "self" argument to the C function

    The base class tests module-level functions.
    cCst|_|_dSr)�	_testcapi�obj�
expected_selfrrrr�setUp�szTestCallingConventions.setUpcC�"|�|j�ddd�|jdf�dS�Nrrr�rrr�r#r��meth_varargsr�rrrr�test_varargs���z#TestCallingConventions.test_varargscC�|�|jjd�|jdf�dS�Nr�r�rrrr�test_varargs_ext��
�z'TestCallingConventions.test_varargs_extc�d}��t|�fdd��dS)Nz+meth_varargs\(\) takes no keyword argumentsc��jjdd�S�Nr)�k)r�r�rrrr�<lambda>��z>TestCallingConventions.test_varargs_error_kw.<locals>.<lambda>�r*r+r-rrr�test_varargs_error_kw���z,TestCallingConventions.test_varargs_error_kwcC�.|�|jjddddd�|jdddd�f�dS�Nrrrrz�rr�rr�r#r��meth_varargs_keywordsr�rrrr�test_varargs_keywords���z,TestCallingConventions.test_varargs_keywordscCs6|�|jjddgiddd���|jdddd�f�dSr�r�rrrr�test_varargs_keywords_ext�s�z0TestCallingConventions.test_varargs_keywords_extcCs|�|j�d�|jdf�dS�Nr�r#r��meth_or�rrrr�test_o�szTestCallingConventions.test_ocCs |�|jjdg�|jdf�dSr�r�rrrr�
test_o_ext�s z!TestCallingConventions.test_o_extcCsd}|�t||jj�dS)Nz1meth_o\(\) takes exactly one argument \(0 given\))r*r+r�r�r-rrr�test_o_error_no_arg�rBz*TestCallingConventions.test_o_error_no_argcr�)Nz1meth_o\(\) takes exactly one argument \(2 given\)c��j�dd�S�Nrr�r�r�rrrrr��r�z>TestCallingConventions.test_o_error_two_args.<locals>.<lambda>r�r-rrr�test_o_error_two_args�r�z,TestCallingConventions.test_o_error_two_argscr�)Nz1meth_o\(\) takes exactly one argument \(3 given\)c��jjd�Sr�r�rrrrr��z9TestCallingConventions.test_o_error_ext.<locals>.<lambda>r�r-rrr�test_o_error_ext�r�z'TestCallingConventions.test_o_error_extcr�)N�%meth_o\(\) takes no keyword argumentscr�r�r�rrrrr�r�z8TestCallingConventions.test_o_error_kw.<locals>.<lambda>r�r-rrr�test_o_error_kwr�z&TestCallingConventions.test_o_error_kwcr�)Nr�cr�r�r�rrrrr�
r�z<TestCallingConventions.test_o_error_arg_kw.<locals>.<lambda>r�r-rrr�test_o_error_arg_kw
r�z*TestCallingConventions.test_o_error_arg_kwcCs|�|j��|j�dSr�r#r��meth_noargsr�rrrr�test_noargssz"TestCallingConventions.test_noargscCs|�|jjg�|j�dSrr�rrrr�test_noargs_extsz&TestCallingConventions.test_noargs_extcr�)Nz.meth_noargs\(\) takes no arguments \(1 given\)cs�j�d�Sr��r�r�rrrrr�r�z>TestCallingConventions.test_noargs_error_arg.<locals>.<lambda>r�r-rrr�test_noargs_error_argr�z,TestCallingConventions.test_noargs_error_argcr�)Nz.meth_noargs\(\) takes no arguments \(2 given\)cr�r�r�rrrrr�r�z?TestCallingConventions.test_noargs_error_arg2.<locals>.<lambda>r�r-rrr�test_noargs_error_arg2r�z-TestCallingConventions.test_noargs_error_arg2cr�)Nz.meth_noargs\(\) takes no arguments \(3 given\)cr�r�r�rrrrr�%r�z>TestCallingConventions.test_noargs_error_ext.<locals>.<lambda>r�r-rrr�test_noargs_error_ext"r�z,TestCallingConventions.test_noargs_error_extcr�)Nz*meth_noargs\(\) takes no keyword argumentscr�r�r�rrrrr�+r�z=TestCallingConventions.test_noargs_error_kw.<locals>.<lambda>r�r-rrr�test_noargs_error_kw(r�z+TestCallingConventions.test_noargs_error_kwcCr�r��r#r��
meth_fastcallr�rrrr�
test_fastcall.r�z$TestCallingConventions.test_fastcallcCr�r�r�rrrr�test_fastcall_ext4r�z(TestCallingConventions.test_fastcall_extcr�)Nz,meth_fastcall\(\) takes no keyword argumentscr�r�)r�r�rrrrr�=r�z?TestCallingConventions.test_fastcall_error_kw.<locals>.<lambda>r�r-rrr�test_fastcall_error_kw:r�z-TestCallingConventions.test_fastcall_error_kwcCr�r��r#r��meth_fastcall_keywordsr�rrrr�test_fastcall_keywords@r�z-TestCallingConventions.test_fastcall_keywordscCs2|�|jjdiddd���|jdddd�f�dS)Nr�rrzr�r�rrrr�test_fastcall_keywords_extFs�z1TestCallingConventions.test_fastcall_keywords_extN)rrr�__doc__r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr��s4
r�c@�eZdZdZdd�ZdS)�TestCallingConventionsInstancez?Test calling instance methods using various calling conventionscCst��|_|_dSr)r��MethInstancer�r�rrrrr�Psz$TestCallingConventionsInstance.setUpN�rrrr�r�rrrrr�M�r�c@r�)�TestCallingConventionsClassz<Test calling class methods using various calling conventionscCstj|_|_dSr�r��	MethClassr�r�rrrrr�Wsz!TestCallingConventionsClass.setUpNr�rrrrr�Tr�r�c@r�)�#TestCallingConventionsClassInstancez&Test calling class methods on instancecCst��|_tj|_dSrr�rrrrr�^s
z)TestCallingConventionsClassInstance.setUpNr�rrrrr�[r�r�c@r�)�TestCallingConventionsStaticz=Test calling static methods using various calling conventionscCst��|_d|_dSr)r��
MethStaticr�r�rrrrr�fs

z"TestCallingConventionsStatic.setUpNr�rrrrr�cr�r�cCs||gSrr��arg1�arg2rrr�pyfunck�r�cCr�N�noargrrrrr�pyfunc_noargor
r�c@s4eZdZdd�Zdd�Zedd��Zedd��Zd	S)
�PythonClasscCs||gSrr)rr�r�rrr�methodtr�zPythonClass.methodcCrr�rrrrr�method_noargwr
zPythonClass.method_noargcCr)Nrir)�clsrrr�class_methodz�zPythonClass.class_methodcCr)Nrfrrrrr�
static_method~r�zPythonClass.static_methodN)	rrrr�r�rir�rfr�rrrrr�ss
r�c@s6eZdZdZedddgfeddfejddfejddfe	j
dddgfe	jddfe	jddfe	jddfgZed	d
diddgfedddd�ddgfe	j
d	d
diddgfe	j
dddd�ddgfgZ
e��Zeefeefejejfe��ejfejdffD]�\ZZe�ejdedffejdedeffejdedffejdedffejdedeffejdedeffejdefejd
edffg�e
�ejdddiedddiffejdddiedddiffejdiedeffejdddiedddiffejdddiedddiffejdiedeffg�qwdd�Zdd�Zdd�Zdd�Z dd�Z!dS)�
FastCallTestsz0Test calling using various callables from C
    r�rrrr�rirf)rr�r�N)�{r�rGrKcCsPt|t�r |dtur |didfvr g|dd��|d�R}|�||�dS)N���)�
isinstance�tuple�
NULL_OR_EMPTYr#)r�resultr%rrr�check_result�szFastCallTests.check_resultc	Csx|jD]6\}}}|j||d��"t�||�}|�||�|s*t�|d�}|�||�Wd�n1s4wYqdS)N�re�args)�
CALLS_POSARGS�subTestr��pyobject_fastcallr�)rrerr%r�rrrr��s����zFastCallTests.test_fastcallc	Cs�|jD]8\}}}|j||d��$t�||d�}|�||�|s,t�|dd�}|�||�Wd�n1s6wYq|jD]+\}}}}|j|||d��t�|||�}|�||�Wd�n1sewYq?dS)Nr��rer�kwargs)rrr��pyobject_fastcalldictr��CALLS_KWARGS)rrerr%r�rrrr�test_vectorcall_dict�s"���
���z"FastCallTests.test_vectorcall_dictc	Cs*|jD]R\}}}|j||d��>t�||d�}|�||�t�||d�}|�||�|sFt�|dd�}|�||�t�|dd�}|�||�Wd�n1sPwYq|jD]9\}}}}|j|||d��#t|���}|t|���}t�|||�}|�||�Wd�n1s�wYqYdS)Nr�rr)	rrr��pyobject_vectorcallr�rr�r��values)rrerr%r�r�kwnamesrrr�test_vectorcall�s.������zFastCallTests.test_vectorcallcCs6Gdd�d�}||�d�}tddd|fi|j��dS)Nc@s"eZdZdgZdd�Zdd�ZdS)z>FastCallTests.test_fastcall_clearing_dict.<locals>.IntWithDictrc[s
||_dSr)r)rrrrr�__init__s
zGFastCallTests.test_fastcall_clearing_dict.<locals>.IntWithDict.__init__cSs|j��t��dS)Nr)r�clear�gc�collectrrrr�	__index__!s
zHFastCallTests.test_fastcall_clearing_dict.<locals>.IntWithDict.__index__N)rrr�	__slots__r
rrrrr�IntWithDictsr)�optimize�passr`�exec)�compiler)rrrGrrr�test_fastcall_clearing_dictsz)FastCallTests.test_fastcall_clearing_dict)"rrrr�r�r�r�r�r��PYTHON_INSTANCEr�r�rrr�r��	_instancer�r�r�r��extendr�r�r�r�r�r�r�r�r�rrrrrrrr��s�




��
�
�
�
�
��������
r�iicCr�zsome docrrrrr�testfunction0r�rcCrrr)rrrrr�testfunction_kw5r�rc@s,eZdZdd�Zdd�Zdd�Zdd�Zd	S)
�
TestPEP590cCs�ddl}|�d�t�}|�tt�jt@�|�tt	j
�jt@�|�tt	j�jt@�|�tt�jt@�|�t|�jt@�|�tj
jt@�|�tjjt@�|�tjjt@�Gdd�dtj
�}|�|jt@�dS)Nrrc@�eZdZdS)zDTestPEP590.test_method_descriptor_flag.<locals>.MethodDescriptorHeapN�rrrrrrr�MethodDescriptorHeapK�r")�	functools�	lru_cacher�assertFalse�type�repr�	__flags__�Py_TPFLAGS_METHOD_DESCRIPTOR�
assertTruer�append�__add__r��MethodDescriptorBase�MethodDescriptorDerived�MethodDescriptorNopGet)rr$�cachedr"rrr�test_method_descriptor_flag<sz&TestPEP590.test_method_descriptor_flagcCsn|�tjjt@�|�tjjt@�|�tjjt@�|�tjjt@�Gdd�dtj�}|�|jt@�dS)Nc@r )z=TestPEP590.test_vectorcall_flag.<locals>.MethodDescriptorHeapNr!rrrrr"Vr#r")	r+r�r.r)�Py_TPFLAGS_HAVE_VECTORCALLr/r&r0�MethodDescriptor2)rr"rrr�test_vectorcall_flagOszTestPEP590.test_vectorcall_flagcCs(ttd��}t��}|�||�|�dS)Nr{)r��ranger�r0�assertIs)rr�frrr�test_vectorcall_overrideZsz#TestPEP590.test_vectorcall_overridecs�ttd�fidftjgdfidfgjdidftdgfddidftdidftdddidft��did	ft�	�did	ft�
�did
fg	}ddlm�m}ddl
m}dd
lm}�fdd�}|D]2\}}}}	|�t|���|sw|�|	|||��|�|	||||��Wd�n1s�wYq^Gdd�dtj�}
Gdd�dtj�}Gdd�d�}Gdd�d|tj�}
|tjifdd	idfijifdd	idf|
�did	f|�didf|
�did	fg7}|D]\}}}}	|�t|���i|dd�}|||d�}||�}|�s"|�|	||��|�|	�||d��|�|	||��|�|	||��|�|	||i|���|�|	||||��|�|	||i|���|�|	||i|���Wd�n	1�sXwYq�dS)N�*r)r�$�start�)r:rTF)r	�pyvectorcall_call)�
MethodType)�partialcs&g|�|���R}t|�}�|||�Sr)r
r�)rerrr�r	rr�
vectorcall|sz.TestPEP590.test_vectorcall.<locals>.vectorcallc@r )z8TestPEP590.test_vectorcall.<locals>.MethodDescriptorHeapNr!rrrrr"�r#r"c@r)z>TestPEP590.test_vectorcall.<locals>.MethodDescriptorOverriddencSr)N�newr)r�nrrr�__call__�r
zGTestPEP590.test_vectorcall.<locals>.MethodDescriptorOverridden.__call__N)rrrrErrrr�MethodDescriptorOverridden�srFc�eZdZ�fdd�Z�ZS)z-TestPEP590.test_vectorcall.<locals>.SuperBasec�t�j|�Sr��superrE�rr��	__class__rrrE��z6TestPEP590.test_vectorcall.<locals>.SuperBase.__call__�rrrrE�
__classcell__rrrLr�	SuperBase��rQcrG)z9TestPEP590.test_vectorcall.<locals>.MethodDescriptorSupercrHrrIrKrLrrrE�rNzBTestPEP590.test_vectorcall.<locals>.MethodDescriptorSuper.__call__rOrrrLr�MethodDescriptorSuper�rRrSrwrCr)�lenr6rr,�sumrrr�r.r/r4r	r>�typesr?r$r@rrr#r"�update)r�callsr>r?r@rBrerrr%r"rFrQrS�args1�meth�wrappedrrArrdsb

�
������zTestPEP590.test_vectorcallN)rrrr2r5r9rrrrrr:s

rc@s,eZdZdd�Zedd��Zedd��ZdS)�AcC�dSrr)rrGrKrrr�method_two_args�r
zA.method_two_argscCr]rrrrrr�static_no_args�r�zA.static_no_argscCr]rr��argrrr�positional_only�r�zA.positional_onlyN)rrrr^rfr_rbrrrrr\�s
r\c@sBeZdZejdd��Zdd�Zdd�Zdd�Zd	d
�Z	dd�Z
d
S)�!TestErrorMessagesUseQualifiedNameccsH�|�t��}dVWd�n1swY|�t|j�|�dSr)�assertRaisesr+r#r�	exception)r�message�cmrrr�check_raises_type_error�s
��z9TestErrorMessagesUseQualifiedName.check_raises_type_errorcCs@d}|�|��t��d�Wd�dS1swYdS)Nz?A.method_two_args() missing 1 required positional argument: 'y'rG�rhr\r^r-rrr�test_missing_arguments��"�z8TestErrorMessagesUseQualifiedName.test_missing_argumentscCs>d}|�|��t�d�Wd�dS1swYdS)Nz?A.static_no_args() takes 0 positional arguments but 1 was givenzoops it's an arg)rhr\r_r-rrr�test_too_many_positional�s"�z:TestErrorMessagesUseQualifiedName.test_too_many_positionalcCs@d}|�|��tjdd�Wd�dS1swYdS)NzYA.positional_only() got some positional-only arguments passed as keyword arguments: 'arg'rGr`)rhr\rbr-rrr�&test_positional_only_passed_as_keyword�rkzHTestErrorMessagesUseQualifiedName.test_positional_only_passed_as_keywordcCsBd}|�|��t�jdd�Wd�dS1swYdS)Nz<A.method_two_args() got an unexpected keyword argument 'bad'rG)�badrir-rrr�test_unexpected_keyword�s"�z9TestErrorMessagesUseQualifiedName.test_unexpected_keywordcCsFd}|�|��t�jdddd�Wd�dS1swYdS)Nz8A.method_two_args() got multiple values for argument 'x'rGrK�oopsrFrir-rrr�test_multiple_values�s"�z6TestErrorMessagesUseQualifiedName.test_multiple_valuesN)rrr�
contextlib�contextmanagerrhrjrlrmrorqrrrrrc�s
rc�__main__)$�unittest�test.supportrr�rtrYrrmrrrrr�TestCaserr(r�r�r�r�r�r�r�r�r�objectr�r�r3r*rrrr\rcr�mainrrrr�<module>sR�&w"�

Youez - 2016 - github.com/yon3zu
LinuXploit