Your IP : 216.73.216.85


Current Path : /opt/alt/python37/lib/python3.7/site-packages/_pytest/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/_pytest/__pycache__/pastebin.cpython-37.pyc

B

C$�X�
�@sTdZddlZddlZddlZdd�Zejdd�dd��Zd	d
�Zdd�Zd
d�Z	dS)zC submit failure or test session information to a pastebin service. �Nc	Cs*|�d�}|jdddddddgdd	�dS)
Nzterminal reportingz
--pastebin�mode�store�pastebin�failed�allz4send failed|all info to bpaste.net pastebin service.)�metavar�action�dest�default�choices�help)ZgetgroupZ
_addoption)�parser�group�r�A/opt/alt/python37/lib/python3.7/site-packages/_pytest/pastebin.py�pytest_addoptions

rT)ZtrylastcsXddl��jjdkrT�j�d�}|dk	rTt�d��_|jj	����fdd�}||j_	dS)Nrr�terminalreporterzw+bcs2�|f|��j�|�r"|�d�}�j�|�dS)Nzutf-8)�builtinZ_istext�encode�
_pastebinfile�write)�s�kwargs)�config�oldwrite�pyrr�	tee_writes
z#pytest_configure.<locals>.tee_write)
r�optionr�
pluginmanager�	getplugin�tempfile�
TemporaryFiler�_twr)r�trrr)rrrr�pytest_configuresr$cCsjt|d�rf|j�d�|j��}|j��|`|j�d�}|jjd=|�	dd�t
|�}|�d|�dS)Nrrrr�=z$Sending information to Paste Servicezpastebin session-log: %s
)�hasattrr�seek�read�closerrr"�__dict__�	write_sep�create_new_paste�
write_line)rZ
sessionlogr#�pastebinurlrrr�pytest_unconfigure%s



r/cCs�ddl}tjdkr$ddlm}m}nddlm}ddlm}|tjddkrPdnd	d
d�}d}||||��d
�d��	�}|�
d|�d��}|r�d||�d�fSd|SdS)z�
    Creates a new paste using bpaste.net service.

    :contents: paste contents as utf-8 encoded bytes
    :returns: url to the pasted contents
    rN)�r)�urlopen�	urlencode)r1)r2r0�python3�pythonZ1week)�codeZlexerZexpiryzhttps://bpaste.net�ascii)�datazhref="/raw/(\w+)"zutf-8z
%s/show/%s�zbad response: )
�re�sys�version_info�urllibr1r2Zurllib.request�urllib.parserr(�search�decoder)�contentsr9r1r2�params�url�response�mrrrr,5s
r,c	Cs�ddl}|jjjdkrdS|}d|jkr�|�dd�x�|j�d�D]�}y|jjj	dj
}Wntk
rx|�|�}YnX|jj
|jdd�}|�|�|j��}t|�s�t�t|�}|�d||f�qBWdS)	Nrrr%z$Sending information to Paste Service���T)�stringioz	%s --> %s)Z_pytest.configrrrZstatsr+�getZlongreprZ
reprtracebackZreprentriesZreprfileloc�AttributeErrorZ_getfailureheadlineZcreate_terminal_writerZ
toterminalrF�getvalue�len�AssertionErrorr,r-)r�_pytestr#�rep�msgZtwrr.rrr�pytest_terminal_summaryQs"


rO)
�__doc__�pytestr:r rZhookimplr$r/r,rOrrrr�<module>s