o
    ҷh                     @  s   d dl mZ d dlZd dlZd dlmZ d dlZd dlmZm	Z	m
Z
mZ er,d dlmZ ejjdddd	ed
dddddddfdeddddddddfdedddddfgg ddd1d%d&Zd2d)d*Zd3d/d0ZdS )4    )annotationsN)TYPE_CHECKING)Resultexportmainprocess_line)Path)srcexpected) N)za regular line
Nz*package\filename.py:42:8: note: Some info
noticepackage\filename.py*      
 Some infokindfilename
start_line	start_colend_lineend_colmessagez=package/filename.py:42:1:46:3: error: Type error here [code]
errorpackage/filename.py   .       Type error here [code]z%package/module.py:87: warn: Bad code
warningpackage/module.pyW   	 Bad coder   r   r   r   )blanknormalz	note-wcolz
error-wendzwarn-lineonly)idsr	   strr
   Result | NonereturnNonec                 C  s   t | }||ks
J d S )N)r   )r	   r
   result r,   W/var/www/html/venv/lib/python3.10/site-packages/trio/_tests/tools/test_mypy_annotate.pytest_processing   s   *r.   capsyspytest.CaptureFixture[str]c                 C  sz   t ddddd d ddddgt d	d
ddddddddgt ddddddgi}t| |  }|jdks4J |jdks;J d S )Nr   r   r   r   r   r   WindowsMacr   r   r   r   r   r   Linuxr   r    r!   r"   r#   r   a^  ::notice file=package\filename.py,line=42,col=8,title=Mypy-Windows+Mac::package\filename.py:(42:8): Some info
::error file=package/filename.py,line=42,col=1,endLine=46,endColumn=3,title=Mypy-Linux+Mac::package/filename.py:(42:1 - 46:3): Type error here [code]
::warning file=package/module.py,line=87,title=Mypy-Linux::package/module.py:87: Bad code
)r   r   
readouterrerrout)r/   resultsstdr,   r,   r-   test_export=   sD   r9   tmp_pathr   monkeypatchpytest.MonkeyPatchc                 C  s   dd l m  m} d}| d }| rJ |  |tdt| |	dt
|ddg W d    n1 s9w   Y  | }|jdksIJ |j|ksPJ | sVJ t	dt
|g | }|jdksiJ |jd	kspJ d S )
Nr   zMypy begun
trio/core.py:15: error: Bad types here [misc]
trio/package/module.py:48:4:56:18: warn: Missing annotations  [no-untyped-def]
Found 3 errors in 29 files
zdump.datstdinz
--dumpfilez
--platformSomePlatformr   a  ::error file=trio/core.py,line=15,title=Mypy-SomePlatform::trio/core.py:15: Bad types here [misc]
::warning file=trio/package/module.py,line=48,col=4,endLine=56,endColumn=18,title=Mypy-SomePlatform::trio/package/module.py:(48:4 - 56:18): Missing annotations  [no-untyped-def]
)trio._tools.mypy_annotate_toolsmypy_annotateexistscontextsetattrsysioStringIOr   r'   r4   r5   r6   )r:   r;   r/   rA   inp_textresult_filer8   r,   r,   r-   test_endtoendg   s(   
rJ   )r	   r'   r
   r(   r)   r*   )r/   r0   r)   r*   )r:   r   r;   r<   r/   r0   r)   r*   )
__future__r   rF   rE   typingr   pytestr?   r   r   r   r   pathlibr   markparametrizer.   r9   rJ   r,   r,   r,   r-   <module>   s`    %)
*