� �fc@s:ddlZddlZddlZddlZddlZddlZddlmZmZddl m Z ddlm Z ddl m Z ddlmZmZddlmZmZmZmZmZmZmZmZmZddlmZd e fd ��YZd efd ��YZd efd��YZ dS(i����N(tDistutilsErrortDistutilsOptionError(tlog(t TestLoader(tsix(tmaptfilter( tresource_listdirtresource_existstnormalize_patht working_sett_namespace_packagestevaluate_markertadd_activation_listenertrequiret EntryPoint(tCommandtScanningLoadercBseZd�Zdd�ZRS(cCstj|�t�|_dS(N(Rt__init__tsett_visited(tself((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRs cCs7||jkrd S|jj|�g}|jtj||��t|d�rg|j|j��nt|d�r x�t|j d�D]|}|j d�r�|dkr�|j d|d }n-t |j |d�r�|j d|}nq�|j|j |��q�Wnt |�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. tadditional_testst__path__ts.pys __init__.pyt.i����s /__init__.pyiiN(RtNonetaddtappendRtloadTestsFromModulethasattrRRt__name__tendswithRtloadTestsFromNametlent suiteClass(Rtmoduletpatterntteststfilet submodule((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRs$ N(Rt __module__RRR(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRs tNonDataPropertycBseZd�Zdd�ZRS(cCs ||_dS(N(tfget(RR+((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR>scCs|dkr|S|j|�S(N(RR+(Rtobjtobjtype((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyt__get__As N(RR)RRR.(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR*=s ttestcBs�eZdZdZdddgZd �Zd �Zed ��Zd�Z d�Z e j gd��Z ee j d���Zed��Zd�Zd�Zed��Zed��ZRS(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=tss9Run single test, case or suite (e.g. 'module.test_suite')s test-runner=trsTest runner to usecCs(d|_d|_d|_d|_dS(N(Rt test_suitet test_modulet test_loadert test_runner(R((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytinitialize_optionsSs   cCs�|jr'|jr'd}t|��n|jdkrj|jdkrW|jj|_qj|jd|_n|jdkr�t|jdd�|_n|jdkr�d|_n|jdkr�t|jdd�|_ndS(Ns1You may specify a module or a suite, but not boths .test_suiteR5s&setuptools.command.test:ScanningLoaderR6(R3R4RRt distributionR5tgetattrR6(Rtmsg((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytfinalize_optionsYs cCst|j��S(N(tlistt _test_args(R((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyt test_argslsccsJ|j r!tjdkr!dVn|jr2dVn|jrF|jVndS(Niitdiscovers --verbose(ii(R3tsyst version_infotverbose(R((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR=ps   cCs|j�� |�WdQXdS(sI Backward compatibility for project_on_sys_path context. N(tproject_on_sys_path(Rtfunc((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytwith_project_on_sys_pathxs c cs�tjot|jdt�}|r�|jddd�|jd�|jd�}t|j �}|jdd|�|jd�|jddd�|jd�n-|jd�|jddd�|jd�|jd�}t j }t j j �}zut|j�}t j jd|�tj�td ��td |j|jf�|j|g�� dVWdQXWd|t j (t j j�t j j|�tj�XdS( Ntuse_2to3tbuild_pytinplaceitegg_infotegg_baset build_exticSs |j�S(N(tactivate(tdist((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyt�Rs%s==%s(RtPY3R9R8tFalsetreinitialize_commandt run_commandtget_finalized_commandR t build_libR@tpathtmodulestcopyRJtinsertR RR Rtegg_namet egg_versiontpaths_on_pythonpathtcleartupdate( Rt include_distst with_2to3tbpy_cmdt build_pathtei_cmdtold_patht old_modulest project_path((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRCs8         ccs�t�}tjjd|�}tjjdd�}zXtjj|�}td||g�}tjj|�}|r�|tjd�s (tfetch_build_eggstinstall_requirest tests_requiretextras_requiretitemst itertoolstchain(RMtir_dttr_dter_d((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyt install_dists�s c Cs�|j|j�}dj|j�}|jrB|jd|�dS|jd|�ttjd�|�}|j |��"|j ��|j �WdQXWdQXdS(Nt sskipping "%s" (dry run)s running "%s"tlocation( R�R8Rlt_argvtdry_runtannounceRtoperatort attrgetterR[RCt run_tests(Rtinstalled_diststcmdRn((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytrun�s  c CsEtjr�t|jdt�r�|jjd�d}|tkr�g}|tj kre|j |�n|d7}x0tj D]%}|j |�ry|j |�qyqyWt t tj j|��q�ntjdd|jd|j|j�d|j|j�dt�}|jj�sAd|j}|j|tj�t|��ndS(NRFRit testLoadert testRunnertexitsTest failed: %s(RROR9R8RPR3tsplitR R@RVRRvR<Rt __delitem__tunittesttmainRR�t_resolve_as_epR5R6tresultt wasSuccessfulR�RtERRORR(RR$t del_modulestnameR/R:((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR��s(    cCsdg|jS(NR�(R>(R((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR��scCs0|dkrdStjd|�}|j��S(su Load the indicated attribute value, called, as a as if it were specified as an entry point. Nsx=(RRtparsetresolve(tvaltparsed((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR�s (s test-module=R0s$Run 'test_suite' in specified module(s test-suite=R1s9Run single test, case or suite (e.g. 'module.test_suite')(s test-runner=R2sTest runner to use(RR)t__doc__t descriptiont user_optionsR7R;R*R>R=REt contextlibtcontextmanagerRCt staticmethodR[R�R�R�tpropertyR�R�(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR/Gs(     -  (!RhR�R@R�RR�tdistutils.errorsRRt distutilsRRtsetuptools.externRtsetuptools.extern.six.movesRRt pkg_resourcesRRR R R R R RRt setuptoolsRRRgR*R/(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyts      @)