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.opt-1.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�ZFORMATz�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�optionsZ
add_optionr)r�parserr)�	__class__rrr%s
zTAP.optionscs:tt|��||�|jr.t|j|j|jd�|_|j	|_
dS)N)ZoutdirZcombined�	streaming)rr�	configureZenabledr
Z
tap_outdirZtap_combinedZ
tap_stream�trackerZ
tap_format�_format)rrZconf)r!rrr#:sz
TAP.configurecCs|j��dS)N)r$Zgenerate_tap_reports)rZresultsrrr�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�_descriptionZadd_skip)r�test�errZerr_cls�reasonrr)rrr�addErrorMs


zTAP.addErrorcCs,t�|�}|jj|�|�|�|�|d�dS)N)r))rr*r$r+r,r-)rr.r/r)rrr�
addFailureXs
zTAP.addFailurecCs|j�|�|�|�|��dS)N)r$Zadd_okr,r-)rr.rrr�
addSuccess^szTAP.addSuccesscCs t|t�r|jjS|jjjSdS)N)�
isinstancer
�contextrr.r!)rr.rrrr,as
z
TAP._cls_namecCs`|jrPy|jjt|�|��pdd�Stk
rNt�td�j|jd��YnX|��p^t|�S)Nr)Zmethod_nameZshort_descriptionz^Bad format string: {format}
Replacement options are: {{short_description}} and {{method_name}})�format)r%r6�strZshortDescription�KeyError�sys�exitr)rr.rrrr-kszTAP._description)rrrr�name�os�environrr#r&r(r1r2r3r,r-�
__classcell__rr)r!rr s
r)r<r9Zunittestr�ImportError�objectZnose.pluginsr	Z
nose.suiter
rrZtap.i18nrZtap.trackerr
rrrrrr�<module>s