403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.9/site-packages/_pytest/assertion/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/_pytest/assertion/__pycache__/util.cpython-39.pyc
a

05dYF�@s&UdZddlZddlZddlZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lmZdd
lm
Z
ddlmZddlZddlmZdd
lmZddlmZddlmZddlmZdZeeeeegeefed<dZeeeeegdfed<dZeeed<eed�dd�Z ee
ed�dd�Z!e
ee
ed�dd�Z"ee#d�dd�Z$ee#d�dd �Z%ee#d�d!d"�Z&ee#d�d#d$�Z'ee#d%�d&d'�Z(ee#d%�d(d)�Z)ee#d%�d*d+�Z*ee#d%�d,d-�Z+ee#d%�d.d/�Z,dKeeee#ee
ed1�d2d3�Z-dLeeee
ed4�d5d6�Z.dMeeee
ed4�d7d8�Z/e
edd�d9d:�Z0dNe	ee	eee
ed4�d;d<�Z1dOe
ee
eee
ed4�d=d>�Z2dPeeeeee
ed4�d?d@�Z3dQeeefeeefee
ed4�dAdB�Z4eeee
ed4�dCdD�Z5dReeee
edE�dFdG�Z6e#dH�dIdJ�Z7dS)Sz"Utilities for assertion debugging.�N)�AbstractSet)�Any)�Callable)�Iterable)�List)�Mapping)�Optional)�Sequence)�	normalize)�outcomes)�_pformat_dispatch)�saferepr)�saferepr_unlimited)�Config�_reprcompare�_assertion_pass�_config)�explanation�returncCst|�}t|�}d�|�S)a�Format an explanation.

    Normally all embedded newlines are escaped, however there are
    three exceptions: \n{, \n} and \n~.  The first two are intended
    cover nested explanations, see function and attribute explanations
    for examples (.visit_Call(), visit_Attribute()).  The last one is
    for when one explanation needs to span multiple lines, e.g. when
    displaying diffs.
    �
)�_split_explanation�
_format_lines�join)r�lines�result�r�:/usr/lib/python3.9/site-packages/_pytest/assertion/util.py�format_explanation$s
rcCs^|pd�d�}|dg}|dd�D]4}|rD|ddvrD|�|�q$|dd|7<q$|S)	z�Return a list of individual lines in the explanation.

    This will return a list of lines split on '\n{', '\n}' and '\n~'.
    Any other newlines will be escaped and appear in the line as the
    literal '\n' characters.
    �rr�N)�{�}�~�>���z\n)�split�append)rZ	raw_linesr�valuesrrrr3s
r)rrcCsHt|dd��}dg}dg}|dd�D�]}|�d�r�|drFd}nd}|�t|��|dd7<|�d�|�dd	t|�d||dd��q(|�d
�r�|��|��||d|dd�7<q(|ddvs�J�|dd7<|�d��r
t|�n
t|�d}|�d	||dd��q(t|�dk�sDJ�|S)
aFormat the individual lines.

    This will replace the '{', '}' and '~' characters of our mini formatting
    language with the proper 'where ...', 'and ...' and ' + ...' text, taking
    care of indentation along the way.

    Return a list of formatted lines.
    Nrrr r$zand   zwhere z +�  r!)r"r#r")�list�
startswithr&�len�pop)rr�stackZstackcnt�line�s�indentrrrrDs,	

,
 r)�xrcCst|tjj�ot|t�S�N)�
isinstance�collections�abcr	�str�r1rrr�
issequencegsr8cCs
t|t�Sr2)r3r6r7rrr�istextksr9cCs
t|t�Sr2)r3�dictr7rrr�isdictosr;cCst|ttf�Sr2)r3�set�	frozensetr7rrr�issetssr>)�objrcCst|t�ot|dd�duS)N�_fields)r3�tuple�getattr�r?rrr�isnamedtuplewsrDcCst|dd�duS)NZ__dataclass_fields__�rBrCrrr�	isdatacls{srFcCst|dd�duS)N�__attrs_attrs__rErCrrr�isattrssrHcCs.zt|�t|�WSty(YdS0dS)NF)�iterr9�	TypeErrorrCrrr�
isiterable�s
rKcCs@t|jd�r<t|jjd�r<|jjj}t|�r4d|vS|dkSdS)a�Check if an instance of an object contains the default eq

    First, we check if the object's __eq__ attribute has __code__,
    if so, we check the equally of the method code filename (__code__.co_filename)
    to the default one generated by the dataclass and attr module
    for dataclasses the default co_filename is <string>, for attrs class, the __eq__ should contain "attrs eq generated"
    �__code__�co_filenamezattrs generated eqz<string>T)�hasattr�__eq__rLrMrH)r?Z
code_filenamerrr�has_default_eq�s
rPF)�op�left�right�	use_asciircCs2|�d�}t|t�o0t|t�o0td|�td|�k}|dkrTt||d�}t||d�}n0dt|�dd}t|||d�}t|||d�}|�d|�d|��}	d	}
z>|d
kr�t|||�}
n$|dkr�t|�r�t|�r�t	|||�}
WnBt
jy��Yn.t�yd�
tjj�����d
g}
Yn0|
�s(d	S|	g|
S)z<Return specialised explanations for some operators/operands.�verboseZNFDr)rT�A�)�maxsizerT� Nz==znot inz?(pytest_assertion plugin: representation of details failed: {}.z+ Probably an object has a faulty __repr__.))Z	getoptionr3r6r
rr+r
�_compare_eq_anyr9�_notin_textrZExit�	Exception�format�_pytest�_codeZ
ExceptionInfoZfrom_currentZ
_getreprcrash)ZconfigrQrRrSrTrUZ	left_reprZ
right_reprrXZsummaryrrrr�assertrepr_compare�sB

�����
r`)rRrSrUrcCs4g}t|�r$t|�r$t|||�}�nddlm}t||�sDt||�rtt||�rR|n|}t||�rd|n|}|�|�}n�t|�t|�kr�t|�s�t|�s�t	|�r�t
|||�}n\t|�r�t|�r�t|||�}n>t
|�r�t
|�r�t|||�}n t|��rt|��rt|||�}t|��r0t|��r0t|||�}|�|�|S)Nr)�
ApproxBase)r9�
_diff_textZ_pytest.python_apirar3Z
_repr_compare�typerFrHrD�_compare_eq_clsr8�_compare_eq_sequencer>�_compare_eq_setr;�_compare_eq_dictrK�_compare_eq_iterable�extend)rRrSrUrraZapprox_sideZ
other_sideZexplrrrrZ�s4���
rZcCsVddlm}g}|dkr�d}ttt|�t|���D]}||||kr2qLq2|dkr~|d8}d|g}||d�}||d�}t|�t|�kr�tt|��D]}||||kr�q�q�|dkr�|d8}|d�|�g7}|d|�}|d|�}d	}|���s|���r.tt|��}tt|��}|d
g7}|dd�||�	|�|�	|��D�7}|S)
z�Return the explanation for the diff between text.

    Unless --verbose is used this will skip leading and trailing
    characters which are identical to keep the diff minimal.
    r)�ndiffr�*�
z@Skipping %s identical leading characters in diff, use -v to showNzASkipping {} identical trailing characters in diff, use -v to showTz;Strings contain only whitespace, escaping them using repr()cSsg|]}|�d��qS)r)�strip��.0r.rrr�
<listcomp> s�z_diff_text.<locals>.<listcomp>)
�difflibrj�range�minr+r]�isspace�reprr6�
splitlines)rRrSrUrjr�i�keependsrrrrb�sF���
�rbcCs�|ddd�}|dvrBd|ddd�|d<|g||dd�<|ddd�}|dvr�|ddd�d|d<||g|dd�<dS)	z6Move opening/closing parenthesis/bracket to own lines.rNr)�(�[r rYr$)�)�]r!�,r)rZopening�closingrrr� _surrounding_parens_on_own_lines'src	Cs�|dkrt�sdgSddl}t�|���}t�|���}t|�}t|�}||krht|���}t|���}|dksx|dkr�t|�t|�dg}|�dd�|�	||�D��|S)NrzUse -v to get more diffrz
Full diff:css|]}|��VqdSr2)�rstriprnrrr�	<genexpr>Lsz'_compare_eq_iterable.<locals>.<genexpr>)
�
running_on_cirq�pprint�pformatrvr+rrrirj)	rRrSrUrqZleft_formattingZright_formattingZ
lines_leftZlines_rightrrrrrh3s$

�rhc
Cs"t|t�ot|t�}g}t|�}t|�}tt||��D]j}||||kr6|rp|||d�}|||d�}	n||}||}	|d|�d|�d|	��g7}q�q6|r�|S||}
|
�r|
dkr�d}t||�}nd|
}
d}t||�}|
dk�r
||�d|��g7}n|d	||
|fg7}|S)
Nrz	At index z diff: � != rZLeftZRightz contains one more item: z/%s contains %d more items, first extra item: %s)r3�bytesr+rrrsr
)
rRrSrUZcomparing_bytesrZlen_leftZ	len_rightrwZ
left_valueZright_valueZlen_diffZ
dir_with_moreZextrarrrreRs>	
��recCsdg}||}||}|r:|�d�|D]}|�t|��q&|r`|�d�|D]}|�t|��qL|S)NzExtra items in the left set:zExtra items in the right set:)r&r
)rRrSrUrZ	diff_leftZ
diff_right�itemrrrrf�s

rfcszg}t��}t��}|�|�}��fdd�|D�}|rR|dkrR|dt|�g7}n |rr|dg7}|t�|���7}��fdd�|D�}|r�|dg7}|D].}	|t|	�|	i�d	t|	�|	i�g7}q�||}
t|
�}|�r|�d
||dkr�dnd
f�|�t��fdd�|
D�����||}t|�}
|
�rv|�d|
|
dk�rJdnd
f�|�t��fdd�|D�����|S)Ncs&i|]}�|�|kr|�|�qSrr�ro�k�rRrSrr�
<dictcomp>��z$_compare_eq_dict.<locals>.<dictcomp>rW�,Omitting %s identical items, use -vv to showz
Common items:cs h|]}�|�|kr|�qSrrr�r�rr�	<setcomp>�r�z#_compare_eq_dict.<locals>.<setcomp>zDiffering items:r�zLeft contains %d more item%s:rrr/csi|]}|�|�qSrrr�)rRrrr��r�zRight contains %d more item%s:csi|]}|�|�qSrrr�)rSrrr��r�)	r<�intersectionr+r�r�rvr
r&ri)rRrSrUrZset_leftZ	set_right�common�same�diffr�Z
extra_leftZlen_extra_leftZextra_rightZlen_extra_rightrr�rrg�sL


,������rgc	s�t|�sgSt|�r6ddl}|�|�}dd�|D�}n6t|�rT|j}dd�|D�}nt|�rd|j}ndslJ�d�g}g}|D].}t||�t||�kr�|�	|�q||�	|�q|g}	|s�|r�|	dg7}	|r�|dkr�|	�	d	t
|��n"|�r|	d
g7}	|	t�|��
�7}	|�r�|	dg7}	|	t�|��
�7}	|D]V}t||�}
t||�}|	dd|d
�||
|fg7}	|	�fdd�t|
||�D�7}	�q*|	S)NrcSsg|]}|jr|j�qSr)Zcompare�name)ro�inforrrrp�r�z#_compare_eq_cls.<locals>.<listcomp>cSsg|]}t|d�r|j�qS)�eq)rBr�)ro�fieldrrrrp�r�Fr(rrWr�zMatching attributes:zDiffering attributes:z'Drill down into differing attribute %s:z%s%s: %r != %rcsg|]}�|�qSrrrn�r0rrrp�s�)rPrF�dataclasses�fieldsrHrGrDr@rBr&r+r�r�rvrZ)rRrSrUr�Z
all_fieldsZfields_to_checkr�r�r�rZ
field_leftZfield_rightrr�rrd�sT





�
�rd)�term�textrUrc
Cs�|�|�}|d|�}||t|�d�}||}t|||�}dt|dd�g}|D]H}	|	�d�rdqT|	�d�rpqT|	�d�r�|�d|	dd��qT|�|	�qT|S)	Nz%s is contained here:rk)rXZSkippingz- z+ r(rW)�findr+rbr
r*r&)
r�r�rU�index�head�tailZcorrect_textr�Znewdiffr.rrrr[�s



r[)rcCsddg}tdd�|D��S)z0Check if we're currently running on a CI system.ZCIZBUILD_NUMBERcss|]}|tjvVqdSr2)�os�environ)ro�varrrrr�
r�z running_on_ci.<locals>.<genexpr>)�any)Zenv_varsrrrr�sr�)F)r)r)r)r)r)r)r)8�__doc__�collections.abcr4r�r��typingrrrrrrrr	�unicodedatar
Z
_pytest._coder^rZ_pytest._io.safereprrr
rZ_pytest.configrrr6�object�__annotations__r�intrrrr�boolr8r9r;r>rDrFrHrKrPr`rZrbrrhrerfrgrdr[r�rrrr�<module>s�"#	��
�4#0
�� ��6����)3

Youez - 2016 - github.com/yon3zu
LinuXploit