_dddlZddlZddlZddlZddlZddlZddlmZmZddl m Z ddlm Z ddl m Z mZmZmZmZmZmZddlmZddlmZdd lmZdd lmZGd d e ZGd dZGddeZy)N)DistutilsErrorDistutilsOptionError)log) TestLoader)resource_listdirresource_existsnormalize_path working_setevaluate_markeradd_activation_listenerrequire)metadata)Command)unique_everseen) pass_noneceZdZdZddZy)ScanningLoadercLtj|t|_yN)r__init__set_visitedselfs 9/usr/lib/python3/dist-packages/setuptools/command/test.pyrzScanningLoader.__init__sD! Nc||jvry|jj|g}|jtj||t |dr|j|j t |drt|jdD]{}|jdr|dk7r|jdz|ddz}n-t|j|d zr|jdz|z}n\|j|j|}t|d k7r|j|S|d S) 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__endswithrloadTestsFromNamelen suiteClass)rmodulepatterntestsfile submodules rr'z"ScanningLoader.loadTestsFromModules T]] " &! Z33D&AB 6- . LL002 3 6: &("= @=='DM,A &# 5Sb AI&v~8MN$*OOc$9D$@   T33I>? @ u:???5) )8Orr)r) __module__ __qualname__rr'rrrrs rrceZdZdZddZy)NonDataPropertyc||_yrfget)rr:s rrzNonDataProperty.__init__Cs  rNc,||S|j|Srr9)robjobjtypes r__get__zNonDataProperty.__get__Fs ;Kyy~rr)r)r3r4rr>r5rrr7r7Bs rr7ceZdZdZdZgdZdZdZedZ dZ dZ e jgfd Zee jd Zed Zd Zd ZedZeedZy)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 usec<d|_d|_d|_d|_yr) test_suite test_module test_loader test_runnerrs rinitialize_optionsztest.initialize_options[s!rc|jr|jr d}t||j<|j|jj|_n|jdz|_|jt |jdd|_|jd|_|j t |jdd|_yy)Nz1You may specify a module or a suite, but not bothz .test_suiterGz&setuptools.command.test:ScanningLoaderrH)rErFr distributionrGgetattrrH)rmsgs rfinalize_optionsztest.finalize_optionsas ??t//EC&s+ + ?? "'"&"3"3">">"&"2"2]"B    #&t'8'8-ND     #GD     #&t'8'8-ND  $rc4t|jSr)list _test_argsrs r test_argsztest.test_argsssDOO%&&rc#K|jsd|jrd|jr|jyyw)Ndiscoverz --verbose)rEverbosers rrQztest._test_argsws6  <<  ??// ! s=?c\|j5|dddy#1swYyxYw)zI Backward compatibility for project_on_sys_path context. N)project_on_sys_path)rfuncs rwith_project_on_sys_pathztest.with_project_on_sys_paths* % % '  F   s"+c#K|jd|jdd|jd|jd}tjdd}tj j } t|j}tjjd|tjtdt|jd|j|j!|g5dddd|tjddtj j#tj j%|tjy#1swYnxYw#|tjddtj j#tj j%|tjwxYww)Negg_info build_extr$)inplacerc"|jSr)activate)dists rz*test.project_on_sys_path..s rz==) run_commandreinitialize_commandget_finalized_commandsyspathmodulescopyr egg_baseinsertr rr r egg_name egg_versionpaths_on_pythonpathclearupdate)r include_distsei_cmdold_path old_modules project_paths rrWztest.project_on_sys_pathsY $ !!+q!9 %++J788A;kk&&(  #)&//:L HHOOA| ,  " #$@ A 1C1CD E))<.9  #CHHQK KK    KK  { +  "   #CHHQK KK    KK  { +  "s9A8G-;B FE8 FA%G-8F=FA&G**G-c#hKt}tjjd|}tjjdd} tjj t |}td||g}tjj |}|r|tjd<d||ur!tjjddy|tjd<y#||ur!tjjddw|tjd<wxYww)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) objectosenvirongetpathsepjoinrfilterpop)pathsnothingorig_pythonpathcurrent_pythonpathprefixto_joinnew_paths rrmztest.paths_on_pythonpaths(**..w?ZZ^^L"= ;ZZ___U%;#?@Gzzw/H+3 <( ') |T2+: <(') |T2+: <(sA D2A.C5<9D25:D//D2c|j|j}|j|jxsg}|jd|jj D}t j |||S)z Install the requirements indicated by self.distribution and return an iterable of the dists that were built. c3dK|](\}}|jdrt|ddr|*yw):r$N) startswithr ).0kvs r z%test.install_dists..s5% 1||C _QqrU%; % s.0)fetch_build_eggsinstall_requires tests_requireextras_requireitems itertoolschain)r`ir_dtr_der_ds r install_distsztest.install_distssv $$T%:%:;$$T%7%7%=2>$$% ++113%   tT400rc|jdtj|j|j}dj |j }|jr|jd|zy|jd|zttjd|}|j|5|j5|jddddddy#1swYxYw#1swYyxYw)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)announcerWARNrrKr|_argvdry_runmapoperator attrgetterrmrW run_tests)rinstalled_distscmdrs rrunztest.runs   HH  ,,T->->?hhtzz" << MM3c9 :  ns*+H'' 3_E  % %e , !))+ !  ! ! ! ! ! ! !s$<C; C/C;/C8 4C;;Dc Ztjdd|j|j|j|j|j d}|j js:d|j z}|j|tjt|y)NF) testLoader testRunnerexitzTest failed: %s) unittestmainr_resolve_as_eprGrHresult wasSuccessfulrrERRORr)rr@rMs rrztest.run_testss}}   JJ**4+;+;<**4+;+;<  {{((*#dkk1C MM#syy ) % %+rc"dg|jzS)Nr)rRrs rrz test._argvs|dnn,,rcXtj|ddjS)zu Load the indicated attribute value, called, as a as if it were specified as an entry point. N)valuenamegroup)r EntryPointload)vals rrztest._resolve_as_eps(Lx""4tDIIKMMrN)r)r3r4__doc__ description user_optionsrIrNr7rRrQrY contextlibcontextmanagerrW staticmethodrmrrrpropertyrrrr5rrr@r@Ls8DKL O$''"02##4;;0 1 1!. &--NNrr@)rxrrerrrdistutils.errorsrr distutilsrr pkg_resourcesrrr r r r r _importlibr setuptoolsr setuptools.extern.more_itertoolsr"setuptools.extern.jaraco.functoolsrrr7r@r5rrrsd  A"<8$Z$PnN7nNr