o
    tBh
                     @  s   d Z ddlmZ ddlZddlmZ ddlm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mZmZ G dd deZdddZdZG dd deZdddZdS )zTests for the mypy parser.    )annotationsN)skip)defaults)CompileError)Options)parse)DataDrivenTestCase	DataSuite)assert_string_arrays_equalfind_test_filesparse_optionsc                   @  s@   e Zd ZdZdZeddgdZejdk re	d dddZ
dS )ParserSuiteT.zparse*.testparse-errors.test)patternexclude   
   zparse-python310.testtestcaser   returnNonec                 C     t | d S N)test_parserselfr    r   j/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/mypy/test/testparse.pyrun_case      zParserSuite.run_caseNr   r   r   r   )__name__
__module____qualname__required_out_section	base_pathr   filessysversion_inforemover   r   r   r   r   r      s    

r   r   r   r   r   c              
   C  s   t  }| jdrd|_ntj|_zttd| j	dddd|d}t
|d}W n ty? } z	|j}W Y d}~nd}~ww t| j|d	| j d
| j d dS )zdPerform a single parser test case.

    The argument contains the description of the test case.
    zpython310.testr   
asciimain__main__N)fnammoduleerrorsoptionszInvalid parser output (, line ))r   fileendswithpython_versionr   PYTHON3_VERSIONr   bytesjoininputstrsplitr   messagesr
   outputline)r   r2   naer   r   r   r      s(   r   r5   c                   @  s$   e Zd ZdZdZdgZddd	Zd
S )ParseErrorSuiteTr   r   r   r   r   r   c                 C  r   r   )test_parse_errorr   r   r   r   r   C   r    zParseErrorSuite.run_caseNr!   )r"   r#   r$   r%   r&   r'   r   r   r   r   r   rD   >   s
    rD   c                 C  s   z*t d| j| d}|jtjd d krt  ttd| jdt	dd | t
d tyZ } z$|jd ur>|jdks>J t| j|jd| j d| j d	 W Y d }~d S d }~ww )
Nr+   r      zutf-8r.   zNo errors reportedzInvalid compiler output (r3   r4   )r   r:   r;   r7   r(   r)   r   r   r9   INPUT_FILE_NAMEAssertionErrorr   module_with_blockerr
   r?   r>   r5   r@   )r   r2   rC   r   r   r   rE   G   s$   
rE   r!   )__doc__
__future__r   r(   pytestr   mypyr   mypy.errorsr   mypy.optionsr   
mypy.parser   mypy.test.datar   r	   mypy.test.helpersr
   r   r   r   r   rG   rD   rE   r   r   r   r   <module>   s    
	