Your IP : 216.73.216.213


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

B

.��V
�@s�ddlZddlZyddlmZWn$ek
rDGdd�de�ZYnXddlmZddlm	Z	ddl
mZddlm
Z
dd	lmZGd
d�de�ZGdd
�d
e�ZdS)�N)�SkipTestc@seZdZdZdS)rz/SkipTest does not exist earlier than Python 2.7N)�__name__�
__module__�__qualname__�__doc__�rr�B/opt/alt/python37/lib/python3.7/site-packages/tap/plugins/_nose.pyr	sr)�Plugin)�ContextSuite)�	formatter)�_)�Trackerc@s$eZdZdd�Zdd�Zdd�ZdS)�DummyStreamcGsdS)Nr)�self�argsrrr�writeszDummyStream.writecGsdS)Nr)rrrrr�writelnszDummyStream.writelncCsdS)Nr)rrrr�flushszDummyStream.flushN)rrrrrrrrrrrsrcsneZdZdZdZejf�fdd�	Z�fdd�Zdd�Z	d	d
�Z
dd�Zd
d�Zdd�Z
dd�Zdd�Z�ZS)�TAPzLThis plugin provides test results in the Test Anything Protocol format.
    �tapcsntt|�j||d�|jdddtd�d�|jddtd	�d
�|jdddtd�d�|jd
ddtd�d�dS)N)�envz--tap-streamF�
store_truez<Stream TAP output instead of the default test runner output.)�default�action�helpz--tap-outdir�PATHzhAn optional output directory to write TAP files to. If the directory does not exist, it will be created.)�metavarrz--tap-combinedz7Store all TAP test results into a combined output file.z--tap-format��FORMATz�An optional format string for the TAP output. The format options are: {short_description} for the short description, and {method_name} for the test method name.)rrr)�superr�options�
add_optionr)r�parserr)�	__class__rrr %s
zTAP.optionscs:tt|��||�|jr.t|j|j|jd�|_|j	|_
dS)N)�outdir�combined�	streaming)rr�	configure�enabledr
Z
tap_outdirZtap_combinedZ
tap_stream�trackerZ
tap_format�_format)rr Zconf)r#rrr':sz
TAP.configurecCs|j��dS)N)r)�generate_tap_reports)r�resultsrrr�finalizeBszTAP.finalizecCs|jjr||j_t�S|S)N)r)r&�streamr)rr.rrr�setOutputStreamEszTAP.setOutputStreamcCs\|\}}}|tkr<t�|�}|jj|�|�|�|�|d�n|j�|�|�|�|�|�dS)N)�diagnostics)rr�format_exceptionr)�
add_not_ok�	_cls_name�_description�add_skip)r�test�errZerr_cls�reasonrr0rrr�addErrorMs


zTAP.addErrorcCs,t�|�}|jj|�|�|�|�|d�dS)N)r0)rr1r)r2r3r4)rr6r7r0rrr�
addFailureXs
zTAP.addFailurecCs|j�|�|�|�|��dS)N)r)�add_okr3r4)rr6rrr�
addSuccess^szTAP.addSuccesscCs t|t�r|jjS|jjjSdS)N)�
isinstancer
�contextrr6r#)rr6rrrr3as
z
TAP._cls_namecCs`|jrPy|jjt|�|��pdd�Stk
rNt�td�j|jd��YnX|��p^t|�S)Nr)�method_name�short_descriptionz^Bad format string: {format}
Replacement options are: {{short_description}} and {{method_name}})�format)r*rA�str�shortDescription�KeyError�sys�exitr)rr6rrrr4kszTAP._description)rrrr�name�os�environr r'r-r/r9r:r<r3r4�
__classcell__rr)r#rr s
r)rHrE�unittestr�ImportError�objectZnose.pluginsr	Z
nose.suiter
rr�tap.i18nr�tap.trackerr
rrrrrr�<module>s