Your IP : 216.73.216.85


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.opt-1.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�trackerZgenerate_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	�addSkiprZadd_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	�addUnexpectedSuccessrrrrr)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�)Zmethod_nameZshort_descriptionz^Bad format string: {format}
Replacement options are: {{short_description}} and {{method_name}})�format)�FORMATr&�strZshortDescription�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r5rrr�
set_streameszTAPTestRunner.set_streamcCs|�|j|j|j�}t|_|S)N)�resultclassr
rrr4r)r�resultrrr�_makeResultnszTAPTestRunner._makeResultcCs
|t_dS)ziSet the output directory so that TAP files are written to the
        specified outdir location.
        N)r4�outdir)�clsr;rrr�
set_outdirtszTAPTestRunner.set_outdircCs
|t_dS)z,Set the tracker to use a single output file.N)r4�combined)r<r>rrr�set_combined|szTAPTestRunner.set_combinedcCs
|t_dS)zSet the header display flag.N)r4�header)r<r@rrr�
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')r<Zfmtrrr�
set_format�szTAPTestRunner.set_formatN)
r$r,r-�__doc__r	r8r7r:�classmethodr=r?rArBrrrrr/_s	r/)r2Zunittestrr*r�ImportErrorrZunittest.runnerrZtaprZtap.i18nrZtap.trackerrr	r4r/rrrr�<module>s E