Hacked By AnonymousFox

Current Path : /opt/alt/python310/lib/python3.10/site-packages/setuptools/command/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib/python3.10/site-packages/setuptools/command/__pycache__/test.cpython-310.pyc

o

~�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@�eZdZdd�Zddd�ZdS)�ScanningLoadercCst�|�t�|_dS�N)r�__init__�set�_visited��self�r��/builddir/build/BUILDROOT/alt-python310-setuptools-58.3.0-2.el8.x86_64/opt/alt/python310/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)rr0rrrrBs
zNonDataProperty.__init__NcCs|dur|S|�|�Srr/)r�objZobjtyperrr�__get__Es
zNonDataProperty.__get__r)r$r,r-rr2rrrrr.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_optionsZs
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_suiter9z&setuptools.command.test:ScanningLoaderr:)r7r8r�distributionr9�getattrr:)r�msgrrr�finalize_options`s




�ztest.finalize_optionscCst|���Sr)�list�
_test_argsrrrr�	test_argss�ztest.test_argsccs:�|jstjdkrdV|jrdV|jr|jVdSdS)N)��Zdiscoverz	--verbose)r7�sys�version_info�verboserrrrrAws��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_paths
"�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_info�	build_extr)ZinplacercSs|��Sr)�activate)�distrrr�<lambda>�sz*test.project_on_sys_path.<locals>.<lambda>z%s==%s)�run_command�reinitialize_command�get_finalized_commandrF�path�modules�copyrZegg_base�insertr	rrr�egg_nameZegg_version�paths_on_pythonpath�clear�update)rZ
include_distsZei_cmd�old_pathZold_modulesZproject_pathrrrrI�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_pathrrrrY�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)�:rN)�
startswithr
)�.0�k�vrrr�	<genexpr>�s���
�z%test.install_dists.<locals>.<genexpr>)Zfetch_build_eggsZinstall_requiresZ
tests_requireZextras_require�items�	itertools�chain)rOZir_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�WARNrrr<rc�_argv�dry_run�map�operator�
attrgetterrYrI�	run_tests)rZinstalled_dists�cmdrfrrr�run�s$�

��"�ztest.runcCsVtjdd|j|�|j�|�|j�dd�}|j��s)d|j}|�|t	j
�t|��dS)NF)Z
testLoaderZ
testRunner�exitzTest failed: %s)�unittest�mainrw�_resolve_as_epr9r:�resultZ
wasSuccessfulrur�ERRORr)rr3r>rrrr|�s

�

�ztest.run_testscCsdg|jS)Nr�)rBrrrrrw�rCz
test._argvcCs$|durdSt�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��s
ztest._resolve_as_epN)r$r,r-�__doc__�description�user_optionsr;r?r.rBrArK�
contextlib�contextmanagerrI�staticmethodrYrrr~r|�propertyrwr�rrrrr3Ks.



r3)r_rzrFr�rpr��distutils.errorsrr�	distutilsrr�
pkg_resourcesrrrr	r
rrr
�
setuptoolsrZ setuptools.extern.more_itertoolsrrr.r3rrrr�<module>s(
(

Hacked By AnonymousFox1.0, Coded By AnonymousFox