403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Python312/Lib/site-packages/_pytest/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Python312/Lib/site-packages/_pytest/__pycache__/capture.cpython-312.pyc
�

��Hgx��	�|�dZddlmZddlZddlZddlZddlZddlmZddlZddl	Z	ddl
mZddlm
Z
ddlmZddlmZdd	lmZdd
lmZddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlmZerddlmZddlmZddlm Z ddl!m"Z"ddl#m$Z$ddl%m&Z&ddl%m'Z'ddl(m)Z)ddl(m*Z*ddl(m+Z+ddl,m-Z-edZ.dSd �Z/dTd!�Z0dUd"�Z1e d#�$�dVd%��Z2Gd&�d'ejf�Z4Gd(�d)ejf�Z5Gd*�d+e5�Z6Gd,�d-e�Z7Gd.�d/ejpee�Z9d0d1d2d3�Z:Gd4�d5e9e;�Z<Gd6�d7e9e�Z=Gd8�d9e=e>�Z?Gd:�d;e=e;�Z@Gd<�d=e9e�ZAGd>�d?eAe>�ZBGd@�dAeAe;�ZCe	j�dBk\sereGdC�dDeee��ZEn"GdE�dDej�dDdFdGg�ee�ZEGdH�dIee�ZGdWdJ�ZHGdK�dL�ZIGdM�dNee�ZJe&dXdO��ZKe&dYdP��ZLe&dXdQ��ZMe&dYdR��ZNy)Zz+Per-test stdout/stderr capturing mechanism.�)�annotationsN��UnsupportedOperation)�
TemporaryFile)�
TracebackType)�Any)�AnyStr)�BinaryIO)�Final)�final)�	Generator)�Generic)�Iterable)�Iterator)�Literal)�
NamedTuple)�TextIO)�
TYPE_CHECKING)�Self)�Config)�hookimpl)�Parser)�check_ispytest)�fixture)�
SubRequest)�	Collector)�File)�Item)�
CollectReport��fd�sys�no�tee-sysc��|jd�}|jddddgd�d��|jd	d
ddd
��y)N�generalz	--capture�storer!�methodr z3Per-test capturing method: one of fd|sys|no|tee-sys)�action�default�metavar�choices�helpz-s�store_constr#�capturezShortcut for --capture=no)r)�const�destr-)�getgroup�
_addoption)�parser�groups  �1C:\Python312\Lib\site-packages\_pytest/capture.py�pytest_addoptionr70sY���O�O�I�&�E�	�������.�
B�
��
������
�
(���c�l�tjjd�r	ddl}yy#t$rYywxYw)aEnsure colorama is imported so that it attaches to the correct stdio
    handles on Windows.

    colorama uses the terminal on import time. So if something does the
    first import of colorama while I/O capture is active, colorama will
    fail in various ways.
    �win32rN)r"�platform�
startswith�colorama�ImportError)r=s r6�_colorama_workaroundr?Cs7���|�|���w�'�	��(���	��	�s�'�	3�3c����tjjd�rttd�ryt�d�syt�jd�r�jj
n�j}t
|tj�sy�fd�}|tjd�t_	|tjd�t_
|tjd�t_y)	a�Workaround for Windows Unicode console handling.

    Python 3.6 implemented Unicode console handling for Windows. This works
    by reading/writing to the raw console handle using
    ``{Read,Write}ConsoleW``.

    The problem is that we are going to ``dup2`` over the stdio file
    descriptors when doing ``FDCapture`` and this will ``CloseHandle`` the
    handles used by Python to write to the console. Though there is still some
    weirdness and the console handle seems to only be closed randomly and not
    on the first call to ``CloseHandle``, or maybe it gets reopened with the
    same handle value when we suspend capturing.

    The workaround in this case will reopen stdio with a different fd which
    also means a different handle by replicating the logic in
    "Py_lifecycle.c:initstdio/create_stdio".

    :param stream:
        In practice ``sys.stdout`` or ``sys.stderr``, but given
        here as parameter for unittesting purposes.

    See https://github.com/pytest-dev/py/issues/103.
    r:�pypy_version_infoN�buffer�rawc�$��t�jd�s|ddk(rd}nd}tjt	tj|j��||�|j|j|j|j�S)NrCr�w���)�hasattrrB�io�
TextIOWrapper�open�os�dup�fileno�encoding�errors�newlines�line_buffering)�f�mode�	buffering�streams   �r6�
_reopen_stdioz3_windowsconsoleio_workaround.<locals>._reopen_stdiovsq����v�}�}�e�,��a��C���I��I�����������
�#�T�9�5�
�J�J�
�H�H�
�J�J�
���
�	
r8�rb�wb)r"r;r<rGrBrC�
isinstancerH�_WindowsConsoleIO�stdin�stdout�stderr)rU�
raw_stdoutrVs`  r6�_windowsconsoleio_workaroundr_Rs����0�<�<�"�"�7�+�w�s�<O�/P���6�8�$��&-�f�m�m�U�&C����"�"����J��j�"�"6�"6�7��
��c�i�i��.�C�I��s�z�z�4�0�C�J��s�z�z�4�0�C�Jr8T��wrapperc#�XK�|j}|jdk(rttj�t�|j}t|j�}|j|d�|j|j�|j�		d��|j�y#|j�wxYw#t$rS|j�\}}tjj|�tj j|��wxYw�w)Nr!�capturemanager)�known_args_namespacer/r_r"r\r?�
pluginmanager�CaptureManager�register�add_cleanup�stop_global_capturing�start_global_capturing�suspend_global_capture�
BaseException�read_global_capture�writer])�early_config�nsre�capman�out�errs      r6�pytest_load_initial_conftestsrt�s�����	�	*�	*�B�	�z�z�T��$�S�Z�Z�0��� �.�.�M�
�B�J�J�
'�F����6�#3�4����V�9�9�:��!�!�#�	�	,���)�)�+��F�)�)�+�����-�-�/���S��
�
������
�
�����
�	�s1�BD*�!B6�%C�5D*�6C�C�AD'�'D*c�4�eZdZdZedd��Zedd��Zy)�EncodedFile�c�,�t|j�S�N)�reprrB��selfs r6�namezEncodedFile.name�s���D�K�K� � r8c�N�|jjjdd�S)N�b�)rBrS�replacer{s r6rSzEncodedFile.mode�s!���{�{���'�'��R�0�0r8N��return�str)�__name__�
__module__�__qualname__�	__slots__�propertyr}rSrwr8r6rvrv�s-���I�
�!��!�
�1��1r8rvc�(��eZdZd�fd�Zdd�Z�xZS)�	CaptureIOc�P��t�|�tj�ddd��y)N�UTF-8r�T)rN�newline�
write_through)�super�__init__rH�BytesIO)r|�	__class__s �r6r�zCaptureIO.__init__�s ���
���������SW��Xr8c��t|jtj�sJ�|jj	�jd�S)Nr�)rYrBrHr��getvalue�decoder{s r6r�zCaptureIO.getvalue�s8���$�+�+�r�z�z�2�2�2��{�{�#�#�%�,�,�W�5�5r8�r��Noner�)r�r�r�r�r��
__classcell__�r�s@r6r�r��s���Y�6r8r�c�,��eZdZd�fd�Zd�fd�Z�xZS)�TeeCaptureIOc�0��||_t�|�	�yry)�_otherr�r�)r|�otherr�s  �r6r�zTeeCaptureIO.__init__�s������
���r8c�X��t�|�|�|jj|�Sry)r�rnr�)r|�sr�s  �r6rnzTeeCaptureIO.write�s$���
��
�a���{�{� � ��#�#r8)r�rr�r�)r�r�r��int)r�r�r�r�rnr�r�s@r6r�r��s����$�$r8r�c���eZdZedd��Zddd�ZeZdd�Zddd�Zdd�Z	dd�Z
dd�Zdd�Zdd	�Z
dd
�Zddd�Zdd�Zdd
�Zd d!d�Zd"d�Zd#d�Zdd�Zd$d�Z								d%d�Zed&d��Zy)'�DontReadFromInputc�Z�tj�J�tjjSry)r"�	__stdin__rNr{s r6rNzDontReadFromInput.encoding�s"���}�}�(�(�(��}�}�%�%�%r8c��td���NzJpytest: reading from stdin while output is captured!  Consider using `-s`.��OSError�r|�sizes  r6�readzDontReadFromInput.read�����X�
�	
r8c�"�|j�Sry)�readliner{s r6�__next__zDontReadFromInput.__next__�s���}�}��r8c��td��r�r�)r|�hints  r6�	readlineszDontReadFromInput.readlines�r�r8c��|Sryrwr{s r6�__iter__zDontReadFromInput.__iter__�����r8c��td��)Nz/redirected stdin is pseudofile, has no fileno()rr{s r6rMzDontReadFromInput.fileno�s��"�#T�U�Ur8c��td��)Nz.redirected stdin is pseudofile, has no flush()rr{s r6�flushzDontReadFromInput.flush�s��"�#S�T�Tr8c��y�NFrwr{s r6�isattyzDontReadFromInput.isatty����r8c��yryrwr{s r6�closezDontReadFromInput.close����r8c��yr�rwr{s r6�readablezDontReadFromInput.readable�r�r8c��td��)Nz0redirected stdin is pseudofile, has no seek(int)r)r|�offset�whences   r6�seekzDontReadFromInput.seek�s��"�#U�V�Vr8c��yr�rwr{s r6�seekablezDontReadFromInput.seekable�r�r8c��td��)Nz-redirected stdin is pseudofile, has no tell()rr{s r6�tellzDontReadFromInput.tell�s��"�#R�S�Sr8Nc��td��)Nzcannot truncate stdinrr�s  r6�truncatezDontReadFromInput.truncate����"�#:�;�;r8c��td��)Nzcannot write to stdinr�r|�datas  r6rnzDontReadFromInput.write�r�r8c��td��)NzCannot write to stdinr)r|�liness  r6�
writelineszDontReadFromInput.writelinesr�r8c��yr�rwr{s r6�writablezDontReadFromInput.writabler�r8c��|Sryrwr{s r6�	__enter__zDontReadFromInput.__enter__r�r8c��yryrw)r|�type�value�	tracebacks    r6�__exit__zDontReadFromInput.__exit__	s��	
r8c��|Sryrwr{s r6rBzDontReadFromInput.buffers	���r8r�)rF)r�r�r�r�)r��
int | Noner�z	list[str])r�z
Iterator[str])r�r�r��r��bool)r)r�r�r�r�r�r�ry)r�r�r�r�)r�r�r�r�)r�z
Iterable[str]r�r�)r�r)r�ztype[BaseException] | Noner�zBaseException | Noner�zTracebackType | Noner�r�)r�r
)r�r�r�r�rNr�r�r�r�r�rMr�r�r�r�r�r�r�r�rnr�r�r�r�rBrwr8r6r�r��s���
�&��&�
�
�H��
�
�V�U��
��W��T�<�<�<���
�(�
�$�
�(�	
�

�
����r8r�c�"�eZdZUded<ej
dd��Zej
dd��Zej
dd��Zej
dd��Z	ej
dd��Z
ej
d
d��Zej
dd	��Zy
)�CaptureBaser	�EMPTY_BUFFERc��t��ry��NotImplementedError�r|r!s  r6r�zCaptureBase.__init__���!�#�#r8c��t��ryr�r{s r6�startzCaptureBase.start!r�r8c��t��ryr�r{s r6�donezCaptureBase.done%r�r8c��t��ryr�r{s r6�suspendzCaptureBase.suspend)r�r8c��t��ryr�r{s r6�resumezCaptureBase.resume-r�r8c��t��ryr�r�s  r6�writeorgzCaptureBase.writeorg1r�r8c��t��ryr�r{s r6�snapzCaptureBase.snap5r�r8N�r!r�r�r�r�)r�r	r�r�)r�r	)
r�r�r��__annotations__�abc�abstractmethodr�r�r�r�r�r�r�rwr8r6r�r�s��������$��$�	���$��$�	���$��$�	���$��$�	���$��$�	���$��$�	���$��$r8r�r[r\r])r��c�H�eZdZdZd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Z	d
d�Z
y	)�	NoCapturer�c��yryrwr�s  r6r�zNoCapture.__init__@r�r8c��yryrwr{s r6r�zNoCapture.startCr�r8c��yryrwr{s r6r�zNoCapture.doneFr�r8c��yryrwr{s r6r�zNoCapture.suspendIr�r8c��yryrwr{s r6r�zNoCapture.resumeLr�r8c��y�Nr�rwr{s r6r�zNoCapture.snapOs��r8c��yryrwr�s  r6r�zNoCapture.writeorgRr�r8Nr�r�r��r�r�r�r�)r�r�r�r�r�r�r�r�r�r�r�rwr8r6r�r�=s*���L�
�
�
�
�
��
r8r�c�d�eZdZ	ddd�							d
d�Zdd�Zdd�Zdd�Zdd�Zdd	�Zdd
�Z	dd�Z
y)�SysCaptureBaseNF��teec���t|}tt|�|_||_|�1|dk(rt�}n!|s
t
�nt|j�}||_d|_	y)Nr[�initialized)
�patchsysdict�getattrr"�_oldr}r�r�r��tmpfile�_state)r|r!rr
r}s     r6r�zSysCaptureBase.__init__WsY���B���#�C��.��	���	��?��w��+�-��-0�)�+�l�4�9�9�6M�����#��r8c��dj||jt|d�xrt|j�xsd|j
|j�S�Nz(<{} {} _old={} _state={!r} tmpfile={!r}>rz<UNSET>)�formatr}rGrzrrr)r|�
class_names  r6rzzSysCaptureBase.represI��9�@�@���I�I��D�&�!�5�d�4�9�9�o�B���K�K��L�L�
�	
r8c���dj|jj|jt	|d�xrt|j�xsd|j|j�Sr)	rr�r�r}rGrzrrrr{s r6�__repr__zSysCaptureBase.__repr__nsS��9�@�@��N�N�#�#��I�I��D�&�!�5�d�4�9�9�o�B���K�K��L�L�
�	
r8c��|j|vs1Jdj||jdj|����y�Nz+cannot {} in state {!r}: expected one of {}z, �rr�join�r|�op�statess   r6�
_assert_statezSysCaptureBase._assert_statew�=���K�K�6�!�	
�8�?�?�����T�Y�Y�v�.�
�	
�!r8c��|jdd�tt|j|j�d|_y)Nr��r�started)r�setattrr"r}rrr{s r6r�zSysCaptureBase.start~s.�����7�$4�5���T�Y�Y����-���r8c���|jdd�|jdk(rytt|j|j
�|`|jj�d|_y)Nr��rr#�	suspendedr�)rrr$r"r}rrr�r{s r6r�zSysCaptureBase.done�sR�����6�#R�S��;�;�&� ����T�Y�Y��	�	�*��I���������r8c��|jdd�tt|j|j�d|_y�Nr��r#r'r')rr$r"r}rrr{s r6r�zSysCaptureBase.suspend�s.�����9�&>�?���T�Y�Y��	�	�*�!��r8c��|jdd�|jdk(rytt|j|j
�d|_y�Nr�r*r#)rrr$r"r}rr{s r6r�zSysCaptureBase.resume�s=�����8�%=�>��;�;�)�#����T�Y�Y����-���r8ry)r!r�rz
TextIO | Noner
r�r�r�)rr�r�r�r��rr�rztuple[str, ...]r�r�r�)r�r�r�r�rzrrr�r�r�r�rwr8r6rrVsU��04�$�EJ�$��$� -�$�>B�$�	
�$�
�
�
� �
�"�
 r8rc� �eZdZdZdd�Zdd�Zy)�SysCaptureBinaryr8c��|jdd�|jjd�|jjj	�}|jjd�|jj�|S�Nr�r*r�rrr�rBr�r��r|�ress  r6r�zSysCaptureBinary.snap��d�����6�#;�<������!���l�l�!�!�&�&�(�������!���������
r8c���|jdd�|jj�|jjj	|�|jjj�y�Nr�r*)rrr�rBrnr�s  r6r�zSysCaptureBinary.writeorg�sO�����:�'?�@��	�	�����	�	�����t�$��	�	����� r8N�r��bytes�r�r9r�r��r�r�r�r�r�r�rwr8r6r/r/�s���L��!r8r/c� �eZdZdZdd�Zdd�Zy)�
SysCapturer�c��|jdd�t|jt�sJ�|jj	�}|jjd�|jj
�|Sr1)rrYrr�r�r�r�r3s  r6r�zSysCapture.snap�s`�����6�#;�<��$�,�,�	�2�2�2��l�l�#�#�%�������!���������
r8c��|jdd�|jj|�|jj�yr7)rrrnr�r�s  r6r�zSysCapture.writeorg�s1�����:�'?�@��	�	������	�	���r8Nr�rr;rwr8r6r=r=�s���L��r8r=c�D�eZdZd	d�Zd
d�Zdd�Zdd�Zdd�Zdd�Zdd�Z	y)
�
FDCaptureBasec��||_	tj|�d|_tj|�|_
|dk(r8ttjd��|_t|�|_
d	|_yttd��dddd��|_|t vr#t||j�|_
d	|_yt#|�|_
d	|_y#t$r[tj
tjtj�|_tj|j|�Y��wxYw)
Nr�utf-8)rN)rTr�r�T)rNrOr�r�r)�targetfdrK�fstat�targetfd_invalidr�rJ�devnull�O_RDWR�dup2rL�
targetfd_saverr=�
syscapturervrr
r�r)r|rDs  r6r�zFDCaptureBase.__init__�s�� ��
�	)��H�H�X�� %)�D�!��V�V�H�-����q�=���
�
�W�=�D�L�0:�8�0D�D�O�$���'���*� � ��"��D�L��<�'�",�X�t�|�|�"D���$���#,�H�"5���#����E�
	5�13����
�
�B�I�I�0N�D�!��G�G�D�)�)�8�4�
	5�s�C�A E�Ec��d|jj�d|j�d|j�d|j�d|j
�d�S)N�<� z oldfd=� _state=z	 tmpfile=�>)r�r�rDrJrrr{s r6rzFDCaptureBase.__repr__�sR������'�'�(��$�-�-����@R�@R�?S�T��k�k�_�I�d�l�l�-=�Q�
@�	
r8c��|j|vs1Jdj||jdj|����yrrrs   r6rzFDCaptureBase._assert_state�r r8c���|jdd�tj|jj	�|j
�|jj�d|_y)z4Start capturing on targetfd using memorized tmpfile.r�r"r#N)	rrKrIrrMrDrKr�rr{s r6r�zFDCaptureBase.start�sI�����7�$4�5�
������#�#�%�t�}�}�5���������r8c��|jdd�|jdk(rytj|j|j
�tj|j�|j�W|j|j
k7rtj|j
�tj|j�|jj�|jj
�d|_y)z_Stop capturing, restore streams, return original capture file,
        seeked to position zero.r�r&N)rrrKrIrJrDr�rFrKr�rr{s r6r�zFDCaptureBase.done�s���	
���6�#R�S��;�;�&� ��
����"�"�D�M�M�2�
����#�#�$�� � �,��$�$��
�
�5�������'��H�H�T�*�*�+���������������r8c���|jdd�|jdk(ry|jj�t	j
|j|j�d|_yr))rrrKr�rKrIrJrDr{s r6r�zFDCaptureBase.suspend
sQ�����9�&>�?��;�;�+�%�������!�
����"�"�D�M�M�2�!��r8c��|jdd�|jdk(ry|jj�t	j
|jj�|j�d|_yr,)	rrrKr�rKrIrrMrDr{s r6r�zFDCaptureBase.resumesX�����8�%=�>��;�;�)�#������� �
������#�#�%�t�}�}�5���r8N)rDr�r�r�r�r-r�)
r�r�r�r�rrr�r�r�r�rwr8r6rArA�s&��'$�R
�
� �� "� r8rAc�$�eZdZdZdZdd�Zdd�Zy)�FDCaptureBinaryzWCapture IO to/from a given OS-level file descriptor.

    snap() produces `bytes`.
    r8c��|jdd�|jjd�|jjj	�}|jjd�|jj�|Sr1r2r3s  r6r�zFDCaptureBinary.snap#r5r8c�h�|jdd�tj|j|�y)�"Write to original file descriptor.r�r*N)rrKrnrJr�s  r6r�zFDCaptureBinary.writeorg+s'�����:�'?�@�
����#�#�T�*r8Nr8r:�r�r�r��__doc__r�r�r�rwr8r6rWrWs���
�L��+r8rWc�$�eZdZdZdZdd�Zdd�Zy)�	FDCapturezTCapture IO to/from a given OS-level file descriptor.

    snap() produces text.
    r�c��|jdd�|jjd�|jj�}|jjd�|jj	�|Sr1)rrr�r�r�r3s  r6r�zFDCapture.snap9s^�����6�#;�<������!���l�l���!�������!���������
r8c��|jdd�tj|j|j	d��y)rZr�r*rCN)rrKrnrJ�encoder�s  r6r�zFDCapture.writeorgAs0�����:�'?�@�
����#�#�T�[�[��%9�:r8Nr�rr[rwr8r6r^r^1s���
�L��;r8r^)��c�&�eZdZUdZded<ded<y)�
CaptureResult�OThe result of :method:`caplog.readouterr() <pytest.CaptureFixture.readouterr>`.r	rrrsN)r�r�r�r\r�rwr8r6rereNs��]�
��
�r8rec��eZdZdZdZy)rerfrwN)r�r�r�r\r�rwr8r6rereWs
��	^��	r8rrrsc�n�eZdZdZdZ								dd�Zd
d�Zdd�Zdd�Zddd�Z	dd�Z
dd	�Zdd
�Zdd�Z
y)�MultiCaptureNFc�.�||_||_||_yry��in_rrrs)r|rlrrrss    r6r�zMultiCapture.__init__ds��03���/2���/2��r8c��d|j�d|j�d|j�d|j�d|j�d�S)Nz<MultiCapture out=z err=z in_=rOz _in_suspended=rP)rrrsrlr�
_in_suspendedr{s r6rzMultiCapture.__repr__nsJ�� �����E�$�(�(��U�4�8�8�,�O��k�k�_�O�D�4F�4F�3I��
L�	
r8c��d|_|jr|jj�|jr|jj�|jr|jj�yy)Nr#)rrlr�rrrsr{s r6�start_capturingzMultiCapture.start_capturingtsM������8�8��H�H�N�N���8�8��H�H�N�N���8�8��H�H�N�N��r8c���|j�\}}|r)|j�J�|jj|�|r)|j�J�|jj|�||fS)z?Pop current snapshot out/err capture and flush to orig streams.)�
readouterrrrr�rs�r|rrrss   r6�pop_outerr_to_origzMultiCapture.pop_outerr_to_orig}se���?�?�$���S���8�8�'�'�'��H�H���c�"���8�8�'�'�'��H�H���c�"��C�x�r8c��d|_|jr|jj�|jr|jj�|r/|jr"|jj�d|_yyy)Nr'T)rrrr�rsrlrn�r|rls  r6�suspend_capturingzMultiCapture.suspend_capturing�s_��!����8�8��H�H�����8�8��H�H�����4�8�8��H�H����!%�D���3r8c�"�d|_|jr|jj�|jr|jj�|jr0|j
�J�|j
j�d|_yy)Nr#F)rrrr�rsrnrlr{s r6�resume_capturingzMultiCapture.resume_capturing�sg������8�8��H�H�O�O���8�8��H�H�O�O������8�8�'�'�'��H�H�O�O��!&�D��r8c�,�|jdk(rtd��d|_|jr|jj�|jr|jj�|j
r|j
j�yy)z+Stop capturing and reset capturing streams.�stoppedzwas already stoppedN)r�
ValueErrorrrr�rsrlr{s r6�stop_capturingzMultiCapture.stop_capturing�sb���;�;�)�#��2�3�3�����8�8��H�H�M�M�O��8�8��H�H�M�M�O��8�8��H�H�M�M�O�r8c� �|jdk(S)z7Whether actively capturing -- not suspended or stopped.r#)rr{s r6�
is_startedzMultiCapture.is_started�s���{�{�i�'�'r8c��|jr|jj�nd}|jr|jj�nd}t||�Sr)rrr�rsrerss   r6rrzMultiCapture.readouterr�s=��!%���d�h�h�m�m�o�r��!%���d�h�h�m�m�o�r���S�#�&�&r8)rl�CaptureBase[AnyStr] | Nonerrr�rsr�r�r�r�r�)r�ztuple[AnyStr, AnyStr]�F�rlr�r�r�r��r�zCaptureResult[AnyStr])r�r�r�rrnr�rrprtrwryr}rrrrwr8r6riri`s_��
�F��M�3�
'�3�(�3�(�	3�

�3�
��	�&�	'�
�(�'r8ric�N�|dk(r)ttd�td�td���S|dk(r)ttd�td�td���S|dk(rtddd��S|dk(r$tdtdd	�
�tdd	�
���Std|����)Nr!rr�r�rkr"r#r$Tr	zunknown capturing method: )rir^r=r|)r(s r6�_get_multicapturer��s���
��~��	�!��)�A�,�I�a�L�Q�Q�	�5���
�1�
�:�a�=�j�QR�m�T�T�	�4����$�D�9�9�	�9�	���*�Q�D�1�z�!��7N�
�	
��1�&��<�
=�=r8c��eZdZdZdd�Zd d�Zd!d�Zd"d�Zd#d�Zd#d�Z	d#d�Z
d$d%d	�Zd$d%d
�Zd#d�Z
d&d�Zd'd
�Zd#d�Zd#d�Zd#d�Zd#d�Zd#d�Zej,d(d��Zej,d)d��Zed��				d*d��Zed��d+d��Zed��d+d��Zed��d+d��Zed��d#d��Zed��d#d��Zy),rfa�The capture plugin.

    Manages that the appropriate capture method is enabled/disabled during
    collection and each test phase (setup, call, teardown). After each of
    those points, the captured output is obtained and attached to the
    collection/runtest report.

    There are two levels of capture:

    * global: enabled by default and can be suppressed by the ``-s``
      option. This is always enabled/disabled during collection and each test
      phase.

    * fixture: when a test function or one of its fixture depend on the
      ``capsys`` or ``capfd`` fixtures. In this case special handling is
      needed to ensure the fixtures take precedence over the global capture.
    c�.�||_d|_d|_yry��_method�_global_capturing�_capture_fixture)r|r(s  r6r�zCaptureManager.__init__�s��$���;?���<@��r8c�V�d|j�d|j�d|j�d�S)Nz<CaptureManager _method=z _global_capturing=z _capture_fixture=rPr�r{s r6rzCaptureManager.__repr__�s:��&�t�|�|�&6�6I�$�J`�J`�Ic�d � $� 5� 5�8��
;�	
r8c��|j�ry|jr#d|jjj��Sy)N�globalzfixture F)�is_globally_capturingr��request�fixturenamer{s r6�is_capturingzCaptureManager.is_capturing�s=���%�%�'��� � ��d�3�3�;�;�G�G�H�I�I�r8c� �|jdk7S)Nr#)r�r{s r6r�z$CaptureManager.is_globally_capturing�s���|�|�t�#�#r8c��|j�J�t|j�|_|jj�yry)r�r�r�rpr{s r6rjz%CaptureManager.start_global_capturing�s7���%�%�-�-�-�!2�4�<�<�!@������.�.�0r8c��|j�<|jj�|jj�d|_yyry)r�rtr}r{s r6riz$CaptureManager.stop_global_capturing�s?���!�!�-��"�"�5�5�7��"�"�1�1�3�%)�D�"�.r8c�R�|j�|jj�yyry)r�ryr{s r6�resume_global_capturez$CaptureManager.resume_global_capture�s'���!�!�-��"�"�3�3�5�.r8c�V�|j�|jj|��yy)N�rl)r�rwrvs  r6rkz%CaptureManager.suspend_global_captures*���!�!�-��"�"�4�4��4�=�.r8c�F�|j�|j|�yry)�suspend_fixturerkrvs  r6r�zCaptureManager.suspends�������#�#�C�(r8c�D�|j�|j�yry)r��resume_fixturer{s r6r�zCaptureManager.resume	s���"�"�$����r8c�R�|j�J�|jj�Sry)r�rrr{s r6rmz"CaptureManager.read_global_capture
s)���%�%�1�1�1��%�%�0�0�2�2r8c���|jrX|jjj}|jj}|jjd|�d|�d��||_y)Nzcannot use z and z at the same time)r�r�r��
raiseerror)r|�capture_fixture�current_fixture�requested_fixtures    r6�set_fixturezCaptureManager.set_fixturesh��� � �"�3�3�;�;�G�G�O� /� 7� 7� C� C���#�#�.�.��/�0��o�5F�FW�X�
�!0��r8c��d|_yry)r�r{s r6�
unset_fixturezCaptureManager.unset_fixtures
�� $��r8c�R�|jr|jj�yy)z|If the current item is using ``capsys`` or ``capfd``, activate
        them so they take precedence over the global capture.N)r��_startr{s r6�activate_fixturezCaptureManager.activate_fixtures$��� � ��!�!�(�(�*�!r8c�R�|jr|jj�yy)zDDeactivate the ``capsys`` or ``capfd`` fixture of this item, if any.N)r�r�r{s r6�deactivate_fixturez!CaptureManager.deactivate_fixture%s"��� � ��!�!�'�'�)�!r8c�R�|jr|jj�yyry)r��_suspendr{s r6r�zCaptureManager.suspend_fixture*s"��� � ��!�!�*�*�,�!r8c�R�|jr|jj�yyry)r��_resumer{s r6r�zCaptureManager.resume_fixture.s"��� � ��!�!�)�)�+�!r8c#�K�|jxr|jj�}|r|j�|jxr|jj	�}|r|j�	d��|r|j
�|r|j�yy#|r|j
�|r|j�wwxYw�w)zLContext manager to temporarily disable global and current fixture capturing.N)r��_is_startedr�r�rrkr�r�)r|�
do_fixture�	do_globals   r6�global_and_fixture_disabledz*CaptureManager.global_and_fixture_disabled4s������*�*�R�t�/D�/D�/P�/P�/R�
��� � �"��*�*�R�t�/E�/E�/P�/P�/R�	���'�'�)�	&����*�*�,���#�#�%�����*�*�,���#�#�%��s�A5C�8B"�<&C�"'C	�	Cc#��K�|j�|j�	d��|j�|jd��|j	�\}}|j|d|�|j|d|�y#|j�|jd��|j	�\}}|j|d|�|j|d|�wxYw�w)NFr�r\r])r�r�r�rkrm�add_report_section)r|�when�itemrrrss     r6�item_capturezCaptureManager.item_captureEs������"�"�$�����	9���#�#�%��'�'�E�'�2��/�/�1�H�C���#�#�D�(�C�8��#�#�D�(�C�8��
�#�#�%��'�'�E�'�2��/�/�1�H�C���#�#�D�(�C�8��#�#�D�(�C�8�s�!C$�B�AC$�AC!�!C$Tr`c#�PK�t|t�rx|j�	d��}|j�|j	�\}}|r|j
j
d|f�|r|j
j
d|f�|Sd��}|S#|j�wxYw�w)NzCaptured stdoutzCaptured stderr)rYrr�rkrm�sections�append)r|�	collector�reprrrss     r6�pytest_make_collect_reportz)CaptureManager.pytest_make_collect_reportUs������i��&��&�&�(�
.����+�+�-��/�/�1�H�C������#�#�%6��$<�=�����#�#�%6��$<�=��
��C��
���+�+�-�s�!B&�B�A)B&�B#�#B&c#�bK�|jd|�5d��cddd�S#1swYyxYw�w)N�setup�r��r|r�s  r6�pytest_runtest_setupz#CaptureManager.pytest_runtest_setuphs-����
�
�
�w��
-�	��	�	�	���/�#�
/�,�/c#�bK�|jd|�5d��cddd�S#1swYyxYw�w)N�callr�r�s  r6�pytest_runtest_callz"CaptureManager.pytest_runtest_callms-����
�
�
�v�t�
,�	��	�	�	�r�c#�bK�|jd|�5d��cddd�S#1swYyxYw�w)N�teardownr�r�s  r6�pytest_runtest_teardownz&CaptureManager.pytest_runtest_teardownrs-����
�
�
�z�4�
0�	��	�	�	�r�)�tryfirstc�$�|j�yry�rir{s r6�pytest_keyboard_interruptz(CaptureManager.pytest_keyboard_interruptw����"�"�$r8c�$�|j�yryr�r{s r6�pytest_internalerrorz#CaptureManager.pytest_internalerror{r�r8N)r(�_CaptureMethodr�r�r�)r�z
str | boolr�r�r�r�)r�zCaptureResult[str])r�zCaptureFixture[Any]r�r��r��Generator[None])r�r�r�rr�r�)r�rr�z-Generator[None, CollectReport, CollectReport])r�rr�r�) r�r�r�r\r�rr�r�rjrir�rkr�r�rmr�r�r�r�r�r��
contextlib�contextmanagerr�r�rr�r�r�r�r�r�rwr8r6rfrf�s7���$A�

��$�1�
*�6�>�)�
�3�0�%�+�*�
-�,����&��&� ���9��9��d���"��	6����$�d������d������d������t��%��%��t��%��%r8rfc��eZdZdZdd�							d
d�Zdd�Zdd�Zdd�Zdd�Zdd	�Z	dd
�Z
ejdd��Z
y)�CaptureFixturez|Object returned by the :fixture:`capsys`, :fixture:`capsysbinary`,
    :fixture:`capfd` and :fixture:`capfdbinary` fixtures.F��	_ispytestc��t|�||_||_d|_|jj|_|jj|_yry)r�captureclassr��_capturer��
_captured_out�
_captured_err)r|r�r�r�s    r6r�zCaptureFixture.__init__�sJ��	�y�!�7C������59��
�%)�%6�%6�%C�%C���%)�%6�%6�%C�%C��r8c��|j�Ltd|jd�|jd���|_|jj�yy)Nr�r�rk)r�rir�rpr{s r6r�zCaptureFixture._start�sN���=�=� �(���%�%�a�(��%�%�a�(��D�M�

�M�M�)�)�+�
!r8c���|j�i|jj�\}}|xj|z
c_|xj|z
c_|jj	�d|_yyry)r�rtr�r�r}rss   r6r�zCaptureFixture.close�s`���=�=�$��}�}�7�7�9�H�C�����#�%�����#�%���M�M�(�(�*� �D�M�%r8c��|j|j}}|j�'|jj�\}}||z
}||z
}|jj
|_|jj
|_t
||�S)z�Read and return the captured output so far, resetting the internal
        buffer.

        :returns:
            The captured content as a namedtuple with ``out`` and ``err``
            string attributes.
        )r�r�r�rrr�r�re)r|�captured_out�captured_errrrrss     r6rrzCaptureFixture.readouterr�s���&*�%7�%7��9K�9K�l���=�=�$��}�}�/�/�1�H�C���C��L��C��L�!�.�.�;�;���!�.�.�;�;����\�<�8�8r8c�R�|j�|jj�yy)z1Suspend this fixture's own capturing temporarily.N)r�rwr{s r6r�zCaptureFixture._suspend�s!���=�=�$��M�M�+�+�-�%r8c�R�|j�|jj�yy)z0Resume this fixture's own capturing temporarily.N)r�ryr{s r6r�zCaptureFixture._resume�s!���=�=�$��M�M�*�*�,�%r8c�P�|j�|jj�Sy)z5Whether actively capturing -- not disabled or closed.F)r�rr{s r6r�zCaptureFixture._is_started�s"���=�=�$��=�=�+�+�-�-�r8c#�K�|jjjjd�}|j	�5d��ddd�y#1swYyxYw�w)z>Temporarily disable capturing while inside the ``with`` block.rcN)r��configre�	getpluginr�)r|�
capmanagers  r6�disabledzCaptureFixture.disabled�sP����&*�\�\�%8�%8�%F�%F�%P�%P��&
�
��
3�
3�
5�	��	�	�	�s�AA�A�	A�A�AN)r�ztype[CaptureBase[AnyStr]]r�rr�r�r�r�r�r�r�r�)r�r�r�r\r�r�r�rrr�r�r�r�r�r�rwr8r6r�r��st��=� �D�/�D��D�
�D�
�
D�,�!�9�".�
-�
������r8r�c#�K�|jjjd�}tt|d��}|j|�|j
�|��|j�|j�y�w)aEnable text capturing of writes to ``sys.stdout`` and ``sys.stderr``.

    The captured output is made available via ``capsys.readouterr()`` method
    calls, which return a ``(out, err)`` namedtuple.
    ``out`` and ``err`` will be ``text`` objects.

    Returns an instance of :class:`CaptureFixture[str] <pytest.CaptureFixture>`.

    Example:

    .. code-block:: python

        def test_output(capsys):
            print("hello")
            captured = capsys.readouterr()
            assert captured.out == "hello\n"
    rcTr�N)	r�rer�r�r=r�r�r�r��r�rqr�s   r6�capsysr��si����&%�^�^�9�9�C�C�DT�U�F�$�Z��D�I�O�
����'�����
������
������A>Bc#�K�|jjjd�}tt|d��}|j|�|j
�|��|j�|j�y�w)a'Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``.

    The captured output is made available via ``capsysbinary.readouterr()``
    method calls, which return a ``(out, err)`` namedtuple.
    ``out`` and ``err`` will be ``bytes`` objects.

    Returns an instance of :class:`CaptureFixture[bytes] <pytest.CaptureFixture>`.

    Example:

    .. code-block:: python

        def test_output(capsysbinary):
            print("hello")
            captured = capsysbinary.readouterr()
            assert captured.out == b"hello\n"
    rcTr�N)	r�rer�r�r/r�r�r�r�r�s   r6�capsysbinaryr��sj����&%�^�^�9�9�C�C�DT�U�F�$�%5�w�$�O�O�
����'�����
������
����r�c#�K�|jjjd�}tt|d��}|j|�|j
�|��|j�|j�y�w)aEnable text capturing of writes to file descriptors ``1`` and ``2``.

    The captured output is made available via ``capfd.readouterr()`` method
    calls, which return a ``(out, err)`` namedtuple.
    ``out`` and ``err`` will be ``text`` objects.

    Returns an instance of :class:`CaptureFixture[str] <pytest.CaptureFixture>`.

    Example:

    .. code-block:: python

        def test_system_echo(capfd):
            os.system('echo "hello"')
            captured = capfd.readouterr()
            assert captured.out == "hello\n"
    rcTr�N)	r�rer�r�r^r�r�r�r�r�s   r6�capfdr�	si����&%�^�^�9�9�C�C�DT�U�F�$�Y��4�H�O�
����'�����
������
����r�c#�K�|jjjd�}tt|d��}|j|�|j
�|��|j�|j�y�w)a-Enable bytes capturing of writes to file descriptors ``1`` and ``2``.

    The captured output is made available via ``capfd.readouterr()`` method
    calls, which return a ``(out, err)`` namedtuple.
    ``out`` and ``err`` will be ``byte`` objects.

    Returns an instance of :class:`CaptureFixture[bytes] <pytest.CaptureFixture>`.

    Example:

    .. code-block:: python

        def test_system_echo(capfdbinary):
            os.system('echo "hello"')
            captured = capfdbinary.readouterr()
            assert captured.out == b"hello\n"

    rcTr�N)	r�rer�r�rWr�r�r�r�r�s   r6�capfdbinaryr�%si����(%�^�^�9�9�C�C�DT�U�F�$�_�g��N�O�
����'�����
������
����r�)r4rr�r�r�)rUrr�r�)rorr�r�)r(r�r�zMultiCapture[str])r�rr�zGenerator[CaptureFixture[str]])r�rr�z Generator[CaptureFixture[bytes]])Or\�
__future__rr��collectionsr�rHrrKr"�tempfiler�typesr�typingrr	r
rrr
rrrrrrr�typing_extensionsr�_pytest.configrr�_pytest.config.argparsingr�_pytest.deprecatedr�_pytest.fixturesrr�
_pytest.nodesrrr�_pytest.reportsrr�r7r?r_rtrIrvr�r�r��ABCr�r
r�r�rr9r/r=rArWr^�version_infore�
namedtuplerir�rfr�r�r�r�r�rwr8r6�<module>rsj��1�"�
���	�#�	�
�"�������������� ��&�!�#�,�-�$�'�#���)��5�6���&�41�n
�$�����:
1�"�"�"�
1� 6�� � �6�$�9�$�J��J�`$�#�'�'�7�6�?�$�@�x�H�5��
��C� �
�2@ �[��(�@ �F!�~�e�,�!�$���$��"\ �K��'�\ �~+�m�E�*�+�,;�
�c�"�;�6���w��-�
��
�G�F�O�������������?�����Q'�7�6�?�Q'�h>�"x%�x%�vK�W�V�_�K�b	��	��6	��	��6	��	��6	��	�r8

Youez - 2016 - github.com/yon3zu
LinuXploit