Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/setuptools/command/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/setuptools/command/__pycache__/test.cpython-38.pyc
U

E��g�$�@s�ddlZddlZddlZddlZddlZddlZddlmZmZddl	m
Z
ddlmZddlm
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�D/opt/cppython/lib/python3.8/site-packages/setuptools/command/test.pyrs
zScanningLoader.__init__NcCs�||jkrdS|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�pattern�tests�file�	submodulerrrr"s$



z"ScanningLoader.loadTestsFromModule)N)r$�
__module__�__qualname__rr"rrrrrsrc@seZdZdd�Zddd�ZdS)�NonDataPropertycCs
||_dSr��fget)rr0rrrr<szNonDataProperty.__init__NcCs|dkr|S|�|�Srr/)r�obj�objtyperrr�__get__?szNonDataProperty.__get__)N)r$r,r-rr3rrrrr.;sr.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|_dSr)�
test_suite�test_module�test_loader�test_runnerrrrr�initialize_optionsQsztest.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_suiter:z&setuptools.command.test:ScanningLoaderr;)r8r9r�distributionr:�getattrr;)r�msgrrr�finalize_optionsWs




ztest.finalize_optionscCst|���Sr)�list�
_test_argsrrrr�	test_argsjsztest.test_argsccs4|jstjdkrdV|jr"dV|jr0|jVdS)N)��Zdiscoverz	--verbose)r8�sys�version_info�verboserrrrrBnsztest._test_argsc	Cs|���|�W5QRXdS)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	
csJt|jdd�}|rp|jddd�|�d�|�d�}t|j�}|jd|d�|�d�|jddd�|�d�n"|�d�|jdd	d�|�d�|�d�}tjdd�}tj	�
�}zbt|j�}tj�d|�t
��td
d��td|j|jf�|�|g��dVW5QRXW5|tjdd�<tj	��tj	�|�t
��XdS)
N�use_2to3F�build_pyr)Zinplace�egg_info)�egg_base�	build_extrcSs|��Sr)�activate)�distrrr�<lambda>��z*test.project_on_sys_path.<locals>.<lambda>z%s==%s)r>r=�reinitialize_command�run_command�get_finalized_commandr�	build_librF�path�modules�copy�clear�updater	rrO�insertrr
�egg_nameZegg_version�paths_on_pythonpath)	rZ
include_distsZ	with_2to3Zbpy_cmdZ
build_pathZei_cmd�old_pathZold_modulesZproject_pathrrrrI}s8









ztest.project_on_sys_pathc
cs�t�}tj�d|�}tj�dd�}zBtj�t|��}td||g�}tj�|�}|r\|tjd<dVW5||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�pop�pathsep�joinr�filter)�pathsZnothingZorig_pythonpathZcurrent_pythonpath�prefixZto_join�new_pathrrrr`�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)rRZir_dZtr_dZer_drrr�
install_dists�s
�ztest.install_distsc
Cs�|�dtj�|�|j�}d�|j�}|jr>|�d|�dS|�d|�tt	�
d�|�}|�|��"|���|�
�W5QRXW5QRXdS)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�WARNrwr=ri�_argv�dry_run�map�operator�
attrgetterr`rI�	run_tests)rZinstalled_dists�cmdrkrrr�run�s�
ztest.runcCs�t|jdd�rx|j�d�d}|tkrxg}|tjkr>|�|�|d7}tjD]}|�|�rL|�|�qLt	t
tjj|��tj
dd|j|�|j�|�|j�dd�}|j��s�d|j}|�|tj�t|��dS)NrLFrr)Z
testLoaderZ
testRunner�exitzTest failed: %s)r>r=r8�splitr
rFrZr!rorAr~�__delitem__�unittest�mainr|�_resolve_as_epr:r;�resultZ
wasSuccessfulrzr�ERRORr)rr'Zdel_modules�namer4r?rrrr��s.





�

ztest.run_testscCsdg|jS)Nr�)rCrrrrr|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_optionsr<r@r.rCrBrK�
contextlib�contextmanagerrI�staticmethodr`rwr�r��propertyr|r�rrrrr4Es2�
-


r4)rdrrFr�rur��distutils.errorsrr�	distutilsrr�
pkg_resourcesrrrr	r
rrr
r�
setuptoolsrrMrrr.r4rrrr�<module>s,)

F1le Man4ger