Your IP : 3.145.152.146


Current Path : /opt/alt/python37/lib/python3.7/site-packages/setuptools/command/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib/python3.7/site-packages/setuptools/command/__pycache__/test.cpython-37.pyc

B

��Re��@s�ddlZddlZddlZddlZddlZddlZddlmZmZddl	m
Z
ddlmZddlm
Z
mZmZmZmZmZmZmZddlmZddlmZGdd	�d	e�ZGd
d�d�ZGdd
�d
e�ZdS)�N)�DistutilsError�DistutilsOptionError)�log)�
TestLoader)�resource_listdir�resource_exists�normalize_path�working_set�evaluate_marker�add_activation_listener�require�
EntryPoint)�Command)�unique_everseenc@seZdZdd�Zddd�ZdS)�ScanningLoadercCst�|�t�|_dS)N)r�__init__�set�_visited)�self�r��/builddir/build/BUILDROOT/alt-python37-setuptools-58.3.0-4.el8.x86_64/opt/alt/python37/lib/python3.7/site-packages/setuptools/command/test.pyrs
zScanningLoader.__init__NcCs�||jkrdS|j�|�g}|�t�||��t|d�rH|�|���t|d�r�xpt|jd�D]`}|�	d�r�|dkr�|jd|dd�}n"t
|j|d	�r`|jd|}nq`|�|�|��q`Wt|�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__.py�r)r�add�appendr�loadTestsFromModule�hasattrrr�__name__�endswithrZloadTestsFromName�lenZ
suiteClass)r�module�pattern�tests�file�	submodulerrrrs$



z"ScanningLoader.loadTestsFromModule)N)r!�
__module__�__qualname__rrrrrrrsrc@seZdZdd�Zddd�ZdS)�NonDataPropertycCs
||_dS)N)�fget)rr,rrrrBszNonDataProperty.__init__NcCs|dkr|S|�|�S)N)r,)r�objZobjtyperrr�__get__EszNonDataProperty.__get__)N)r!r)r*rr.rrrrr+Asr+c@s�eZdZdZdZdddgZdd�Zdd	�Zed
d��Z	dd
�Z
dd�Zej
gfdd��Zeej
dd���Zedd��Zdd�Zdd�Zedd��Zedd��ZdS)�testz.Command to run unit tests after in-place buildz0run unit tests after in-place build (deprecated))ztest-module=�mz$Run 'test_suite' in specified module)ztest-suite=�sz9Run single test, case or suite (e.g. 'module.test_suite'))ztest-runner=�rzTest runner to usecCsd|_d|_d|_d|_dS)N)�
test_suite�test_module�test_loader�test_runner)rrrr�initialize_optionsZsztest.initialize_optionscCs�|jr|jrd}t|��|jdkrD|jdkr8|jj|_n|jd|_|jdkr^t|jdd�|_|jdkrnd|_|jdkr�t|jdd�|_dS)Nz1You may specify a module or a suite, but not bothz.test_suiter5z&setuptools.command.test:ScanningLoaderr6)r3r4r�distributionr5�getattrr6)r�msgrrr�finalize_options`s




ztest.finalize_optionscCst|���S)N)�list�
_test_args)rrrr�	test_argsssztest.test_argsccs4|jstjdkrdV|jr"dV|jr0|jVdS)N)��Zdiscoverz	--verbose)r3�sys�version_info�verbose)rrrrr=wsztest._test_argsc	Cs|���|�WdQRXdS)zI
        Backward compatibility for project_on_sys_path context.
        N)�project_on_sys_path)r�funcrrr�with_project_on_sys_paths
ztest.with_project_on_sys_pathc
cs�|�d�|jddd�|�d�|�d�}tjdd�}tj��}zbt|j�}tj�	d|�t
��tdd��t
d|j|jf�|�|g��dVWdQRXWd|tjdd�<tj��tj�|�t
��XdS)	N�egg_info�	build_extr)ZinplacercSs|��S)N)�activate)�distrrr�<lambda>��z*test.project_on_sys_path.<locals>.<lambda>z%s==%s)�run_command�reinitialize_command�get_finalized_commandrA�path�modules�copyrZegg_base�insertr	rrr�egg_nameZegg_version�paths_on_pythonpath�clear�update)rZ
include_distsZei_cmd�old_pathZold_modulesZproject_pathrrrrD�s$





ztest.project_on_sys_pathc
cs�t�}tj�d|�}tj�dd�}zBtj�t|��}td||g�}tj�|�}|r\|tjd<dVWd||kr~tj�dd�n
|tjd<XdS)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.
        �
PYTHONPATHrN)	�object�os�environ�get�pathsep�joinr�filter�pop)�pathsZnothingZorig_pythonpathZcurrent_pythonpath�prefixZto_join�new_pathrrrrU�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>�sz%test.install_dists.<locals>.<genexpr>)Zfetch_build_eggsZinstall_requiresZ
tests_requireZextras_require�items�	itertools�chain)rJZir_dZtr_dZer_drrr�
install_dists�sztest.install_distsc
Cs�|�dtj�|�|j�}d�|j�}|jr>|�d|�dS|�d|�tt	�
d�|�}|�|��"|���|�
�WdQRXWdQRXdS)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)zrunning "%s"�location)�announcer�WARNrnr8r_�_argv�dry_run�map�operator�
attrgetterrUrD�	run_tests)rZinstalled_dists�cmdrbrrr�run�s
ztest.runcCsVtjdd|j|�|j�|�|j�dd�}|j��sRd|j}|�|t	j
�t|��dS)NF)Z
testLoaderZ
testRunner�exitzTest failed: %s)�unittest�mainrs�_resolve_as_epr5r6�resultZ
wasSuccessfulrqr�ERRORr)rr/r:rrrrx�s



ztest.run_testscCsdg|jS)Nr|)r>)rrrrrs�sz
test._argvcCs$|dkrdSt�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__�description�user_optionsr7r;r+r>r=rF�
contextlib�contextmanagerrD�staticmethodrUrnrzrx�propertyrsr~rrrrr/Ks&r/)r[rvrAr�rlr|�distutils.errorsrr�	distutilsrr�
pkg_resourcesrrrr	r
rrr
�
setuptoolsrZ setuptools.extern.more_itertoolsrrr+r/rrrr�<module>s(
(

?>