JFIF$        dd7 

Viewing File: /usr/lib/python3.9/site-packages/setuptools/command/__pycache__/test.cpython-39.pyc

a

���h�$�@s�ddlZddlZddlZddlZddlZddlZddlmZmZddl	m
Z
ddlmZddlm
Z
mZmZmZmZmZmZmZmZddlmZddlmZGd	d
�d
e�ZGdd�d�ZGd
d�de�ZdS)�N)�DistutilsError�DistutilsOptionError)�log)�
TestLoader)	�resource_listdir�resource_exists�normalize_path�working_set�_namespace_packages�evaluate_marker�add_activation_listener�require�
EntryPoint)�Command�)�_unique_everseenc@seZdZdd�Zddd�ZdS)�ScanningLoadercCst�|�t�|_dS�N)r�__init__�set�_visited��self�r�;/usr/lib/python3.9/site-packages/setuptools/command/test.pyrs
zScanningLoader.__init__NcCs�||jvrdS|j�|�g}|�t�||��t|d�rH|�|���t|d�r�t|jd�D]`}|�	d�r�|dkr�|jd|dd�}n"t
|j|d	�r^|jd|}nq^|�|�|��q^t|�d
kr�|�
|�S|dSdS)aReturn a suite of all tests cases contained in the given module

        If the module is a package, load tests from all the modules in it.
        If the module has an ``additional_tests`` function, call it and add
        the return value to the tests.
        N�additional_tests�__path__�z.pyz__init__.py�.���z/__init__.pyrr)r�add�appendr�loadTestsFromModule�hasattrrr�__name__�endswithrZloadTestsFromName�lenZ
suiteClass)r�module�patternZtests�fileZ	submodulerrrr"s$



z"ScanningLoader.loadTestsFromModule)N)r$�
__module__�__qualname__rr"rrrrrsrc@seZdZdd�Zddd�ZdS)�NonDataPropertycCs
||_dSr��fget)rr.rrrr<szNonDataProperty.__init__NcCs|dur|S|�|�Srr-)r�objZobjtyperrr�__get__?szNonDataProperty.__get__)N)r$r*r+rr0rrrrr,;sr,c@s�eZdZdZdZgd�Zdd�Zdd�Zedd	��Z	d
d�Z
dd
�Zej
gfdd��Zeej
dd���Zedd��Zdd�Zdd�Zedd��Zedd��ZdS)�testz.Command to run unit tests after in-place buildz0run unit tests after in-place build (deprecated)))ztest-module=�mz$Run 'test_suite' in specified module)ztest-suite=�sz9Run single test, case or suite (e.g. 'module.test_suite'))ztest-runner=�rzTest runner to usecCsd|_d|_d|_d|_dSr)�
test_suite�test_module�test_loader�test_runnerrrrr�initialize_optionsQsztest.initialize_optionscCs�|jr|jrd}t|��|jdurD|jdur8|jj|_n|jd|_|jdur^t|jdd�|_|jdurnd|_|jdur�t|jdd�|_dS)Nz1You may specify a module or a suite, but not bothz.test_suiter7z&setuptools.command.test:ScanningLoaderr8)r5r6r�distributionr7�getattrr8)r�msgrrr�finalize_optionsWs




ztest.finalize_optionscCst|���Sr)�list�
_test_argsrrrr�	test_argsjsztest.test_argsccs4|jstjdkrdV|jr"dV|jr0|jVdS)N)��Zdiscoverz	--verbose)r5�sys�version_info�verboserrrrr?nsztest._test_argscCs2|���|�Wd�n1s$0YdS)zI
        Backward compatibility for project_on_sys_path context.
        N)�project_on_sys_path)r�funcrrr�with_project_on_sys_pathvs
ztest.with_project_on_sys_pathc	
cs�t|jdd�}|rp|jddd�|�d�|�d�}t|j�}|jd|d�|�d�|jddd�|�d�n"|�d�|jdd	d�|�d�|�d�}tjdd�}tj	�
�}z�t|j�}tj�d|�t
��td
d��td|j|jf�|�|g��dVWd�n1�s 0YW|tjdd�<tj	��tj	�|�t
��n.|tjdd�<tj	��tj	�|�t
��0dS)
N�use_2to3F�build_pyr)ZinplaceZegg_info)�egg_baseZ	build_extrcSs|��Sr)Zactivate)�distrrr�<lambda>��z*test.project_on_sys_path.<locals>.<lambda>z%s==%s)r;r:Zreinitialize_commandZrun_commandZget_finalized_commandrZ	build_librC�path�modules�copyrK�insertr	rrr
Zegg_nameZegg_version�paths_on_pythonpath�clear�update)	rZ
include_distsZ	with_2to3Zbpy_cmdZ
build_pathZei_cmdZold_pathZold_modulesZproject_pathrrrrF}s@








(

�
ztest.project_on_sys_pathc
cs�t�}tj�d|�}tj�dd�}zdtj�t|��}td||g�}tj�|�}|r\|tjd<dVW||ur|tj�dd�q�|tjd<n$||ur�tj�dd�n
|tjd<0dS)z�
        Add the indicated paths to the head of the PYTHONPATH environment
        variable so that subprocesses will also see the packages at
        these paths.

        Do this in a context that restores the value on exit.
        Z
PYTHONPATHrN)	�object�os�environ�get�pathsep�joinr�filter�pop)�pathsZnothingZorig_pythonpathZcurrent_pythonpath�prefixZto_join�new_pathrrrrS�s 

�ztest.paths_on_pythonpathcCsD|�|j�}|�|jpg�}|�dd�|j��D��}t�|||�S)z�
        Install the requirements indicated by self.distribution and
        return an iterable of the dists that were built.
        css0|](\}}|�d�rt|dd��r|VqdS)�:rN)�
startswithr)�.0�k�vrrr�	<genexpr>�s�z%test.install_dists.<locals>.<genexpr>)Zfetch_build_eggsZinstall_requiresZ
tests_requireZextras_require�items�	itertools�chain)rLZir_dZtr_dZer_drrr�
install_dists�s
�ztest.install_distsc	Cs�|�dtj�|�|j�}d�|j�}|jr>|�d|�dS|�d|�tt	�
d�|�}|�|��@|���|�
�Wd�n1s�0YWd�n1s�0YdS)Nz�WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.� zskipping "%s" (dry run)zrunning "%s"�location)�announcerZWARNrjr:r[�_argv�dry_run�map�operator�
attrgetterrSrF�	run_tests)rZinstalled_dists�cmdr^rrr�run�s�
ztest.runcCs�t|jdd�rx|j�d�d}|tvrxg}|tjvr>|�|�|d7}tjD]}|�|�rL|�|�qLt	t
tjj|��tj
dd|j|�|j�|�|j�dd�}|j��s�d|j}|�|tj�t|��dS)NrIFrr)Z
testLoaderZ
testRunner�exitzTest failed: %s)r;r:r5�splitr
rCrPr!rbr>rp�__delitem__�unittest�mainrn�_resolve_as_epr7r8�resultZ
wasSuccessfulrmrZERRORr)rr'Zdel_modules�namer1r<rrrrs�s*





�

ztest.run_testscCsdg|jS)Nry)r@rrrrrnsz
test._argvcCs$|durdSt�d|�}|���S)zu
        Load the indicated attribute value, called, as a as if it were
        specified as an entry point.
        Nzx=)r�parse�resolve)�val�parsedrrrr{	sztest._resolve_as_epN)r$r*r+�__doc__�descriptionZuser_optionsr9r=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