
    X-Ph                         d dl Z d dlZd dlZd dl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 e G d d                      Zded	efd
Zddddedededee         ded	efdZdS )    N)Iterable)	dataclass)Path)test_data_prefixc                   8    e Zd ZU eed<   eed<   eed<   eed<   dS )PytestResultinputinput_updatedstdoutstderrN)__name__
__module____qualname__str__annotations__     V/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/mypy/test/meta/_pytest.pyr   r      s7         JJJKKKKKKKKr   r   sreturnc                 N    t          j        |                                           S )N)textwrapdedentlstrip)r   s    r   dedent_docstringr      s    ?1$$&&&r   checkz&mypy/test/testcheck.py::TypeCheckSuite)data_file_prefixpytest_node_prefix
data_suiter   r   
extra_argsmax_attemptsc                   t          t                    }|j        j        }|| dt          j                     dz  }|                                rJ t          |           } 	 |                    |            | d|j         }t          j
        dddddg||}t          j        |          }	t          |d	z
  d
d
          D ]}
t          d|	            t          j        |dd|          }|j        dk    r nd}|j                                                                        D ](}t          | d|            dt+          |          z  })d}|j                                                                        D ](}t          | d|            dt+          |          z  })t          d|j         d|
 d           t/          | |                                |j                                        |j                                                  |                                 S # |                                 w xY w)z
    Runs a suite of data test cases through pytest until either tests pass
    or until a maximum number of attempts (needed for incremental tests).

    :param data_suite: the actual "suite" i.e. the contents of a .test file
    z-meta-z.testz::z-mpytestz-n0z-s   z>> TF)capture_outputr   cwdr   zNESTED PYTEST STDOUTz:  zNESTED PYTEST STDERRz
Exit code z (z attempts remaining))r	   r
   r   r   )r   r   parentuuiduuid4existsr   
write_textnamesys
executableshlexjoinrangeprint
subprocessrun
returncoder   decode
splitlineslenr   r   	read_textunlink)r   r   r   r    r!   p_test_datap_rootptest_nodeidcmdiprocprefixlines                 r   run_pytest_data_suiterG      s_    '((K&F)DDDDDDAxxzz!*--J	Z   +77qv77ndHdC`
`T_`
j$$|a'R00 	K 	KA+++>*TTZ[[[D!##+F**,,7799 + +))4))***s6{{*+F**,,7799 + +))4))***s6{{*ItII!IIIJJJJ++--;%%'';%%''	
 
 
 	








s   #F4H, ,I)r2   r6   r0   r   r+   collections.abcr   dataclassesr   pathlibr   mypy.test.configr   r   r   r   intrG   r   r   r   <module>rM      sA        



   $ $ $ $ $ $ ! ! ! ! ! !       - - - - - -        ' ' ' ' ' ' $F	/ / // / 	/
 / / / / / / / /r   