b-Qc@sddlmZddlmZddlZddlTddlmZddlmZm Z defdYZ d efd YZ dS( i(tCommand(tDistutilsOptionErrorN(t*(t_namespace_packages(t TestLoadertmaintScanningLoadercBseZdZRS(cCs&g}|jdkr1|jtj||nt|drV|j|jnt|drxt|jdD]|}|jdr|dkr|jd|d }n-t|j|d rx|jd|}nqx|j|j |qxWnt |d kr|j |S|d Sd S( sReturn 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. ssetuptools.tests.doctesttadditional_testst__path__ts.pys __init__.pyt.is /__init__.pyiiN( t__name__tappendRtloadTestsFromModulethasattrRtresource_listdirtendswithtresource_existstloadTestsFromNametlent suiteClass(tselftmoduletteststfilet submodule((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR s" (R t __module__R (((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRsttestcBsMeZdZdZd dgZdZd Zd Zd Zd Z RS(s.Command to run unit tests after in-place builds#run unit tests after in-place builds test-module=tms$Run 'test_suite' in specified modules test-suite=tss1Test suite to run (e.g. 'some_module.test_suite')cCsd|_d|_d|_dS(N(tNonet test_suitet test_modulet test_loader(R((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytinitialize_options7s  cCs|jdkrC|jdkr0|jj|_q[|jd|_n|jr[tdn|jg|_|jr|jjddn|jdkrt |jdd|_n|jdkrd|_ndS(Ns .test_suites1You may specify a module or a suite, but not bothis --verboseR!s&setuptools.command.test:ScanningLoader( RRR t distributionRt test_argstverbosetinsertR!tgetattr(R((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytfinalize_options=s   cCstjd krt|jdtr|jddd|jd|jd}t|j }|jdd||jd|jddd|jdn-|jd|jddd |jd|jd}tj }tj j }zXtj j dt|jtjtd td |j|jf|Wd|tj (tj jtj j|tjXdS( Nituse_2to3tbuild_pytinplaceitegg_infotegg_baset build_exticSs |jS(N(tactivate(tdist((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyttss%s==%s(i(tsyst version_infoR'R#tFalsetreinitialize_commandt run_commandtget_finalized_commandtnormalize_patht build_libtpathtmodulestcopyR&R-t working_sett__init__tadd_activation_listenertrequiretegg_namet egg_versiontcleartupdate(Rtfunctbpy_cmdt build_pathtei_cmdtold_patht old_modules((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytwith_project_on_sys_pathTs2$          cCs|jjr%|jj|jjn|jjrJ|jj|jjn|jrdj|j}|jr|jd|q|jd||j |j ndS(Nt s skipping "unittest %s" (dry run)srunning "unittest %s"( R#tinstall_requirestfetch_build_eggst tests_requireRtjoinR$tdry_runtannounceRKt run_tests(Rtcmd((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytrun~s    cCs2ddl}tjd krt|jdtr|jdjdd}|tkrg}|tj kr{|j |n|d7}x0tj D]%}|j |r|j |qqWt t tj j|qntjd|j}|jdt}|}|jdd|jg|jd|dS( NiiR)R isx=R@t testLoader(i(tunittestR2R3R'R#R4R$tsplitRR;R t startswithtlisttmapt __delitem__t EntryPointtparseR!tloadRRt__file__(RRWRt del_modulestnamet loader_ept loader_classtcks((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRSs$ $   (s test-module=Rs$Run 'test_suite' in specified module(s test-suite=Rs1Test suite to run (e.g. 'some_module.test_suite')( R Rt__doc__t descriptiont user_optionsR"R(RKRURS(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR+s    * ( t setuptoolsRtdistutils.errorsRR2t pkg_resourcesRRWRRRR(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyts  #