HEX
Server: LiteSpeed
System: Linux ws4.angoweb.net 5.14.0-611.13.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 11 04:57:59 EST 2025 x86_64
User: tswangoe (2287)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, phpinfo, popen, proc_open
Upload Files
File: //opt/alt/python37/lib/python3.7/site-packages/nose/plugins/__pycache__/capture.cpython-37.pyc
B

'
�Gn�4�@sndZddlZddlZddlZddlmZddlmZmZddl	m
Z
ddlmZe�
e�ZGdd�de�ZdS)	a_
This plugin captures stdout during test execution. If the test fails
or raises an error, the captured output will be appended to the error
or failure output. It is enabled by default but can be disabled with
the options ``-s`` or ``--nocapture``.

:Options:
  ``--nocapture``
    Don't capture stdout (any stdout output will be printed immediately)

�N)�Plugin)�exc_to_unicode�
force_unicode)�ln)�StringIOc@s�eZdZdZdZdZdZdZdd�Zdd	�Z	d
d�Z
dd
�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd�Zeed d d!�Zd S)"�Capturea
    Output capture plugin. Enabled by default. Disable with ``-s`` or
    ``--nocapture``. This plugin captures stdout during test execution,
    appending any output captured to the error or failure output,
    should the test fail or raise an error.
    TZNOSE_NOCAPTURE�capturei@cCsg|_d|_dS)N)�stdout�_buf)�self�r�E/opt/alt/python37/lib/python3.7/site-packages/nose/plugins/capture.py�__init__#szCapture.__init__cCs$|jddd|�|j�ddd�dS)z%Register commandline options
        z-sz--nocapture�store_falserzUDon't capture stdout (any stdout output will be printed immediately) [NOSE_NOCAPTURE])�action�default�dest�helpN)�
add_option�get�env_opt)r�parser�envrrr
�options'szCapture.optionscCs||_|jsd|_dS)z8Configure plugin. Plugin is enabled by default.
        FN)�confr�enabled)rrrrrr
�	configure0szCapture.configurecCs|��d|_dS)zClear capture buffer.
        N)�endr
)r�testrrr
�	afterTest7szCapture.afterTestcCs|��dS)z0Replace sys.stdout with capture buffer.
        N)�start)rrrr
�begin=sz
Capture.begincCs|��dS)zFlush capture buffer.
        N)r )rrrrr
�
beforeTestBszCapture.beforeTestcCs6|j|_}d|_|s|S|\}}}||�||�|fS)z-Add captured output to error report.
        N)�bufferZcapturedOutputr
�addCaptureToErr)rr�err�outputZec�ev�tbrrr
�formatErrorGs
zCapture.formatErrorcCs|�||�S)z/Add captured output to failure report.
        )r))rrr%rrr
�
formatFailureTszCapture.formatFailurecCs*t|�}t|�}d�|td�|td�g�S)N�
z>> begin captured stdout <<z>> end captured stdout <<)rr�joinr)rr'r&rrr
r$YszCapture.addCaptureToErrcCs"|j�tj�t�|_|jt_dS)N)r	�append�sysrr
)rrrr
r _sz
Capture.startcCs|jr|j��t_dS)N)r	�popr.)rrrr
rdszCapture.endcCsx|jr|��qWdS)zRestore stdout.
        N)r	r)r�resultrrr
�finalizehszCapture.finalizecCs|jdk	r|j��SdS)N)r
�getvalue)rrrr
�_get_bufferns
zCapture._get_bufferNzCaptured stdout output.)�__name__�
__module__�__qualname__�__doc__rr�name�scorerrrrr!r"r)r*r$r rr1r3�propertyr#rrrr
rs(	
r)r7�logging�osr.Znose.plugins.baserZnose.pyversionrrZ	nose.utilr�ior�	getLoggerr4�logrrrrr
�<module>s