Ë
    !åhi2  ã                   óŒ  — d Z ddlZddlZddlZddlZddlmZ ej                  j                  Zej                  j                  Z	ej                  j                  Z
ej                  j                  Zej                  j                  ddgd¬«      Zej                  j                  ddgd¬«      Zd	efd
„Zd	efd„Zdefd„Zdd„Zy)zS
Decorators for skipping PyInstaller tests when specific requirements are not met.
é    N)Úcheck_requirementÚpyi_builderÚonedirT)ÚindirectÚonefileÚpackagec                 ó¨   — t        | «      s#t        j                  j                  d| › d�«      S t        j                  j	                  dd| › d�¬«      S )aÛ  
    Skip a decorated test if **package** is not importable.

    Arguments:
        package:
            The name of the module. May be anything that is allowed after the ``import`` keyword. e.g. 'numpy' or
            'PIL.Image'.
    Returns:
        A pytest marker which either skips the test or does nothing.

    This function intentionally does not import the module. Doing so can lead to `sys.path` and `PATH` being
    polluted, which then breaks later builds.
    zCan't import 'z'.FúDon't skip: 'z' is importable.©Úreason)Ú
importableÚpytestÚmarkÚskipÚskipif)r   s    úCC:\des-py\Monitor\venv\Lib\site-packages\PyInstaller/utils/tests.pyÚimportorskipr   "   sN   € ô �gÔÜ�{‰{×Ñ .°°	¸Ð <Ó=Ð=Ü�;‰;×Ñ˜e¨m¸G¸9ÐDTÐ,UÐÓVÐVó    c                 óÎ   — ddl m} d| v rRt        | j                  d«      d   «      syddlm}m}  |t        j                  dd| z   g||¬«      j                  dk(  S  || «      d uS )	Nr   )Ú	find_specú.F)ÚDEVNULLÚrunz-czimport )ÚstdoutÚstderr)
Úimportlib.utilr   r   ÚsplitÚ
subprocessr   r   ÚsysÚ
executableÚ
returncode)r   r   r   r   s       r   r   r   5   sf   € Ý(ð ˆg�~ä˜'Ÿ-™-¨Ó,¨QÑ/Ô0Øç+Ù”C—N‘N D¨)°gÑ*=Ð>ÀwÐW^Ô_×jÑjÐnoÑoÐoá�WÓ TÐ)Ð)r   Úrequirementc                 ó¨   — t        | «      r%t        j                  j                  dd| › d�¬«      S t        j                  j	                  d| › d�«      S )a¦  
    Mark a test to be skipped if **requirement** is not satisfied.

    Args:
        requirement:
            A distribution name and optional version specifier(s). See :func:`PyInstaller.utils.hooks.check_requirement`
            which this argument is forwarded to.
    Returns:
        Either a skip marker or a dummy marker.

    This function operates on distribution metadata, and does not import any modules.
    Fr
   z' is satisfied.r   z	Requires r   )r   r   r   r   r   )r"   s    r   Úrequiresr$   E   sM   € ô ˜Ô%Ü�{‰{×!Ñ! %°-À¸}ÈOÐ0\Ð!Ó]Ð]ä�{‰{×Ñ )¨K¨=¸Ð :Ó;Ð;r   c                 óÒ   — t        j                  «       d   d   }|r|dz   |z   }|j                  dd«      }| |dz   z  }t        j                  |«      }|j                  |d¬«       |S )	a˜  
    Generate a source file for testing.

    The source will be written into a file named like the test-function. This file will then be passed to
    `test_script`. If you need other related file, e.g. as `.toc`-file for testing the content, put it at at the
    normal place. Just mind to take the basnename from the test-function's name.

    :param script: Source code to create executable from. This will be saved into a temporary file which is then
                   passed on to `test_script`.

    :param test_id: Test-id for parametrized tests. If given, it will be appended to the script filename,
                    separated by two underscores.
    é   é   Ú__r   Ú_z.pyzutf-8)Úencoding)ÚinspectÚstackÚreplaceÚtextwrapÚdedentÚ
write_text)Útmp_pathÚsourceÚtest_idÚtestnameÚ
scriptfiles        r   Úgen_sourcefiler6   X   st   € ô �}‰}‹˜qÑ! !Ñ$€HÙà˜d‘? WÑ,ˆð ×Ñ  SÓ)€HØ˜X¨Ñ-Ñ.€JÜ�_‰_˜VÓ$€FØ×Ñ˜&¨7ÐÔ3ØÐr   )N)Ú__doc__r+   r   r.   r   ÚPyInstaller.utils.hooksr   r   Úparametrizer   Úxfailr   Úonedir_onlyÚonefile_onlyÚstrr   r   r$   r6   © r   r   ú<module>r?      sÀ   ðñó Û 
Û ã å 5ð �k‰k×%Ñ%€Ø	�‰×	Ñ	€Ø�‰×Ñ€Ø‡{�{×Ñ€ð �k‰k×%Ñ% m°h°ZÈ$Ð%ÓO€Ø�{‰{×&Ñ& }°y°kÈDÐ&ÓQ€ðW˜#ó Wð&*˜ó *ð <˜#ó <ô&r   