Your IP : 3.147.68.18


Current Path : /opt/alt/python39/lib/python3.9/site-packages/setuptools/command/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib/python3.9/site-packages/setuptools/command/__pycache__/test.cpython-39.pyc

a

(�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-python39-setuptools-58.3.0-2.el8.x86_64/opt/alt/python39/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__.py�r)r�add�appendr�loadTestsFromModule�hasattrrr�__name__�endswithrZloadTestsFromName�lenZ
suiteClass)r�module�pattern�tests�file�	submodulerrrr!s$



z"ScanningLoader.loadTestsFromModule)N)r#�
__module__�__qualname__rr!rrrrrsrc@seZdZdd�Zddd�ZdS)�NonDataPropertycCs
||_dSr��fget)rr/rrrrBszNonDataProperty.__init__NcCs|dur|S|�|�Srr.)r�objZobjtyperrr�__get__EszNonDataProperty.__get__)N)r#r+r,rr1rrrrr-Asr-c@s�eZdZdZdZgd�Zdd�Zdd�Zedd	��Z	d
d�Z
dd
�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|_dSr)�
test_suite�test_module�test_loader�test_runnerrrrr�initialize_optionsZsztest.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_suiter8z&setuptools.command.test:ScanningLoaderr9)r6r7r�distributionr8�getattrr9)r�msgrrr�finalize_options`s




ztest.finalize_optionscCst|���Sr)�list�
_test_argsrrrr�	test_argsssztest.test_argsccs4|jstjdkrdV|jr"dV|jr0|jVdS)N)��Zdiscoverz	--verbose)r6�sys�version_info�verboserrrrr@wsztest._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_paths
ztest.with_project_on_sys_pathc
cs|�d�|jddd�|�d�|�d�}tjdd�}tj��}z�t|j�}tj�	d|�t
��tdd��t
d|j|jf�|�|g��dVWd�n1s�0YW|tjdd�<tj��tj�|�t
��n.|tjdd�<tj��tj�|�t
��0dS)	N�egg_info�	build_extr)ZinplacercSs|��Sr)�activate)�distrrr�<lambda>��z*test.project_on_sys_path.<locals>.<lambda>z%s==%s)�run_command�reinitialize_command�get_finalized_commandrD�path�modules�copyrZegg_base�insertr	rrr�egg_nameZegg_version�paths_on_pythonpath�clear�update)rZ
include_distsZei_cmd�old_pathZold_modulesZproject_pathrrrrG�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.
        �
PYTHONPATHrN)	�object�os�environ�get�pathsep�joinr�filter�pop)�pathsZnothingZorig_pythonpathZcurrent_pythonpath�prefixZto_join�new_pathrrrrX�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)rMZir_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)zrunning "%s"�location)�announcer�WARNrqr;rb�_argv�dry_run�map�operator�
attrgetterrXrG�	run_tests)rZinstalled_dists�cmdrerrr�run�s�
ztest.runcCsVtjdd|j|�|j�|�|j�dd�}|j��sRd|j}|�|t	j
�t|��dS)NF)Z
testLoaderZ
testRunner�exitzTest failed: %s)�unittest�mainrv�_resolve_as_epr8r9�resultZ
wasSuccessfulrtr�ERRORr)rr2r=rrrr{�s

�

ztest.run_testscCsdg|jS)Nr)rArrrrrv�sz
test._argvcCs$|dur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_optionsr:r>r-rAr@rI�
contextlib�contextmanagerrG�staticmethodrXrqr}r{�propertyrvr�rrrrr2Ks,



r2)r^ryrDr�ror�distutils.errorsrr�	distutilsrr�
pkg_resourcesrrrr	r
rrr
�
setuptoolsrZ setuptools.extern.more_itertoolsrrr-r2rrrr�<module>s(
(

?>