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/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

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

05d\��@s�dZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlZddlZ ddl m!Z!ddl m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(ddl)m*Z*ddl+m,Z,ddl-m.Z.ddl/m0Z0ddl/m1Z1ddl/m2Z2dd l/m3Z3dd!l4m5Z5dd"l6m7Z7dd#l6m8Z8dd$l9m:Z:dd%l9m;Z;dd&l<m=Z=dd'l<m>Z>dd(l<m?Z?e�r2dd)l@mAZAdd*lBmCZCd+ZDd,ZEd-ZFGd.d/�d/ejG�ZHe5dd0�d1d2�ZIe1dd3�d4d5�ZJe1eKd3�d6d7�ZLe3d8d9�e=eeKeKeKfd:�d;d<��ZMejNGd=d>�d>��ZOe.Gd?d@�d@��ZPe(e1e=dA�dBdC�ZQeKeKeReeKdD�dEdF�ZSe1e=e(eeKeTfeKdG�dHdI�ZUe
ee>eeeReKeeReKfdJ�dKdL�ZVdMdMdNdOdP�ZWdNZXeReKeeReKfdQ�dRdS�ZYeeKdT�dUdV�ZZe[eKdW�dXdY�Z\e?eKd:�dZd[�Z]dS)\zsTerminal reporting of the full testing process.

This is a good source for looking at the various reporting hooks.
�N)�Counter)�partial)�Path)�Any)�Callable)�cast)�ClassVar)�Dict)�	Generator)�List)�Mapping)�Optional)�Sequence)�Set)�TextIO)�Tuple)�
TYPE_CHECKING)�Union)�nodes)�timing)�
ExceptionInfo)�
ExceptionRepr)�TerminalWriter)�wcswidth)�
running_on_ci)�final)�
_PluggyPlugin)�Config)�ExitCode)�hookimpl)�Parser)�Item)�Node)�absolutepath)�bestrelpath)�
BaseReport)�
CollectReport)�
TestReport)�Literal)�Sessiong�?)�failed�passed�skipped�
deselected�xfailed�xpassed�warnings�errorZfEcsheZdZdZd
eeeeeeedd��fdd�
Z	de
je
je
eeedfeedd�dd	�Z�ZS)�MoreQuietActionz�A modified copy of the argparse count action which counts down and updates
    the legacy quiet attribute at the same time.

    Used to unify verbosity handling.
    NF)�option_strings�dest�default�required�help�returncst�j||d|||d�dS)Nr)r3r4�nargsr5r6r7)�super�__init__)�selfr3r4r5r6r7��	__class__��4/usr/lib/python3.9/site-packages/_pytest/terminal.pyr;Ts�zMoreQuietAction.__init__)�parser�	namespace�values�
option_stringr8cCs6t||jd�d}t||j|�t|dd�d|_dS)Nr��quiet)�getattrr4�setattrrF)r<rArBrCrDZ	new_countr?r?r@�__call__eszMoreQuietAction.__call__)NFN)N)�__name__�
__module__�__qualname__�__doc__r�str�object�boolr
r;�argparse�ArgumentParser�	NamespacerrI�
__classcell__r?r?r=r@r2Ms(
����r2)rAr8c	Cs\|jdddd�}|jddddd	d
d�|jdd
dddd�|jdd
dddd�|jddtdd	dd�|jdd	tddd�|jdddtddd�|jd d!dd"d
d#d$�|jd%d&d
d'dd(d)�|jd*d+d'd,d-�|jd.d/dd0d1gd2�d3d4�|jd5dd6gd7�d8d9d:�|jd;d<d
dd=d>�|jd?d@dd@d1gdA�dBd4�|jdCdDdDdEgdFdG�|jdHdIdJdK�dS)LNzterminal reportingZ	ReportingZgeneral)Zafterz-vz	--verbose�countr�verbosezIncrease verbosity)�actionr5r4r7z--no-header�
store_trueF�	no_headerzDisable headerz--no-summary�
no_summaryzDisable summaryz-qz--quietzDecrease verbosityz--verbosityzSet verbosity. Default: 0.)r4�typer5r7z-r�store�reportchars�charsaShow extra test summary info as specified by chars: (f)ailed, (E)rror, (s)kipped, (x)failed, (X)passed, (p)assed, (P)assed with output, (a)ll except passed (p/P), or (A)ll. (w)arnings are enabled by default (see --disable-warnings), 'N' can be used to reset the list. (default: 'fE').)rWr4r5�metavarr7z--disable-warningsz--disable-pytest-warnings�disable_warningszDisable warnings summary)r5r4rWr7z-lz--showlocalsZ
showlocalsz/Show locals in tracebacks (disabled by default))rWr4r5r7z--no-showlocals�store_falsezFHide locals in tracebacks (negate --showlocals passed through addopts))rWr4r7z--tbZstyle�tbstyle�auto)rcZlongZshort�no�lineZnativez5Traceback print mode (auto/long/short/line/native/no))r_rWr4r5�choicesr7z--show-capture�showcapture)rd�stdout�stderr�log�allrkzOControls how captured stdout/stderr/log is shown on failed tests. Default: all.)rWr4rfr5r7z--fulltracez--full-tracez,Don't cut any tracebacks (default is to cut))rWr5r7z--color�color)�yesrdrcz#Color terminal output (yes/no/auto)z--code-highlightrmrdzSWhether code should be highlighted (only if --color is also enabled). Default: yes.)r5rfr7�console_output_stylez�Console output: "classic", or with additional progress information ("progress" (percentage) | "count" | "progress-even-when-capture-no" (forces progress even when capture=no)�progress)r7r5)ZgetgroupZ
_addoptionr2�int�_REPORTCHARS_DEFAULTZaddini)rA�groupr?r?r@�pytest_addoptionrs�����������	�	��	��rs��configr8csJt|tj��|j��d�|jjs*|jjrF�fdd�}|jj	�
d|�dS)N�terminalreportercs"d�tt|��}��d|�dS)N� z[traceconfig] )�join�maprN�
write_line)�tags�args�msg�Zreporterr?r@�mywriter�sz"pytest_configure.<locals>.mywriterz
pytest:config)�TerminalReporter�sysrh�
pluginmanager�register�option�debug�traceconfigZtrace�rootZsetprocessor)rurr?r~r@�pytest_configure�s
r�cCs�|jj}ddh}d}|D]N}||vr,|��}|dkr:d}q|dkrHd}q|dkrVd}q||vr||7}q|jjs�d	|vr�d	|}n|jjr�d	|vr�|�d	d�}|S)
N�F�S��aZsxXEf�AZPpsxXEf�N�w)r�r]�lowerr`�replace)rur]Zold_aliasesZ
reportopts�charr?r?r@�getreportopt�s&

r�T�Ztrylast��reportr8cCsHd}|jrd}n
|jrd}|j}|jdvr:|dkr:d}d}|||��fS)Nr��.�s)�collect�setup�teardownr*r1�E)r+r,�outcome�when�upper)r��letterr�r?r?r@�pytest_report_teststatussr�c@sbeZdZUdZeed<dZeeed<dZee	ee
fed<dZeed<e
eed�d	d
�ZdS)�
WarningReportaoSimple structure to hold warnings information captured by ``pytest_warning_recorded``.

    :ivar str message:
        User friendly message about the warning.
    :ivar str|None nodeid:
        nodeid that generated the warning (see ``get_location``).
    :ivar tuple fslocation:
        File system location of the source of the warning (see ``get_location``).
    �messageN�nodeid�
fslocationT�count_towards_summaryrtcCs@|jr|jS|jr<|j\}}t|jjt|��}|�d|��SdS)zSReturn the more user-friendly information about the location of a warning, or None.�:N)r�r�r$�invocation_params�dirr#)r<ru�filenameZlinenum�relpathr?r?r@�get_location5s
zWarningReport.get_location)rJrKrLrMrN�__annotations__r�r
r�rrpr�rrr�r?r?r?r@r�#s

r�c@s eZdZd�eeedd�dd�Zdd�dd�Zee	d�d	d
��Z
eed�dd��Zeed�d
d��Z
eed�dd��Zeed�dd��Zejeedd�dd��Zeed�dd��Zeed�dd�Zeedd�dd�Zd�eedd�dd �Zdd�d!d"�Zd#d$�eeedd%�d&d'�Zdd�d(d)�Zeeefedd*�d+d,�Zeedd*�d-d.�Zd�eeeee	edd/�d0d1�Zd�eeedd3�d4d5�Zeedd6�d7d8�Zee e!dd9�d:d;�Z"e#ed<�d=d>�Z$e%j&edd?�d@dA�Z'e(ddB�dCdD�Z)e e*ddE�dFdG�Z+ee,eee	efddH�dIdJ�Z-e.ddK�dLdM�Z/eed�dNdO��Z0eddP�dQdR�Z1ed�dSdT�Z2dd�dUdV�Z3ee	d�dWdX��Z4dd�dYdZ�Z5e6ddK�d[d\�Z7d�edd]�d^d_�Z8e9d`da�dbddc�ddde��Z:e eee efddf�dgdh�Z;ee<edi�djdk�Z=dbddc�dldm�Z>e e*ddE�dndo�Z?e9d`dp�dbee	e@fdq�drds��ZAe9d`dp�eBdtd�dudv��ZCeDeEddw�dxdy�ZFdd�dzd{�ZGdd�d|d}�ZHeeee	eed~�dd��ZId�d��ZJd�d��ZKed��d�d��ZLdd�d�d��ZMdd�d�d��ZNee<e.dP�d�d��ZOeddP�d�d��ZPe.dd��d�d��ZQdd�d�d��ZRdd�d�d��ZSeTdd��d�d��ZUdd�d�d��ZVdd�d�d��ZWe,ee<efd�d�d��ZXeed��d�d��ZYdd�d�d��ZZe,e<e,ee[eeffefd�d�d��Z\ee<e!d��d�d��Z]e,e<e,ee[eeffefd�d�d��Z^e,e<e,ee[eeffefd�d�d��Z_dS)�r�N)ru�filer8cCs�ddl}||_d|_d|_d|_i|_d|_d|_|jj	|_
|durJtj}|j�
||�|_|jj|_d|_t|�|_|jj|_|��|_t�|_|��|_d|_d|_d|_dS�Nr)�_pytest.configru�
_numcollected�_session�_showfspath�stats�_main_color�_known_typesr�r��	startpathr�rhZcreate_terminal_writer�_tw�	fullwidth�
_screen_width�
currentfspathr�r]Z	hasmarkup�isatty�set�_progress_nodeids_reported�_determine_show_progress_info�_show_progress_info�_collect_report_last_write�_already_displayed_warnings�_keyboardinterrupt_memo)r<rur��_pytestr?r?r@r;Bs,





zTerminalReporter.__init__z#Literal['progress', 'count', False]�r8cCsl|j�dd�dkr&|j�d�dkr&dS|j�dd�r8dS|j�d�}|dksT|dkrXdS|dkrddSdSd	S)
zRReturn whether we should display progress information based on the current config.Zcapturerdrnzprogress-even-when-capture-noFZ	setupshowrorUN)ru�	getoption�getini)r<Zcfgr?r?r@r�\s�
��z.TerminalReporter._determine_show_progress_infocCs|jjj}|S�N)rur�rV)r<�	verbosityr?r?r@r�qs
zTerminalReporter.verbositycCs
|jdkSr��r��r<r?r?r@�
showheadervszTerminalReporter.showheadercCst|jjj�Sr�)rPrur�rYr�r?r?r@rYzszTerminalReporter.no_headercCst|jjj�Sr�)rPrur�rZr�r?r?r@rZ~szTerminalReporter.no_summarycCs|jdur|jdkS|jSr�)r�r�r�r?r?r@�
showfspath�s

zTerminalReporter.showfspath)�valuer8cCs
||_dSr�)r�)r<r�r?r?r@r��scCs
|jdkSr�r�r�r?r?r@�showlongtestinfo�sz!TerminalReporter.showlongtestinfo)r�r8cCsddd��||�}||jvS)N�xr�)r.r,)�getr])r<r�r?r?r@�hasopt�szTerminalReporter.hasopt)r��markupr8cKs�|jj|�d�d}|jdus*||jkrn|jdurB|jrB|��||_t|j|�}|j�	�|j�
|d�|jj
|fddi|��dS)N�::rrw�flushT)ru�rootpath�splitr�r��)_write_progress_information_filling_spacer$r�r�re�write)r<r��resr��fspathZ	relfspathr?r?r@�write_fspath_result�s
z$TerminalReporter.write_fspath_resultr�)�prefix�extrar8cKsH|j|kr&|j��||_|j�|�|rD|jj|fi|��d|_dS)N���)r�r�rer�)r<r�r��kwargsr?r?r@�write_ensure_prefix�s

z$TerminalReporter.write_ensure_prefixcCs|jr|j��d|_dSr�)r�r�rer�r?r?r@�ensure_newline�s
zTerminalReporter.ensure_newlineF)r�)�contentr�r�r8cKs|jj|fd|i|��dS)Nr�)r�r�)r<r�r�r�r?r?r@r��szTerminalReporter.writecCs|j��dSr�)r�r�r�r?r?r@r��szTerminalReporter.flush)rer�r8cKs6t|t�st|dd�}|��|jj|fi|��dS)Nr�)�errors)�
isinstancerNr�r�re)r<rer�r?r?r@rz�s
zTerminalReporter.write_linecKsZ|�dd�}|r.|jjt|�d}d|}nd}t|�}|jjd||fi|��dS)a-Rewinds the terminal cursor to the beginning and writes the given line.

        :param erase:
            If True, will also add spaces until the full terminal width to ensure
            previous lines are properly erased.

        The rest of the keyword arguments are markup instructions.
        �eraseFrErwr��
N)�popr�r��lenrNr�)r<rer�r�Z
fill_count�fillr?r?r@�rewrite�s	
zTerminalReporter.rewrite)�sep�titler�r�r8cKs$|��|jj|||fi|��dSr�)r�r�r�)r<r�r�r�r�r?r?r@�	write_sep�szTerminalReporter.write_sep�=)r�r��kwr8cKs|jj||fi|��dSr�)r�r�)r<r�r�r�r?r?r@�section�szTerminalReporter.section)r}r�r8cKs|jj|fi|��dSr�)r�re)r<r}r�r?r?r@re�szTerminalReporter.line)�category�itemsr8cCs.||jv}|j�|g��|�|r*|��dSr�)r��
setdefault�extend�_set_main_color)r<r�r�Zset_main_colorr?r?r@�
_add_stats�s
zTerminalReporter._add_stats)�excreprr8cCs&t|��d�D]}|�d|�qdS)N�
zINTERNALERROR> T)rNr�rz)r<r�rer?r?r@�pytest_internalerror�sz%TerminalReporter.pytest_internalerror)�warning_messager�r8cCs@ddlm}|j|jf}||�}t|||d�}|�d|g�dS)Nr)�warning_record_to_str)r�r�r�r0)Z_pytest.warningsr�r��linenor�r�)r<r�r�r�r�r�Zwarning_reportr?r?r@�pytest_warning_recorded�s�z(TerminalReporter.pytest_warning_recorded)�pluginr8cCs"|jjjrd|��}|�|�dS)NzPLUGIN registered: )rur�r�rz)r<r�r}r?r?r@�pytest_plugin_registered�s

z)TerminalReporter.pytest_plugin_registered)r�r8cCs|�d|�dS)Nr-)r�)r<r�r?r?r@�pytest_deselected�sz"TerminalReporter.pytest_deselected)r��locationr8cCsL|jr.|j|g|�R�}|�|d�|��n|jrH|�|d�|��dS)Nr�)r��
_locationliner�r�r�r�)r<r�rrer?r?r@�pytest_runtest_logstarts
z(TerminalReporter.pytest_runtest_logstartr�cCs4d|_|}|jjj||jd�}|\}}}t|t�s8d}n|\}}|�||g�|sZ|sZdSt|d�}|dur�t|d�}	|jr�|	s�ddi}n8|jr�|	r�ddi}n$|j	r�ddi}n|j
r�ddi}ni}|jdkr�|jj
|fi|���nD|j�|j�|j|jg|j�R�}
|�s�|j|
|fi|��|j
�s6t|d��r�t|�}|jjjd	k�rx|jj|jjtd
�d}td||�}
nd
|�d�}
|�r�|
du�r�|j�
|
�|j�r(|��nv|��|j�
d|jjj �|j�r�|jj
|�!�ddd�n|j�
d�|jj
|fi|��|j�
d|
�d|_"|�#�dS)NT)r�ru�node�wasxfail�green�yellow�redr�� [100%]rEz ({})z (�)z[%s]rw)�cyanr�)$Z
_tests_ranru�hookr�r��tupler��hasattrr+r*r,r�r�r�r��addr�rrr��_get_raw_skip_reasonr�rVr��width_of_current_liner��_format_trimmedr�r�r�rZgateway�id�!_get_progress_information_messager�r�)r<r��repr�r�r��wordr�Z
running_xdistZ	was_xfailre�reason�available_widthZformatted_reasonr?r?r@�pytest_runtest_logreport
sr�










����
�z)TerminalReporter.pytest_runtest_logreportcCs |jdusJ�t|j�|jjkSr�)r�r�r��testscollectedr�r?r?r@�
_is_last_itemPszTerminalReporter._is_last_item�r�r8c	Cs�|js
J�|jdkr�|jr�|jdkrD|jj}td|�d|�d��}ntd�}|j�|�|jrh|��nL|�	�\}}|j
}||d|jk}|r�|��}|j
j|dfi|d	i��dS)
NrrU� [�/�]rrEr�T)r�r�r�rr�r�rrr��_get_main_color�_width_of_current_liner�rr�r�)	r<r�Z	num_testsZprogress_length�
main_color�_r�Z	past_edger}r?r?r@�pytest_runtest_logfinishUs


z)TerminalReporter.pytest_runtest_logfinishcCs�|js
J�|jj}|jdkrh|rV|j}dtt|���d�}d|�d�}|�t|�|�Sd|�d|�d�S|r�d	�t|j�d
|�SdSdS)NrUz{:zd}rz/{}]z [ z / z ]z	 [{:3d}%]�dr)r�rr�r�r�rN�format)r<Z	collectedroZcounter_format�
format_stringr?r?r@rjs

�z2TerminalReporter._get_progress_information_messagecCsN|��\}}|��}|j}|jj|d}|j|�|�fddi|di��dS)NrEr�T)r"rr#r�r�r��rjust)r<rlr%r}r�r�r?r?r@r�{s
z:TerminalReporter._write_progress_information_filling_spacecCs|jjS)z%Return the width of the current line.)r�rr�r?r?r@r#�sz'TerminalReporter._width_of_current_linecCsR|jr0|jjjdkrN|jdddd�t��|_n|jjjdkrN|jdddd�dS)Nrzcollecting ... T)r��boldrE)r�rur�rVr�r�timer�r�r?r?r@�pytest_collection�sz"TerminalReporter.pytest_collectioncCs^|jr|�d|g�n|jr*|�d|g�dd�|jD�}|jt|�7_|jrZ|��dS)Nr1r,cSsg|]}t|t�r|�qSr?)r�r!��.0r�r?r?r@�
<listcomp>��z9TerminalReporter.pytest_collectreport.<locals>.<listcomp>)r*r�r,�resultr�r�r��report_collect)r<r�r�r?r?r@�pytest_collectreport�sz%TerminalReporter.pytest_collectreport)rr8cCs@|jjjdkrdS|s@t��}|jdur:|j|tkr:dS||_t|j�	dg��}t|j�	dg��}t|j�	dg��}|j
|}|r�dnd}|t|j
�d|j
dkr�d	nd
7}|r�|d||dkr�d
nd	f7}|r�|d|7}|r�|d
|7}|j
|k�r|d|7}|j�r2|j
|ddd�|�r<|�d�n
|�|�dS)Nrr1r,r-z
collected zcollecting z itemrEr�r�z
 / %d error%sz / %d deselectedz
 / %d skippedz / %d selectedT)r+r�r�)rur�rVrr,r��REPORT_COLLECTING_RESOLUTIONr�r�r�r�rNr�r�r�rz)r<r�tr�r,r-�selectedrer?r?r@r3�s>��
�zTerminalReporter.report_collectTr�r))�sessionr8cCs||_t��|_|jsdS|jdddd�t��}|j�sdt	j�d|��}t
t	dd�}|r�d�tt
|dd	���}|d
|�d|d	�d�7}|d
�tjjtj�7}|jdks�|jjjs�t
|jjdd�r�|dt
t	j�7}|�|�|jjj|j|jd�}|�|�dS)Nr�ztest session startsT�r+z	platform z -- Python �pypy_version_infor��z[pypy-�-r!z, pytest-{}, pluggy-{}rZpastebinz -- )ru�
start_path)r�rr,�_sessionstarttimer�r��platformZpython_versionrYr�rGrxryrNr(r�Z_version�version�pluggy�__version__r�rur�r��
executablerzr�pytest_report_headerr��_write_report_lines_from_hooks)r<r8Zverinfor}r:�linesr?r?r@�pytest_sessionstart�s6

����
�z$TerminalReporter.pytest_sessionstart�rFr8cCs<t|�D].}t|t�r"|�|�q|D]}|�|�q&qdSr�)�reversedr�rNrz)r<rFZ
line_or_linesrer?r?r@rE�s

z/TerminalReporter._write_report_lines_from_hooksrtcCs�d|j��g}|jr,|�dt|j|j��|jtjjkrZ|�d�}|�d�	d�
|���|j��}|r�|�dd�
t
|���|S)Nz	rootdir: zconfigfile: �	testpathsz
testpaths: {}�, zplugins: %s)r�Zinipath�appendr$Zargs_sourcerZ
ArgsSourceZ	TESTPATHSr�r(rxr�Zlist_plugin_distinfo�_plugin_nameversions)r<rur2rJ�
plugininfor?r?r@rD�s

z%TerminalReporter.pytest_report_headercCs�|�d�|jjj|j|j|jd�}|�|�|j�d�r�|jrf|jjj	dkrZ|j
�d�|�|j�|j
�d�}|r�|j
�dd�|D]}|�|j
�q�dS)	NT)rur=r��collectonly���r�r*�!zcollection failures)r3rurZpytest_report_collectionfinishr�r�rEr�r�rVr�re�_printcollecteditemsr�r�r��
toterminal)r<r8rFr*rr?r?r@�pytest_collection_finish�s"
�
z)TerminalReporter.pytest_collection_finishc
	Cs^|jjjdkrv|jjjdkrZtdd�|D��}t|���D]\}}|j�d||f�q:n|D]}|j�|j�q^dSg}d}|D]�}|�	�dd�}|r�||dt
|��kr�q�|��q�|t
|�d�D]�}	|�|	�t
|�dd}|j�|�|	���|jjjdkr�t
|	d	d�}
|
�r&t�|
�nd}|r�|��D]}|j�d
�|d|���q6q�q�dS)NrrPcss |]}|j�dd�dVqdS�r�rErN)r�r�)r/�itemr?r?r@�	<genexpr>
r1z8TerminalReporter._printcollecteditems.<locals>.<genexpr>z%s: %dr�rE�  �objz{}{})rur�rVr�sortedr�r�rer�Z	listchainr�r�rLrG�inspectZgetdoc�
splitlinesr()
r<r�Zcounts�namerUrV�stack�indentZneeded_collectors�colrY�docrer?r?r@rR
s4

z%TerminalReporter._printcollecteditems)Zhookwrapper)r8�
exitstatusccs�dV}|��|j�d�tjtjtjtjtjf}||vrV|j	sV|j
jj|||j
d�|j
rr|jdt|j
�dd�|tjkr�|��d|_n|jr�|jdt|j�dd�|��dS)Nr�)rvrbrurQT)r	)Z
get_resultr�rerZOKZTESTS_FAILEDZINTERRUPTEDZUSAGE_ERRORZNO_TESTS_COLLECTEDrZrur�pytest_terminal_summaryZ
shouldfailr�rN�_report_keyboardinterruptr�Z
shouldstop�
summary_stats)r<r8rbr�Zsummary_exit_codesr?r?r@�pytest_sessionfinish's*��
z%TerminalReporter.pytest_sessionfinish)NNNccs:|��|��|��|��dV|��|��dSr�)�summary_errors�summary_failures�summary_warnings�summary_passes�short_test_summaryr�r?r?r@rcBsz(TerminalReporter.pytest_terminal_summary)�excinfor8cCs|jdd�|_dS)NT)Zfuncargs)Zgetreprr�)r<rlr?r?r@�pytest_keyboard_interruptMsz*TerminalReporter.pytest_keyboard_interruptcCs|jdur|��dSr�)r�rdr�r?r?r@�pytest_unconfigurePs
z#TerminalReporter.pytest_unconfigurecCsv|j}|dusJ�|jdus J�|jj}|�d|�d|vrr|jjjrT|�|j�n|j�|j�|jj	ddd�dS)NrQ�KeyboardInterruptz@(to show a full traceback on KeyboardInterrupt use --full-trace)T)r)
r��	reprcrashr�r�rur�Z	fulltracerSr�re)r<r�r}r?r?r@rdTs
�z*TerminalReporter._report_keyboardinterrupt)r�r�r��domainr8csnttd���fdd�}|rb||�}�jdkrf|�d�d|�dtj�krf|dt�jt|��7}nd	}|d
S)Nrcs\�j�|�}�rX|���rX|dt���}��d�}|d�dd�|d<|d�|�7}|S)N�[rr�r�)ru�cwd_relative_nodeid�endswithr�r�r�rx)r�rerC�rqr<r?r@�mkrelgs
z-TerminalReporter._locationline.<locals>.mkrelr
r�r�\z <- z
[location]rw)	rNr�r�r�rZSEPr$r�r)r<r�r�r�rqrvr�r?rur@rds
�zTerminalReporter._locationlinecCs|j}|r|SdS)Nztest session)�	head_line)r<rrxr?r?r@�_getfailureheadline{sz$TerminalReporter._getfailureheadlinecCsVzt|jj�WStyPzt|j�dd�WYStyJYYdS0Yn0dS)N�2r�)rN�longreprrp�AttributeError)r<rr?r?r@�
_getcrashline�szTerminalReporter._getcrashline)r]cCsdd�|j�|d�D�S)NcSsg|]}t|d�s|�qS)Z	_pdbshown)rr.r?r?r@r0�r1z/TerminalReporter.getreports.<locals>.<listcomp>r?�r�r�)r<r]r?r?r@�
getreports�szTerminalReporter.getreportsc
s*��d��r&�j�d�}|s dS�jdu}|r>|�jd�}n|}t|��_|sTdSi}|D]}|�|jg��|�q\tt	t
d��fdd�}|r�dnd}�jd|d	d
d�|��D]d\}}	||	�}
|
r��j
�|
�|��}d�d
d�|D��}|��}n|��}�j
�|��j
��q��j
�d�dS)Nr�r0)�reportsr8csng}|D]}|��j�}|r|�|�qt|�dkrDd�tt|��Stdd�|D��}d�dd�|��D��S)N�
r�css"|]}t|��dd�dVqdSrU)rNr�)r/�locr?r?r@rW�szWTerminalReporter.summary_warnings.<locals>.collapsed_location_report.<locals>.<genexpr>css,|]$\}}d�|||dkrdnd�VqdS)z{}: {} warning{}rEr�r�N)r()r/�k�vr?r?r@rW�s�)	r�rurLr�rxryrNrr�)r�Z	locationsr�rZcounts_by_filenamer�r?r@�collapsed_location_report�s�
�zDTerminalReporter.summary_warnings.<locals>.collapsed_location_reportzwarnings summary (final)zwarnings summaryr�TF)rr+r�css|]}d|VqdS)rXNr?r.r?r?r@rW�r1z4TerminalReporter.summary_warnings.<locals>.<genexpr>zG-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html)r�r�r�r�r�r�r�rLrr�rNr�r�r�rer\rx�rstrip)
r<Zall_warningsrZwarning_reportsZreports_grouped_by_message�wrr�r�r�Zmessage_reportsZmaybe_locationrFZindentedr?r�r@ri�s<


�z!TerminalReporter.summary_warningscCs||jjjdkrx|�d�rx|�d�}|s*dS|�dd�|D]<}|jrj|�|�}|jd|ddd�|�|�|�	|j
�q:dS)	Nrd�Pr+r�ZPASSESr%T)rr+)rur�rbr�rr��sectionsry�_outrep_summary�_handle_teardown_sectionsr��r<r�rr}r?r?r@rj�s



zTerminalReporter.summary_passescs|�d�}�fdd�|D�S)Nr�cs$g|]}|jdkr|j�kr|�qS)r�)r�r�)r/r��r�r?r@r0�s�z:TerminalReporter._get_teardown_reports.<locals>.<listcomp>)r)r<r�r�r?r�r@�_get_teardown_reports�s

�z&TerminalReporter._get_teardown_reportscCs|�|�D]}|�|�q
dSr�)r��print_teardown_sections)r<r�r�r?r?r@r��sz*TerminalReporter._handle_teardown_sections)rr8cCsz|jjj}|dkrdS|jD]X\}}|dkr6||vr6qd|vr|j�d|�|dd�dkrh|dd�}|j�|�qdS)Nrdrkr�r<rPr�)rur�rgr�r�r�re�r<rrgZsecnamer�r?r?r@r��s
z(TerminalReporter.print_teardown_sectionscCs�|jjjdkr�|�d�}|s dS|�dd�|jjjdkrZ|D]}|�|�}|�|�q>n<|D]6}|�|�}|jd|ddd�|�|�|�	|j
�q^dS)	Nrdr*r�ZFAILURESrer%T�r	r+)rur�rbrr�r}rzryr�r�r�)r<r�rrer}r?r?r@rh�s



z!TerminalReporter.summary_failurescCs�|jjjdkr�|�d�}|s dS|�dd�|jdD]P}|�|�}|jdkrXd|}nd|j�d|��}|jd	|d
d
d�|�|�q6dS)Nrdr1r�ZERRORSr�zERROR collecting z	ERROR at z of r%Tr�)	rur�rbrr�r�ryr�r�r�r?r?r@rg�s



zTerminalReporter.summary_errorscCs~|�|j�|jjj}|dkr"dS|jD]P\}}|dkrB||vrBq(|j�d|�|dd�dkrl|dd�}|j�|�q(dS)Nrdrkr<rPr�)rSr�rur�rgr�r�rer�r?r?r@r�
s
z TerminalReporter._outrep_summarycCsT|jdkrdSt��|j}|��\}}g}|jdk}|rB|jj}|D]>\}}|jj|fi|��}	|rz|t|	�t|�7}|�	|	�qFd�
|�}
|di}dt|���}|jj|fi|��}
|r�|t|
�t|�7}|
|
7}
|�r|jjdi|��}|�d��r
|dd�}|t|�7}|
|7}
|�r>|j
d	|
fd
|i|��n|j|
fi|��dS)NrPrrKTz in r�z���r�r�)r�)r�rr,r>�build_summary_stats_liner�r�r�r�rLrx�format_session_durationrtr�rz)r<Zsession_duration�partsr$Z
line_partsZdisplay_sepr��textr�Zwith_markupr}Zmain_markupZdurationZduration_with_markupZmarkup_for_end_sepr?r?r@res:


zTerminalReporter.summary_statsc
	s��js
dStttdd��fdd�}ttdd��fdd�}ttdd��fdd�}ttdd��fd	d
�}||t|dd�|t|d
d�t|dd�d�}g}�jD]}|�|�}|r�||�q�|r�jddddd�|D]}	��|	�q�dS)N)rF�statr8csT�j�|g�}|sdS�j}|D].}t�|t�}t||�j|di�}|�|�q dS)NT)r�r�ru�_color_for_type�_color_for_type_default� _get_line_with_reprcrash_messager�rL)rFr�r*rurrlrer�r?r@�show_simpleCs�z8TerminalReporter.short_test_summary.<locals>.show_simplerHcs��j�dg�}|D]n}|��j�}�jj|fitddi��}t�j�j|�}|�d|��}|j}|rv|dt	|�7}|�
|�qdS)Nr.r0Trw� - )r�r��_get_verbose_wordrur�r�r��_get_node_id_with_markuprrNrL)rFr.r�verbose_word�markup_wordr�rerr�r?r@�show_xfailedOs�
�z9TerminalReporter.short_test_summary.<locals>.show_xfailedcst�j�dg�}|D]\}|��j�}�jj|fitddi��}t�j�j|�}|j}|�	|�d|�d|���qdS)Nr/r0Trw)
r�r�r�rur�r�r�r�rrL)rFr/rr�r�r�rr�r?r@�show_xpassed^s�
�z9TerminalReporter.short_test_summary.<locals>.show_xpassedc
	s��j�dg�}|rt�j|�ng}|s*dS|d��j�}�jj|fitddi��}d}|D]^\}}}}	|	�	|�r�|	t
|�d�}	|dur�|�d|||||	f�q^|�d||||	f�q^dS)Nr,rr0T�	Skipped: z%s [%d] %s:%d: %sz%s [%d] %s: %s)r�r��
_folded_skipsr�r�rur�r�r��
startswithr�rL)
rFr,Zfskipsr�r�r�Znumr�r�rr�r?r@�show_skippedis&�
�
�z9TerminalReporter.short_test_summary.<locals>.show_skippedr*)r�r+r1)r��X�fr��pr�r�zshort test summary infoT)r
r+)r]rrNrr�r�rz)
r<r�r�r�r�ZREPORTCHAR_ACTIONSrFr�rWrer?r�r@rk?s,


�	


z#TerminalReporter.short_test_summarycCsB|jdus|jdus|jr6|��|js,J�|js6J�|j|jfSr�)r�r�rr�r�r?r?r@r"�s


z TerminalReporter._get_main_color)�unknown_type_seenr8cCsR|j}d|vsd|vrd}n2d|vs0d|vs0|r6d}nd|vsD|jsJd}nd}|S)	Nr*r1r	r0r/rr+r)r�r)r<r�r�r$r?r?r@�_determine_main_color�sz&TerminalReporter._determine_main_colorcCsTg}|j��D]"}|r|tvr||vr|�|�qtt�||_|�t|��|_dSr�)	r��keys�KNOWN_TYPESrL�listr�r�rPr�)r<Z
unknown_typesZ
found_typer?r?r@r��sz TerminalReporter._set_main_colorcCs |j�d�r|��S|��SdS)a�
        Build the parts used in the last summary stats line.

        The summary stats line is the line shown at the end, "=== 12 passed, 2 errors in Xs===".

        This function builds a list of the "parts" that make up for the text in that line, in
        the example above it would be:

            [
                ("12 passed", {"green": True}),
                ("2 errors", {"red": True}
            ]

        That last dict for each line is a "markup dictionary", used by TerminalWriter to
        color output.

        The final color of the line is also determined by this function, and is the second
        element of the returned tuple.
        rON)rur��&_build_collect_only_summary_stats_line� _build_normal_summary_stats_liner�r?r?r@r��sz)TerminalReporter.build_summary_stats_line)�keyr8cCs|j�|g�}dd�|D�S)zRGet test/collection reports for the given status key, such as `passed` or `error`.cSsg|]}t|dd�r|�qS)r�T)rGr.r?r?r@r0�r1z<TerminalReporter._get_reports_to_display.<locals>.<listcomp>r~)r<r�r�r?r?r@�_get_reports_to_display�sz(TerminalReporter._get_reports_to_displayc	Cs~|��\}}g}|D]N}|�|�}|rt|�}t�|t�}|dd||ki}|�dt||�|f�q|svdtdifg}||fS)NTr+�%d %szno tests ran)r"r�r�r�r�r�rL�	pluralize)	r<r$Zknown_typesr�r�r�rUrlr�r?r?r@r��s
z1TerminalReporter._build_normal_summary_stats_linecCs�t|�d��}t|�d��}|jdkr:dddifg}d}n�|dkrfd}dt|jd	�}||difg}nT|j|k}|r�d}d
|�d�}n&d}|j|}|�d|j�d
|�d�}||difg}|r�td}|dt|d�|difg7}||fS)Nr-r1rzno tests collectedrTrz%d %s collected�testzno tests collected (z deselected)r z tests collected (r�)r�r�r�r�r�)r<r-r�r�r$Zcollected_outputZall_tests_were_deselectedr7r?r?r@r��s*


z7TerminalReporter._build_collect_only_summary_stats_line)N)r�)NN)r�)F)`rJrKrLrr
rr;r��propertyrpr�rPr�rYrZr��setterr�rNr�r�r�r�r�r�r�bytesrzr�r�r�rerrr�rr�r0�WarningMessager�rrr!rrrr'rrr&rr�r#r-r&r4r3rrGrErrDrTrRrrfr
rcr�
BaseExceptionrmrnrdrryr}rrirjr�r�r�rhrgr%r�rerkr"r�r�r	r�r�r�r�r?r?r?r@r�@s�	��
��
C
%�
�
�6

%R	*��r�)�twrurcCsF|�|j�}|�d�^}}|r>|jd�|�dd�}|d|S|SdS)Nr�Tr9)rsr�r�r�rx)r�rurr��pathr�Zparts_markupr?r?r@r��sr�)r(r}rr8cCs�|�d�}|dkr|d|�}d}t|�d��}|t|�|krDdS|t|�|kr�|t|�8}|d|�}|t|�|kr�|dd�}ql||7}|�|�S)z�Format msg into format, ellipsizing it if doesn't fit in available_width.

    Returns None if even the ellipsis can't fit.
    r�rPNz...r�)�findrr(r�)r(r}r�iZellipsisZformat_widthr?r?r@r	s
r)rurr��word_markupr8cCs�|�|�}|j|fi|��}t|||�}|�d|��}t|�}z|jjj}	Wnty^Yn:0t�s~|j	|}
t
d|	|
�}	n
d|	��}	|	dur�||	7}|S)z?Get summary line for a report, trying to add reprcrash message.rwz - {}r�N)r�r�r�rr{rpr�r|rr�r)rurr�r�r�rrreZ
line_widthr}rr?r?r@r�"s 


r�)r�r,r8cCs�i}|D]�}|jdusJ�t|jt�s4J||jf��t|j�dksPJ||jf��|j\}}}t|t|��}t|di�}|jdkr�d|vr�d|vr�|d|f}n
|||f}|�|g��	|�qg}	|�
�D]\}}
|	�	t|
�g|�R�q�|	S)Nr;�keywordsr��skipZ
pytestmark)r{r�rr�r$rrGr�r�rLr�)r�r,�dZeventr�r�rr�r�rCZeventsr?r?r@r�>s*���
r�r	rr)r*r1r0r+)rU�nounr8cCs4|dvr||fS|�dd�}||dkr.|dn|fS)N)r1r0r�r0ZwarningrEr�)r�)rUr�r?r?r@r�fsr�r�cCsJg}|D]<\}}dj|d�}|�d�r2|dd�}||vr|�|�q|S)Nz"{dist.project_name}-{dist.version})�distzpytest-�)r(r�rL)rNrCr�r�r]r?r?r@rMss
rM)�secondsr8cCs:|dkr|d�d�Stjt|�d�}|d�d|�d�SdS)zQFormat the given seconds in a human readable manner to show in the final summary.�<z.2fr�)r�zs (rN)�datetimeZ	timedeltarp)r�Zdtr?r?r@r��sr�cCs�t|d�r4tt|j�}|�d�r0|td�d�}|S|js>J�t|jt	�sNJ�|j\}}}|�d�rv|td�d�}n|dkr�d}|SdS)zqGet the reason string of a skip/xfail/xpass test report.

    The string is just the part given by the user.
    rzreason: Nr�ZSkippedr�)
rrrNrr�r�r,r�r{r)r�rr%r?r?r@r�s



r)^rMrQZdataclassesr�r[r?r�r0�collectionsr�	functoolsr�pathlibr�typingrrrrr	r
rrr
rrrrrrrAZ_pytest._versionr�rrZ
_pytest._coderZ_pytest._code.coderZ_pytest._iorZ_pytest._io.wcwidthrZ_pytest.assertion.utilrZ_pytest.compatrr�rrrrZ_pytest.config.argparsingr Z
_pytest.nodesr!r"Z_pytest.pathlibr#r$Z_pytest.reportsr%r&r'Ztyping_extensionsr(Z_pytest.mainr)r5r�rq�Actionr2rsr�rNr�r�Z	dataclassr�r�r�rprrPr�r�r�r�r�rM�floatr�rr?r?r?r@�<module>s�%|E
�� �
	

Youez - 2016 - github.com/yon3zu
LinuXploit