Your IP : 216.73.216.196


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

B

.��V4�@s�ddlZddlmZddlZyddlmZWn ek
rLddlmZYnXyddlmZWn ek
r~ddlmZYnXddl	m
Z
ddlmZddl
mZGd	d
�d
e�Ze�ZGdd�de�ZdS)
�N)�TextTestRunner)�TextTestResult)�_TextTestResult)�_WritelnDecorator)�	formatter)�_)�Trackercs�eZdZdZ�fdd�Z�fdd�Z�fdd�Z�fdd	�Z�fd
d�Z�fdd
�Z	�fdd�Z
�fdd�Zdd�Zdd�Z
�ZS)�
TAPTestResultNcstt|��|||�dS)N)�superr	�__init__)�self�stream�descriptions�	verbosity)�	__class__��;/opt/alt/python37/lib/python3.7/site-packages/tap/runner.pyrszTAPTestResult.__init__cstt|���|j��dS)z>Once the test run is complete, generate each of the TAP files.N)r
r	�stopTestRun�tracker�generate_tap_reports)r)rrrrszTAPTestResult.stopTestRuncs>tt|��||�t�|�}|jj|�|�|�|�|d�dS)N)�diagnostics)	r
r	�addErrorr�format_exceptionr�
add_not_ok�	_cls_name�_description)r�test�errr)rrrr#s

zTAPTestResult.addErrorcs>tt|��||�t�|�}|jj|�|�|�|�|d�dS)N)r)	r
r	�
addFailurerrrrrr)rrrr)rrrr*s

zTAPTestResult.addFailurecs.tt|��|�|j�|�|�|�|��dS)N)r
r	�
addSuccessr�add_okrr)rr)rrrr1szTAPTestResult.addSuccesscs2tt|��||�|j�|�|�|�|�|�dS)N)r
r	�addSkipr�add_skiprr)rr�reason)rrrr!5szTAPTestResult.addSkipcsDtt|��||�t�|�}|jj|�|�|�|�t	d�|d�dS)Nz(expected failure))r)
r
r	�addExpectedFailurerrrrrrr)rrrr)rrrr$:s

z TAPTestResult.addExpectedFailurecs4tt|��|�|j�|�|�|�|�td��dS)Nz(unexpected success))r
r	�addUnexpectedSuccessrr rrr)rr)rrrr%Asz"TAPTestResult.addUnexpectedSuccesscCs|jjS)N)r�__name__)rrrrrrFszTAPTestResult._cls_namecCs`|jrPy|jjt|�|��pdd�Stk
rNt�td�j|jd��YnX|��p^t|�S)N�)�method_name�short_descriptionz^Bad format string: {format}
Replacement options are: {{short_description}} and {{method_name}})�format)�FORMATr*�str�shortDescription�KeyError�sys�exitr)rrrrrrIszTAPTestResult._description)r&�
__module__�__qualname__r+rrrrrr!r$r%rr�
__classcell__rr)rrr	sr	c@sTeZdZdZeZdd�Zdd�Zedd��Z	edd	��Z
ed
d��Zedd
��ZdS)�
TAPTestRunnerzzA test runner that will behave exactly like TextTestRunner and will
    additionally generate TAP files for each test casecCs$tttjd��|_|t_tjt_dS)z�Set the streaming boolean option to stream TAP directly to stdout.

        The test runner default output will be suppressed in favor of TAP.
        �wN)	r�open�os�devnullr
�_tracker�	streamingr/�stdout)rr:rrr�
set_streameszTAPTestRunner.set_streamcCs|�|j|j|j�}t|_|S)N)�resultclassr
rrr9r)r�resultrrr�_makeResultnszTAPTestRunner._makeResultcCs
|t_dS)ziSet the output directory so that TAP files are written to the
        specified outdir location.
        N)r9�outdir)�clsr@rrr�
set_outdirtszTAPTestRunner.set_outdircCs
|t_dS)z,Set the tracker to use a single output file.N)r9�combined)rArCrrr�set_combined|szTAPTestRunner.set_combinedcCs
|t_dS)zSet the header display flag.N)r9�header)rArErrr�
set_header�szTAPTestRunner.set_headercCs
|t_dS)z�Set the format of each test line.

        The format string can use:
        * {method_name}: The test method name
        * {short_description}: The test's docstring short description
        N)r	r+)rA�fmtrrr�
set_format�szTAPTestRunner.set_formatN)
r&r1r2�__doc__r	r=r<r?�classmethodrBrDrFrHrrrrr4_s	r4)r7�unittestrr/r�ImportErrorrZunittest.runnerr�tapr�tap.i18nr�tap.trackerrr	r9r4rrrr�<module>s E