Viewing File: /opt/alt/python38/lib/python3.8/site-packages/setuptools/command/__pycache__/test.cpython-38.pyc

U

+a%@sddlZddlZddlZddlZddlZddlZddlmZmZddl	m
Z
ddlmZddlm
Z
mZmZmZmZmZmZmZmZddlmZddlmZGdd	d	eZGd
ddZGdd
d
eZdS)N)DistutilsErrorDistutilsOptionError)log)
TestLoader)	resource_listdirresource_existsnormalize_pathworking_set_namespace_packagesevaluate_markeradd_activation_listenerrequire
EntryPoint)Command)unique_everseenc@seZdZddZdddZdS)ScanningLoadercCst|t|_dSN)r__init__set_visitedselfr?/tmp/pip-install-1bd_1mtk/setuptools/setuptools/command/test.pyrs
zScanningLoader.__init__NcCs||jkrdS|j|g}|t||t|drH||t|drt|jdD]`}|	dr|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.
        Nadditional_tests__path__z.pyz__init__.py.z/__init__.pyr)raddappendrloadTestsFromModulehasattrrr__name__endswithrZloadTestsFromNamelenZ
suiteClass)rmodulepatterntestsfile	submodulerrrr"s$



z"ScanningLoader.loadTestsFromModule)N)r$
__module____qualname__rr"rrrrrsrc@seZdZddZdddZdS)NonDataPropertycCs
||_dSrfget)rr0rrrr<szNonDataProperty.__init__NcCs|dkr|S||Srr/)robjZobjtyperrr__get__?szNonDataProperty.__get__)N)r$r,r-rr2rrrrr.;sr.c@seZdZdZdZdddgZddZdd	Zed
dZ	dd
Z
ddZej
gfddZeej
ddZeddZddZddZeddZeddZdS)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_suitetest_moduletest_loadertest_runnerrrrrinitialize_optionsQsztest.initialize_optionscCs|jr|jrd}t||jdkrD|jdkr8|jj|_n|jd|_|jdkr^t|jdd|_|jdkrnd|_|jdkrt|jdd|_dS)Nz1You may specify a module or a suite, but not bothz.test_suiter9z&setuptools.command.test:ScanningLoaderr:)r7r8rdistributionr9getattrr:)rmsgrrrfinalize_optionsWs




ztest.finalize_optionscCst|Sr)list
_test_argsrrrr	test_argsjsztest.test_argsccs4|jstjdkrdV|jr"dV|jr0|jVdS)N)Zdiscoverz	--verbose)r7sysversion_infoverboserrrrrAnsztest._test_argsc	Cs||W5QRXdS)zI
        Backward compatibility for project_on_sys_path context.
        N)project_on_sys_path)rfuncrrrwith_project_on_sys_pathvs
ztest.with_project_on_sys_pathc	
csJt|jdd}|rp|jddd|d|d}t|j}|jd|d|d|jddd|dn"|d|jdd	d|d|d}tjdd}tj	
}zbt|j}tjd|t
td
dtd|j|jf||gdVW5QRXW5|tjdd<tj	tj	|t
XdS)
Nuse_2to3Fbuild_pyr)Zinplaceegg_info)egg_base	build_extrcSs|Sr)activate)distrrr<lambda>z*test.project_on_sys_path.<locals>.<lambda>z%s==%s)r=r<reinitialize_commandrun_commandget_finalized_commandr	build_librEpathmodulescopyclearupdater	rrNinsertrr
egg_nameZegg_versionpaths_on_pythonpath)	rZ
include_distsZ	with_2to3Zbpy_cmdZ
build_pathZei_cmdold_pathZold_modulesZproject_pathrrrrH}s8









ztest.project_on_sys_pathc
cst}tjd|}tjdd}zBtjt|}td||g}tj|}|r\|tjd<dVW5||kr~tjddn
|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)	objectosenvirongetpoppathsepjoinrfilter)pathsZnothingZorig_pythonpathZcurrent_pythonpathprefixZto_joinnew_pathrrrr_s


ztest.paths_on_pythonpathcCsD||j}||jpg}|dd|jD}t|||S)z
        Install the requirements indicated by self.distribution and
        return an iterable of the dists that were built.
        css0|](\}}|drt|ddr|VqdS):rN)
startswithr).0kvrrr	<genexpr>s
z%test.install_dists.<locals>.<genexpr>)Zfetch_build_eggsZinstall_requiresZ
tests_requireZextras_requireitems	itertoolschain)rQZir_dZtr_dZer_drrr
install_distss
ztest.install_distsc
Cs|dtj||j}d|j}|jr>|d|dS|d|tt	
d|}||"||
W5QRXW5QRXdS)NzWARNING: 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)announcerWARNrvr<rh_argvdry_runmapoperator
attrgetterr_rH	run_tests)rZinstalled_distscmdrjrrrruns
ztest.runcCst|jddrx|jdd}|tkrxg}|tjkr>|||d7}tjD]}||rL||qLt	t
tjj|tj
dd|j||j||jdd}|jsd|j}||tjt|dS)NrKFrr)Z
testLoaderZ
testRunnerexitzTest failed: %s)r=r<r7splitr
rErYr!rnr@r}__delitem__unittestmainr{_resolve_as_epr9r:resultZ
wasSuccessfulryrERRORr)rr'Zdel_modulesnamer3r>rrrrs.







ztest.run_testscCsdg|jS)Nr)rBrrrrr{sz
test._argvcCs$|dkrdStd|}|S)zu
        Load the indicated attribute value, called, as a as if it were
        specified as an entry point.
        Nzx=)rparseresolve)valparsedrrrr	sztest._resolve_as_epN)r$r,r-__doc__descriptionuser_optionsr;r?r.rBrArJ
contextlibcontextmanagerrHstaticmethodr_rvrrpropertyr{rrrrrr3Es2
-


r3)rcr~rErrtrdistutils.errorsrr	distutilsrr
pkg_resourcesrrrr	r
rrr
r
setuptoolsrZ setuptools.extern.more_itertoolsrrr.r3rrrr<module>s,)
Back to Directory File Manager