� �#�^c@s>ddlZddlZddlZddlZddlZddlmZmZddlm Z ddl m Z ddl m Z ddlmZmZddlmZmZmZmZmZmZmZmZmZddlmZdd lmZd e fd ��YZd e fd ��YZ!defd��YZ"dS(i����N(tDistutilsErrortDistutilsOptionError(tlog(t TestLoader(tsix(tmaptfilter( tresource_listdirtresource_existstnormalize_patht working_sett_namespace_packagestevaluate_markertadd_activation_listenertrequiret EntryPoint(tCommand(t unittest_maintScanningLoadercBseZdd�ZRS(cCsg}|jtj||��t|d�rD|j|j��nt|d�r�x�t|jd�D]|}|jd�r�|dkr�|jd|d }n-t|j|d�rf|jd|}nqf|j|j |��qfWnt |�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( tappendRtloadTestsFromModulethasattrRRt__name__tendswithRtloadTestsFromNametlent suiteClass(tselftmoduletpatterntteststfilet submodule((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRs N(Rt __module__tNoneR(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRstNonDataPropertycBseZd�Zdd�ZRS(cCs ||_dS(N(tfget(RR(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyt__init__5scCs|dkr|S|j|�S(N(R&R((Rtobjtobjtype((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyt__get__8s N(RR%R)R&R,(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR'4s 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(R&t test_suitet test_modulet test_loadert test_runner(R((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytinitialize_optionsJs   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_suiteR3s&setuptools.command.test:ScanningLoaderR4(R1R2RR&t distributionR3tgetattrR4(Rtmsg((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytfinalize_optionsPs cCst|j��S(N(tlistt _test_args(R((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyt test_argscsccs)|jrdVn|jr%|jVndS(Ns --verbose(tverboseR1(R((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR;gs  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_pathms 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<lambda>�ss%s==%s(RtPY3R7R6tFalsetreinitialize_commandt run_commandtget_finalized_commandR t build_libtsystpathtmodulestcopyREtinsertR R)R 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.pyR>ts8         ccs�t�}tjjd|�}tjjdd�}zXtjj|�}td||g�}tjj|�}|r�|tjd<ndVWd||kr�tjjdd�n |tjd<XdS(s� 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. t PYTHONPATHRN( tobjecttostenvirontgettpathseptjoinRR&tpop(tpathstnothingtorig_pythonpathtcurrent_pythonpathtprefixtto_jointnew_path((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyRW�s   cCs_|j|j�}|j|jp$g�}|jd�|jj�D��}tj|||�S(s� Install the requirements indicated by self.distribution and return an iterable of the dists that were built. css:|]0\}}|jd�rt|d�r|VqdS(t:iN(t startswithR (t.0tktv((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pys <genexpr>�s (tfetch_build_eggstinstall_requirest tests_requiretextras_requiretitemst itertoolstchain(RHtir_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�R6Rht_argvtdry_runtannounceRtoperatort attrgetterRWR>t run_tests(Rtinstalled_diststcmdRj((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pytrun�s  c Csatjr�t|jdt�r�|jjd�d}|tkr�g}|tj kre|j |�n|d7}x0tj D]%}|j |�ry|j |�qyqyWt t tj j|��q�ntjd kr�in itd6}tdd|jd|j|j�d|j|j�|�}|jj�s]d |j}|j|tj�t|��ndS( NRARiiitexitt testLoadert testRunnersTest failed: %s(ii(RRJR7R6RKR1tsplitR RPRRRRrR:Rt __delitem__t version_infoRR&R�t_resolve_as_epR3R4tresultt wasSuccessfulR�RtERRORR(RR t del_modulestnamet exit_kwargR-R8((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR��s*  "  cCsdg|jS(Ntunittest(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=(R&Rtparsetresolve(tvaltparsed((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR��s (s test-module=R.s$Run 'test_suite' in specified module(s test-suite=R/s9Run single test, case or suite (e.g. 'module.test_suite')(s test-runner=R0sTest runner to use(RR%t__doc__t descriptiont user_optionsR5R9R'R<R;R@t contextlibtcontextmanagerR>t staticmethodRWR�R�R�tpropertyR�R�(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyR->s(     -  (#RdR�RPR�R{tdistutils.errorsRRt distutilsRR�Rtsetuptools.externRtsetuptools.extern.six.movesRRt pkg_resourcesRRR R R R R RRt setuptoolsRtsetuptools.py31compatRRRcR'R-(((s;/usr/lib/python2.7/site-packages/setuptools/command/test.pyt<module>s     @