B
    '(b                 @   s   d Z ddlmZ ddlmZ ddlmZ ddlmZm	Z	 ddl
mZ ddlmZ ddlmZ G d	d
 d
e	ZeddddZdS )z(Tests for mypy incremental error output.    )List)build)assert_string_arrays_equal)DataDrivenTestCase	DataSuite)BuildSource)CompileError)Optionsc               @   s*   e Zd ZdZdZdgZeddddZdS )ErrorStreamSuiteT.zerrorstream.testN)testcasereturnc             C   s   t | d S )N)test_error_stream)selfr    r   H/home/dcms/DCMS/lib/python3.7/site-packages/mypy/test/testerrorstream.pyrun_case   s    zErrorStreamSuite.run_case)__name__
__module____qualname__Zrequired_out_section	base_pathfilesr   r   r   r   r   r   r
      s   r
   N)r   r   c          
      s   t  }d|_g  tt tdd fdd}tddd| jg}ytj|||d	 W n0 t	k
r } z|j
g ksttW dd}~X Y nX t| j d
| j| j dS )zmPerform a single error streaming test case.

    The argument contains the description of the test case.
    TN)msgsseriousr   c                s   | r  d  |  d S )Nz==== Errors flushed ====)appendextend)r   r   )logged_messagesr   r   flush_errors   s    
z'test_error_stream.<locals>.flush_errorsmain__main__
)sourcesoptionsr   zInvalid output ({}, line {}))r	   show_tracebackr   strboolr   joininputr   r   messagesAssertionErrorr   outputformatfileline)r   r"   r   r!   er   )r   r   r      s     r   )__doc__typingr   Zmypyr   Zmypy.test.helpersr   Zmypy.test.datar   r   Zmypy.modulefinderr   Zmypy.errorsr   Zmypy.optionsr	   r
   r   r   r   r   r   <module>   s   	