
    e                    R    d dl mZ d dlZd dlZd dlmZmZ d dlmZ  G d de      Z	y)    )annotationsN)LintModuleTestMessageCounter)
OutputLinec                  x    e Zd ZdZ G d dej
                        Z ej                  de       	 	 	 	 	 	 	 	 ddZy)LintModuleOutputUpdatezXClass to be used if expected output files should be updated instead of
    checked.
    c                      e Zd ZdZdZdZy)"LintModuleOutputUpdate.TestDialectzDialect used by the csv writer.:
N)__name__
__module____qualname____doc__	delimiterlineterminator     W/usr/lib/python3/dist-packages/pylint/testutils/functional/lint_module_output_update.pyTestDialectr
      s    -	r   r   testc                   |s]t         j                  j                  | j                  j                        r)t        j
                  | j                  j                         yt        | j                  j                  dd      5 }t        j                  |d      }|D ]!  }|j                  |j                                # 	 ddd       y# 1 sw Y   yxY w)zDOverwrite or remove the expected output file based on actual output.Nwzutf-8)encodingr   )dialect)ospathexists
_test_fileexpected_outputremoveopencsvwriterwriterowto_csv)self_r    actual_outputfr$   lines          r   _check_output_textz)LintModuleOutputUpdate._check_output_text   s     ww~~doo==>		$//99:$//113I 	/QZZ62F% /./	/ 	/ 	/s   >C

CN)r(   r   r    list[OutputLine]r)   r-   returnNone)	r   r   r   r   r#   excelr   register_dialectr,   r   r   r   r   r      sV    cii  C-// */ (	/
 
/r   r   )

__future__r   r#   r   !pylint.testutils.lint_module_testr   r   pylint.testutils.output_liner   r   r   r   r   <module>r5      s"   
 # 
 	 L 3/^ /r   