zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
U
G=®d—%ã@sîddlZddlZddlZddlZddlZddlZddlmZmZddl    m
Z
ddlm Z ddl m Z ddlmZmZddlmZmZmZmZmZmZmZmZmZddlmZd    d
lmZeZ Gd d „d e ƒZ!Gd d„dƒZ"Gdd„deƒZ#dS)éN)ÚDistutilsErrorÚDistutilsOptionError)Úlog)Ú
TestLoader)Úsix)ÚmapÚfilter)    Ú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úND:\z\workplace\VsCode\pyvenv\venv\Lib\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|d SdS) 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__Úendswithr
ZloadTestsFromNameÚlenZ
suiteClass)rÚmoduleÚpatternÚtestsÚfileÚ    submodulerrrr%s$
 
 
 
z"ScanningLoader.loadTestsFromModule)N)r'Ú
__module__Ú __qualname__rr%rrrrrsrc@seZdZdd„Zddd„ZdS)ÚNonDataPropertycCs
||_dSr©Úfget)rr3rrrrAszNonDataProperty.__init__NcCs|dkr |S| |¡Srr2)rÚobjZobjtyperrrÚ__get__DszNonDataProperty.__get__)N)r'r/r0rr5rrrrr1@sr1c@s¢eZdZdZdZdddgZdd„Zdd    „Zed
d „ƒZ    d d „Z
dd„Z e 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)z test-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_optionsVsztest.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=)r:r;rÚ distributionr<Úgetattrr=)rÚmsgrrrÚfinalize_options\s 
 
 
 
 
ztest.finalize_optionscCs t| ¡ƒSr)ÚlistÚ
_test_argsrrrrÚ    test_argsosztest.test_argsccs4|jstjdkrdV|jr"dV|jr0|jVdS)N)ééZdiscoverz    --verbose)r:ÚsysÚ version_infoÚverboserrrrrDss 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_path{s
ztest.with_project_on_sys_pathc    
csRtj ot|jddƒ}|rx|jddd| d¡| d¡}t|jƒ}|jd|d| d¡|jddd| d¡n"| d¡|jdd    d| d¡| d¡}t    j
dd…}t    j   ¡}zbt|jƒ}t    j
 d|¡t ¡td
d „ƒtd |j|jfƒ| |g¡ dVW5QRXW5|t    j
dd…<t    j   ¡t    j  |¡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ÚPY2r@r?Úreinitialize_commandÚ run_commandÚget_finalized_commandr Ú    build_librHÚpathÚmodulesÚcopyÚclearÚupdater rrQÚinsertrrÚegg_nameZ egg_versionÚpaths_on_pythonpath)    rZ include_distsZ    with_2to3Zbpy_cmdZ
build_pathZei_cmdÚold_pathZ old_modulesZ project_pathrrrrK‚s@
ÿ
 
 
 
 
 
 
 
 
 
 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.
        Ú
PYTHONPATHr N)    ÚobjectÚosÚenvironÚgetÚpopÚpathsepÚjoinrr)ÚpathsZnothingZorig_pythonpathZcurrent_pythonpathÚprefixZto_joinÚnew_pathrrrrc±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)rTZir_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ÚWARNryr?rlÚ_argvÚdry_runrÚoperatorÚ
attrgetterrcrKÚ    run_tests)rZinstalled_distsÚcmdrmrrrÚrunÙsû   
ztest.runcCsÔtjs~t|jddƒr~|j d¡d}|tkr~g}|tjkrD|     |¡|d7}tjD]}| 
|¡rR|     |¡qRt t tjj |ƒƒtjdd|j| |j¡| |j¡dd}|j ¡sÐd|j}| |tj¡t|ƒ‚dS)NrNFr!r)Z
testLoaderZ
testRunnerÚexitzTest failed: %s)rrWr@r?r:Úsplitr rHr]r$rqrCrÚ __delitem__ÚunittestÚmainr~Ú_resolve_as_epr<r=ÚresultZ wasSuccessfulr|rÚERRORr)rr*Z del_modulesÚnamer6rArrrr‚ðs.
 
 
 
 
 
ü
 
ztest.run_testscCs dg|jS)Nrˆ)rErrrrr~ 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/r0Ú__doc__Ú descriptionÚ user_optionsr>rBr1rErDrMÚ
contextlibÚcontextmanagerrKÚ staticmethodrcryr„r‚Úpropertyr~rŠrrrrr6Js2ü
. 
 
r6)$rgr€rHr•rwrˆÚdistutils.errorsrrÚ    distutilsrrZsetuptools.externrZsetuptools.extern.six.movesrrÚ pkg_resourcesr    r
r r r rrrrÚ
setuptoolsrrOrÚtypeÚ __metaclass__rr1r6rrrrÚ<module>s"   ,  )