U
    n5{iP
  ã                   @   sŽ   d Z ddlmZ ddlmZmZmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZmZ eeeeeef f ZeeƒG d	d
„ d
e
eƒƒƒZdS )z«
The reporter is not made to support concurrent test running, so we will
hold test results in here and only send them to the reporter once the
test is over.

@since: 12.3
é    )ÚTracebackType)ÚOptionalÚTupleÚUnion)Úimplementer)ÚproxyForInterface)ÚFailureé   )Ú	IReporterÚ	ITestCasec                       sˆ   e Zd ZdZ‡ fdd„Zdd„ Zeeddœdd	„Zeedd
œdd„Z	dd„ Z
ddd„Zdeeee ddœdd„Zdd„ Zdd„ Z‡  ZS )ÚDistReporterz
    See module docstring.
    c                    s   t ƒ  |¡ i | _d S )N)ÚsuperÚ__init__Úrunning)ÚselfÚoriginal©Ú	__class__© úD/tmp/pip-unpacked-wheel-mnhg7r0q/twisted/trial/_dist/distreporter.pyr       s    zDistReporter.__init__c                 C   s.   g | j | ¡ < | j | ¡   | jj|f¡ dS )z&
        Queue test starting.
        N)r   ÚidÚappendr   Ú	startTest©r   Útestr   r   r   r   $   s    zDistReporter.startTestN)r   ÚfailÚreturnc                 C   s"   | j | ¡   | jj||f¡ dS )z)
        Queue adding a failure.
        N)r   r   r   r   Ú
addFailure)r   r   r   r   r   r   r   +   s    zDistReporter.addFailure)r   Úerrorr   c                 C   s"   | j | ¡   | jj||f¡ dS )z%
        Queue error adding.
        N)r   r   r   r   ÚaddError)r   r   r   r   r   r   r   1   s    zDistReporter.addErrorc                 C   s"   | j | ¡   | jj||f¡ dS )z&
        Queue adding a skip.
        N)r   r   r   r   ÚaddSkip)r   r   Úreasonr   r   r   r    7   s    zDistReporter.addSkipc                 C   s"   | j | ¡   | jj||f¡ dS )z5
        Queue adding an unexpected success.
        N)r   r   r   r   ÚaddUnexpectedSuccess)r   r   Útodor   r   r   r"   =   s    z!DistReporter.addUnexpectedSuccess)r   r   r#   r   c                 C   s$   | j | ¡   | jj|||f¡ dS )z3
        Queue adding an expected failure.
        N)r   r   r   r   ÚaddExpectedFailure)r   r   r   r#   r   r   r   r$   C   s    ÿzDistReporter.addExpectedFailurec                 C   s    | j | ¡   | jj|f¡ dS )z)
        Queue adding a success.
        N)r   r   r   r   Ú
addSuccessr   r   r   r   r%   M   s    zDistReporter.addSuccessc                 C   sT   | j | ¡   | jj|f¡ | j | ¡  D ]}|d |dd… Ž  q*| j | ¡ = dS )zA
        Queue stopping the test, then unroll the queue.
        r   é   N)r   r   r   r   ÚstopTest)r   r   Ústepr   r   r   r'   S   s    zDistReporter.stopTest)N)N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   ÚReporterFailurer   r   r    r"   r   Ústrr$   r%   r'   Ú__classcell__r   r   r   r   r      s    
 ÿ  þ
r   N)r,   Útypesr   Útypingr   r   r   Zzope.interfacer   Ztwisted.python.componentsr   Ztwisted.python.failurer   Zitrialr
   r   ÚtypeÚ	Exceptionr-   r   r   r   r   r   Ú<module>   s   