HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/site-packages/setuptools/command/__pycache__/test.cpython-37.pyc
B

N��g��@s�ddlZddlZddlZddlZddlZddlZddlmZmZddl	m
Z
ddlmZddlm
Z
mZmZmZmZmZmZddlmZddlmZdd	lmZdd
lmZGdd�de�ZGd
d�d�ZGdd�de�ZdS)�N)�DistutilsError�DistutilsOptionError)�log)�
TestLoader)�resource_listdir�resource_exists�normalize_path�working_set�evaluate_marker�add_activation_listener�require�)�metadata)�Command)�unique_everseen)�	pass_nonec@seZdZdd�Zddd�ZdS)�ScanningLoadercCst�|�t�|_dS)N)r�__init__�set�_visited)�self�r�;/tmp/pip-unpacked-wheel-yrlplx0q/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�	submodulerrrr!s$



z"ScanningLoader.loadTestsFromModule)N)r#�
__module__�__qualname__rr!rrrrrsrc@seZdZdd�Zddd�ZdS)�NonDataPropertycCs
||_dS)N)�fget)rr.rrrrCszNonDataProperty.__init__NcCs|dkr|S|�|�S)N)r.)r�objZobjtyperrr�__get__FszNonDataProperty.__get__)N)r#r+r,rr0rrrrr-Bsr-c@s�eZdZdZdZdddgZdd�Zdd	�Zed
d��Z	dd
�Z
dd�Zej
gfdd��Zeej
dd���Zedd��Zdd�Zdd�Zedd��Zeedd���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_options[sztest.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_suiter7z&setuptools.command.test:ScanningLoaderr8)r5r6r�distributionr7�getattrr8)r�msgrrr�finalize_optionsas




ztest.finalize_optionscCst|���S)N)�list�
_test_args)rrrr�	test_argstsztest.test_argsccs*|jsdV|jrdV|jr&|jVdS)NZdiscoverz	--verbose)r5�verbose)rrrrr?xs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_path�s
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_command�sys�path�modules�copyrZegg_base�insertr	rrr�egg_nameZegg_version�paths_on_pythonpath�clear�update)rZ
include_distsZei_cmd�old_pathZold_modulesZproject_pathrrrrB�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_pathrrrrT�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)rHZir_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�WARNrmr:r^�_argv�dry_run�map�operator�
attrgetterrTrB�	run_tests)rZinstalled_dists�cmdrarrr�run�s
ztest.runcCsVtjdd|j|�|j�|�|j�dd�}|j��sRd|j}|�|t	j
�t|��dS)NF)Z
testLoaderZ
testRunner�exitzTest failed: %s)�unittest�mainrr�_resolve_as_epr7r8�resultZ
wasSuccessfulrpr�ERRORr)rr1r<rrrrw�s



ztest.run_testscCsdg|jS)Nr{)r@)rrrrrr�sz
test._argvcCstj|ddd����S)zu
        Load the indicated attribute value, called, as a as if it were
        specified as an entry point.
        N)�value�name�group)r�
EntryPoint�load)�valrrrr}�sztest._resolve_as_epN)r#r+r,�__doc__�description�user_optionsr9r=r-r@r?rD�
contextlib�contextmanagerrB�staticmethodrTrmryrw�propertyrrrr}rrrrr1Ls(r1)rZrurNr�rkr{�distutils.errorsrr�	distutilsrr�
pkg_resourcesrrrr	r
rrZ
_importlibr�
setuptoolsrZ setuptools.extern.more_itertoolsrZ"setuptools.extern.jaraco.functoolsrrr-r1rrrr�<module>s $	(