????

Your IP : 3.147.70.194


Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/_pytest/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/_pytest/__pycache__/pastebin.cpython-311.pyc

�

�܋fm��4�dZddlZddlmZddlmZddlmZddlZddlm	Z	ddlm
Z
ddlmZdd	l
mZdd
lmZeee��Zdeddfd
�Zejd���de	ddfd���Zde	ddfd�Zdeeefdefd�Zdeddfd�ZdS)zASubmit failure or test session information to a pastebin service.�N)�StringIO)�IO)�Union)�Config)�create_terminal_writer)�Parser)�StashKey)�TerminalReporter�parser�returnc	�l�|�d��}|�dddddddgd�	��dS)
Nzterminal reportingz
--pastebin�mode�store�pastebin�failed�allz3Send failed|all info to bpaste.net pastebin service)�metavar�action�dest�default�choices�help)�getgroup�
_addoption)r�groups  �a/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/_pytest/pastebin.py�pytest_addoptionrsU���O�O�0�1�1�E�	������
���5�!�
B�������T)�trylast�configc������jjdkr]�j�d��}|�Ct	jd���jt<|jj	���fd�}||j_	dSdSdS)Nr�terminalreporterzw+bc����|fi|��t|t��r|�d��}�jt�|��dS)N�utf-8)�
isinstance�str�encode�stash�pastebinfile_key�write)�s�kwargsr �oldwrites  ��r�	tee_writez#pytest_configure.<locals>.tee_write+s`������%�%�f�%�%�%��a��%�%�*�����)�)�A���-�.�4�4�Q�7�7�7�7�7r)
�optionr�
pluginmanager�	getplugin�tempfile�
TemporaryFiler(r)�_twr*)r �trr.r-s`  @r�pytest_configurer6s�����
�}���&�&�
�
!�
+�
+�,>�
?�
?���>�-5�-C�E�-J�-J�F�L�)�*��v�|�H�
8�
8�
8�
8�
8�
8�%�B�F�L�L�L�!'�&�
�>rc��t|jvr�|jt}|�d��|���}|���|jt=|j�d��}|jjd=|�	dd��t|��}|�d|z��dSdS)Nrr"r*�=�$Sending information to Paste Servicezpastebin session-log: %s
)r)r(�seek�read�closer0r1r4�__dict__�	write_sep�create_new_paste�
write_line)r �pastebinfile�
sessionlogr5�pastebinurls     r�pytest_unconfigurerD4s����6�<�'�'��|�$4�5�����!����!�&�&�(�(�
��������L�)�*�
�
!�
+�
+�,>�
?�
?���F�O�G�$�
���S�@�A�A�A�&�z�2�2��
�
�
�2�[�@�A�A�A�A�A�(�'r�contentsc�~�ddl}ddlm}ddlm}|ddd�}d}	||||���d	���
������d��}n#t$r}d|zcYd}~Sd}~wwxYw|�	d
|��}|r|�d|�
d����Sd|zdzS)z�Create a new paste using the bpaste.net service.

    :contents: Paste contents string.
    :returns: URL to the pasted contents, or an error message.
    rN)�urlopen)�	urlencode�text�1week)�code�lexer�expiryzhttps://bpa.st�ascii)�datar$zbad response: %szhref="/raw/(\w+)"z/show/�zbad response: invalid format ('z'))�re�urllib.requestrG�urllib.parserHr'r;�decode�OSError�searchr)	rErQrGrH�params�url�response�exc_info�ms	         rr?r?Es���I�I�I�&�&�&�&�&�&�&�&�&�&�&�&���7�
C�
C�F�
�C�-��G�C�i�i��/�/�6�6�w�?�?�@�@�@�E�E�G�G�N�N�w�W�W�	����-�-�-�!�H�,�,�,�,�,�,�,�����-����
�	�	�&��1�1�A��C��)�)�Q�W�W�Q�Z�Z�)�)�)�0�8�;�d�B�Bs�AA)�)
B�3A=�7B�=Br"c�(�|jjjdkrdSd|jvr�|�dd��|jdD]�}	|jjjdj}n%#t$r|�
|��}YnwxYwt��}t|j|��}|�
|��|���}t|��sJ�t!|��}|�|�d|������dSdS)Nrr8r9���z --> )r r/r�statsr>�longrepr�
reprtraceback�reprentries�reprfileloc�AttributeError�_getfailureheadlinerr�
toterminal�getvalue�lenr?r@)r"�rep�msg�file�twr+rCs       r�pytest_terminal_summaryrl^s=����%�.�(�:�:����#�)�)�)��"�"�3�(N�O�O�O�#�)�(�3�	D�	D�C�
@��l�0�<�R�@�L����!�
@�
@�
@�&�:�:�3�?�?����
@�����:�:�D�'�(8�(?��F�F�B��N�N�2�����
�
���A��q�6�6�M�M�6�*�1�-�-�K��'�'�3�(B�(B�[�(B�(B�C�C�C�C�*�)�	D�	Ds�A$�$B�B)�__doc__r2�ior�typingrr�pytest�_pytest.configrr�_pytest.config.argparsingr�
_pytest.stashr	�_pytest.terminalr
�bytesr)r�hookimplr6rDr&r?rl�rr�<module>rxs���G�G�����������������������
�
�
�
�!�!�!�!�!�!�1�1�1�1�1�1�,�,�,�,�,�,�"�"�"�"�"�"�-�-�-�-�-�-�'�8�B�u�I�&�(�(��
�V�
��
�
�
�
��������%�V�%��%�%�%���%�(B�v�B�$�B�B�B�B�"C�u�S�%�Z�0�C�S�C�C�C�C�2D�.>�D�4�D�D�D�D�D�Dr