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: //opt/osm/venv/lib64/python3.10/site-packages/setuptools/command/__pycache__/test.cpython-310.pyc
o

0i��@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@�eZdZdd�Zddd�ZdS)�ScanningLoadercCst�|�t�|_dS�N)r�__init__�set�_visited��self�r�E/opt/osm/venv/lib/python3.10/site-packages/setuptools/command/test.pyrs
zScanningLoader.__init__NcCs�||jvrdS|j�|�g}|�t�||��t|d�r$|�|���t|d�r`t|jd�D]0}|�	d�rF|dkrF|jd|dd�}nt
|j|d	�rV|jd|}nq/|�|�|��q/t|�d
krk|�
|�S|dS)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.loadTestsFromModuler)r&�
__module__�__qualname__rr$rrrrrsrc@r)�NonDataPropertycCs
||_dSr��fget)rr2rrrrCs
zNonDataProperty.__init__NcCs|dur|S|�|�Srr1)r�obj�objtyperrr�__get__Fs
zNonDataProperty.__get__r)r&r.r/rr5rrrrr0Bsr0c@s�eZdZdZdZgd�Zdd�Zdd�Zedd	��Z	d
d�Z
dd
�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|_dSr)�
test_suite�test_module�test_loader�test_runnerrrrr�initialize_options[s
ztest.initialize_optionscCs�|jr|jrd}t|��|jdur"|jdur|jj|_n|jd|_|jdur/t|jdd�|_|jdur7d|_|jdurFt|jdd�|_dSdS)Nz1You may specify a module or a suite, but not bothz.test_suiter<z&setuptools.command.test:ScanningLoaderr=)r:r;r�distributionr<�getattrr=)r�msgrrr�finalize_optionsas




�ztest.finalize_optionscCst|���Sr)�list�
_test_argsrrrr�	test_argst�ztest.test_argsccs0�|jsdV|jr
dV|jr|jVdSdS)NZdiscoverz	--verbose)r:�verboserrrrrDxs��ztest._test_argscCs4|���|�Wd�dS1swYdS)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
csL�|�d�|jddd�|�d�|�d�}tjdd�}tj��}zkt|j�}tj�	d|�t
��tdd��t
d|j|jf�|�|g��dVWd�n!1sXwYW|tjdd�<tj��tj�|�t
��dSW|tjdd�<tj��tj�|�t
��dS|tjdd�<tj��tj�|�t
��w)	N�egg_infoZ	build_extr!)ZinplacercSs|��Sr)�activate)�distrrr�<lambda>�sz*test.project_on_sys_path.<locals>.<lambda>z%s==%s)�run_commandZreinitialize_commandZget_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_pathrrrrH�s:�




�
�
�

ztest.project_on_sys_pathc
cs��t�}tj�d|�}tj�dd�}z4tj�t|��}td||g�}tj�|�}|r/|tjd<dVW||ur@tj�dd�dS|tjd<dS||urStj�dd�w|tjd<w)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_pathrrrrV�s"�

�ztest.paths_on_pythonpathcCsD|�|j�}|�|jpg�}|�dd�|j��D��}t�|||�S)z�
        Install the requirements indicated by self.distribution and
        return an iterable of the dists that were built.
        css2�|]\}}|�d�rt|dd��r|VqdS)�:r!N)�
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�n1sGwYWd�dSWd�dS1s_wYdS)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�WARNror?r`�_argv�dry_run�map�operator�
attrgetterrVrH�	run_tests)rZinstalled_dists�cmdrcrrr�run�s$�

��"�ztest.runcCsVtjdd|j|�|j�|�|j�dd�}|j��s)d|j}|�|t	j
�t|��dS)NF)Z
testLoaderZ
testRunner�exitzTest failed: %s)�unittest�mainrt�_resolve_as_epr<r=�resultZ
wasSuccessfulrrr�ERRORr)rr6rArrrry�s

�

�ztest.run_testscCsdg|jS)Nr})rErrrrrt�rFz
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__�descriptionZuser_optionsr>rBr0rErDrJ�
contextlib�contextmanagerrH�staticmethodrVror{ry�propertyrtrrrrrrr6Ls0



r6)r\rwrPr�rmr}Zdistutils.errorsrr�	distutilsrr�
pkg_resourcesrrrr	r
rrZ
_importlibr�
setuptoolsrZ setuptools.extern.more_itertoolsrZ"setuptools.extern.jaraco.functoolsrrr0r6rrrr�<module>s"$	(