ó ]ĐKc@sddlZddlZddlZddlmZddlmZmZddl m Z ddl m Z m Z ddlZddlmZddlZddd d gZd ejfd „ƒYZd ejfd„ƒYZdejfd„ƒYZd ejfd„ƒYZejƒZdejfd„ƒYZdefd„ƒYZdefd„ƒYZdej j!fd„ƒYZ"dS(i˙˙˙˙N(tdoctests(t ErrorClasstErrorClassPlugin(tPlugin(tsrct getpackage(tget_package_namesgenerate_numpy_api.pysscons_support.pys setupscons.pyssetup.pytNumpyDocTestFindercBseZd„Zd„ZRS(cCsů|dkrtStj|ƒr/|j|jkStj|ƒrN|j|jkStj |ƒrm|j|jkStj |ƒr|j|j jkStj |ƒdk rˇ|tj |ƒkSt |dƒrÖ|j|jkSt|tƒrétStdƒ‚dS(sY Return true if the given object is defined in the given module. t __module__s"object must be a class or functionN(tNonetTruetinspectt isfunctiont__dict__t func_globalst isbuiltint__name__Rtisclasstismethodtim_classt getmodulethasattrt isinstancetpropertyt ValueError(tselftmoduletobject((s=/usr/lib/python2.7/site-packages/numpy/testing/noseclasses.pyt _from_module s" c CsŮtjj||||||||ƒddlm}m} m} m} m} | |ƒrá|j ráx||j j ƒD]h\} }d|| f}||ƒsŚ| |ƒrr|j ||ƒrr|j|||||||ƒqrqrWn| |ƒrŐ|j rŐxÜ|j j ƒD]Č\} }t |tƒr3t|| ƒ}nt |tƒrWt|| ƒj}n| |ƒsŠ| |ƒsŠ| |ƒsŠt |tƒr|j ||ƒrd|| f} |j||| ||||ƒqqWndS(sm Find tests for the given object and any contained objects, and add them to `tests`. i˙˙˙˙(t isroutineRtismoduleR Rs%s.%sN(tdoctestt DocTestFindert_findR RRRR Rt_recurseR titemsRRt staticmethodtgetattrt classmethodtim_funcR(RtteststobjtnameRt source_linestglobstseenRRRR Rtvalnametvaltvalname1((s=/usr/lib/python2.7/site-packages/numpy/testing/noseclasses.pyR!Gs, ((RRRR!(((s=/usr/lib/python2.7/site-packages/numpy/testing/noseclasses.pyRs 'tNumpyDocTestCasecBseZdZd„ZRS(sNProxy for DocTestCase: provides an address() method that returns the correct address for the doctest case. Otherwise acts as a proxy to the test case. To provide hints for address(), an obj may also be passed -- this will be used as the test object for purposes of determining the test address, if it is provided. cCsf|jj}|jj}|dk rbt|ƒ}|dk rb|j|ƒ rbd||f}qbn|S(Ns%s.%s(t_dt_testR*tfilenameR Rt startswith(RR*R3tpk((s=/usr/lib/python2.7/site-packages/numpy/testing/noseclasses.pytidƒs    (RRt__doc__R6(((s=/usr/lib/python2.7/site-packages/numpy/testing/noseclasses.pyR1xstNumpyOutputCheckercBseZd„ZRS(cCs8tjj||||ƒ}|s4d|kr4tSn|S(Ns#random(Rt OutputCheckert check_outputR (Rtwanttgott optionflagstret((s=/usr/lib/python2.7/site-packages/numpy/testing/noseclasses.pyR:‘s   (RRR:(((s=/usr/lib/python2.7/site-packages/numpy/testing/noseclasses.pyR8scBs#eZddddddd„ZRS(it_c CsA||_||_tjj||d|d|d|d|ƒdS(NR=tsetUpttearDowntchecker(t _result_vart _nose_objRt DocTestCaset__init__(RttestR=R@RARBR)t result_var((s=/usr/lib/python2.7/site-packages/numpy/testing/noseclasses.pyRFŸs    N(RRR RF(((s=/usr/lib/python2.7/site-packages/numpy/testing/noseclasses.pyR1žs t NumpyDoctestcBsGeZdZeZejd„Zd„Zd„Z d„Z d„Z RS(t numpydoctestcCstj|||ƒdS(N(Rtoptions(Rtparsertenv((s=/usr/lib/python2.7/site-packages/numpy/testing/noseclasses.pyRKŻscCs;tj|||ƒt|_tƒ|_tjƒ|_dS(N( Rt configureR t doctest_testsRtfinderRt DocTestParserRL(RRKtconfig((s=/usr/lib/python2.7/site-packages/numpy/testing/noseclasses.pyRN˛s  c csw|j|jƒs)tjjd|ƒdSy|jj|ƒ}Wntk rSdSX|s^dS|jƒt |j ƒ}xů|D]ń}|j s“q~n|j s¨||_ nt tjj|j ƒƒ}itd6dd6dd6td6|_d|krE|jdƒ}dj|d ƒ}|d }t||ji|gƒ|j||js dS||_t|dtƒ}|r:t|_ndS(NR…(t can_configuretconfR%RuRz(RRKRŒtdisable((s=/usr/lib/python2.7/site-packages/numpy/testing/noseclasses.pyRNs   ( RRR7R RzRR|Rut knownfailRaR{RKRN(((s=/usr/lib/python2.7/site-packages/numpy/testing/noseclasses.pyR}s  tNumpyTestProgramcBseZd„ZRS(cCsŚ|jdkrEtjjd|jjd|jjd|jƒ|_n|jjj |jƒ}|dk ru||_n|jj |j ƒ|_ |j j ƒ|_|jS(soRun Tests. Returns true on success, false on failure, and sets self.success to the same value. tstreamt verbosityRRN(t testRunnerR tnosetcoretTextTestRunnerRRRR‘tpluginstprepareTestRunnertrunRGtresultt wasSuccessfultsuccess(Rt plug_runner((s=/usr/lib/python2.7/site-packages/numpy/testing/noseclasses.pytrunTests s   (RRR(((s=/usr/lib/python2.7/site-packages/numpy/testing/noseclasses.pyRs(#RaRR“t nose.pluginsRRZtnose.plugins.errorclassRRtnose.plugins.baseRt nose.utilRRRdt nosetesterRR RtR RRER1R9R8tget_printoptionsRqRvRIt ExceptionR|R}R”t TestProgramR(((s=/usr/lib/python2.7/site-packages/numpy/testing/noseclasses.pyts(      Z P