o
    ¯b		  ã                   @   sH   d Z ddlmZ ddlmZ ddlm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
é    )Úimplementer)ÚproxyForInterface)Ú	IReporterc                       sd   e Zd ZdZ‡ fdd„Zdd„ Zdd„ Zdd	„ Zd
d„ Zddd„Z	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__© úB/usr/lib/python3/dist-packages/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.startTestc                 C   ó"   | j | ¡   | jj||f¡ dS )z)
        Queue adding a failure.
        N)r	   r   r   r   Ú
addFailure)r
   r   Úfailr   r   r   r   %   ó   "zDistReporter.addFailurec                 C   r   )z%
        Queue error adding.
        N)r	   r   r   r   ÚaddError)r
   r   Úerrorr   r   r   r   +   r   zDistReporter.addErrorc                 C   r   )z&
        Queue adding a skip.
        N)r	   r   r   r   ÚaddSkip)r
   r   Úreasonr   r   r   r   1   r   zDistReporter.addSkipNc                 C   r   )z5
        Queue adding an unexpected success.
        N)r	   r   r   r   ÚaddUnexpectedSuccess)r
   r   Útodor   r   r   r   7   r   z!DistReporter.addUnexpectedSuccessc                 C   s$   | j | ¡   | jj|||f¡ dS )z5
        Queue adding an unexpected failure.
        N)r	   r   r   r   ÚaddExpectedFailure)r
   r   r   r   r   r   r   r   =   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    E   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"   K   s   zDistReporter.stopTestr   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r    r"   Ú__classcell__r   r   r   r   r      s    

r   N)r'   Úzope.interfacer   Útwisted.python.componentsr   Útwisted.trial.itrialr   r   r   r   r   r   Ú<module>   s   