2[c@`sddlmZmZmZddlZddlZddlZddlZddlZddl Z ddl m Z ddl mZmZddlmZddlmZddlmZdd lmZmZd ejfd YZd ejfd YZde jfdYZejZ de j!fdYZ"de#fdYZ$defdYZ%e%Z&defdYZ'de j(j)fdYZ*dS(i(tdivisiontabsolute_importtprint_functionN(tdoctests(t ErrorClasstErrorClassPlugin(tPlugin(tsrci(tget_package_name(tKnownFailureExceptiontKnownFailureTesttNumpyDocTestFindercB`seZdZdZRS(cC`s|dkrtStj|r/|j|jkStj|rN|j|jkStj |rm|j|jkStj |r|j|j j jkStj |dk r|tj |kSt|dr|j|jkSt|trtStddS(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 __globals__t isbuiltint__name__R tisclasstismethodt__self__t __class__t getmodulethasattrt isinstancetpropertyt ValueError(tselftmoduletobject((sA/tmp/pip-build-fiC0ax/numpy/numpy/testing/_private/noseclasses.pyt _from_module s" c C`stjj||||||||ddlm}m} m} m} m} | |r|j rx||j j D]h\} }d|| f}||s| |rr|j ||rr|j|||||||qrqrWn| |r|j rx|j j D]\} }t |tr3t|| }nt |trWt|| j}n| |s| |s| |st |tr|j ||rd|| f} |j||| ||||qqWndS(sm Find tests for the given object and any contained objects, and add them to `tests`. i(t isroutineRtismoduleRRs%s.%sN(tdoctestt DocTestFindert_findRR"RR#RRt_recurseRtitemsR!Rt staticmethodtgetattrt classmethodt__func__R(RtteststobjtnameRt source_linestglobstseenR"RR#RRtvalnametvaltvalname1((sA/tmp/pip-build-fiC0ax/numpy/numpy/testing/_private/noseclasses.pyR&<s, ((RR R!R&(((sA/tmp/pip-build-fiC0ax/numpy/numpy/testing/_private/noseclasses.pyR s tNumpyOutputCheckercB`seZdZRS(cC`stjj||||}|sd|kr1tS|jdd}|jdd}x@ddgD]2}|jd|d}|jd|d}qbWtjj||||}n|S(Ns#randoms'>s'eZdZdZeZdZddZdZdZ RS(si Nose plugin to remove named plugin late in loading By default it removes the "doctest" plugin. t unpluggeriR$cC`s ||_dS(N(t to_unplug(RR((sA/tmp/pip-build-fiC0ax/numpy/numpy/testing/_private/noseclasses.pyRHscC`sdS(N((RRPRQ((sA/tmp/pip-build-fiC0ax/numpy/numpy/testing/_private/noseclasses.pyRMscC`s;g|jjD]}|j|jkr |^q |j_dS(N(RWR/R(RRMRXRY((sA/tmp/pip-build-fiC0ax/numpy/numpy/testing/_private/noseclasses.pyRRs( RR t__doc__R/RRVRRHRMRR(((sA/tmp/pip-build-fiC0ax/numpy/numpy/testing/_private/noseclasses.pyRs  tKnownFailurePlugincB`sDeZdZeZeedddeZe j dZ dZ RS(s1Plugin that installs a KNOWNFAIL error class for the KnownFailureClass exception. When KnownFailure is raised, the exception will be logged in the knownfail attribute of the result, 'K' or 'KNOWNFAIL' (verbose) will be output, and the exception will not be counted as an error or failure.tlabelt KNOWNFAILt isfailurec C`s;d}|jdddddd|j|tdd dS( NtNOSE_WITHOUT_KNOWNFAILs--no-knownfailtactiont store_truetdestt noKnownFailtdefaultthelps3Disable special handling of KnownFailure exceptions(t add_optiontgetR|(RRPRQtenv_opt((sA/tmp/pip-build-fiC0ax/numpy/numpy/testing/_private/noseclasses.pyRM/scC`s>|js dS||_t|dt}|r:t|_ndS(NR(t can_configuretconfR*R|RV(RRMRtdisable((sA/tmp/pip-build-fiC0ax/numpy/numpy/testing/_private/noseclasses.pyRR6s   ( RR RRRVRR R|t knownfailR`RRMRR(((sA/tmp/pip-build-fiC0ax/numpy/numpy/testing/_private/noseclasses.pyR$s  tFPUModeCheckPlugincB`seZdZdZRS(sx Plugin that checks the FPU mode before and after each test, raising failures if the test changed the mode. c`s&ddlmfd}|S(Ni(t get_fpu_modec`sx}j|}||krtytdj||Wqttk rp|jtjqtXndS(Ns6FPU mode changed from {0:#x} to {1:#x} during the test(RItAssertionErrortformatt addFailuretsystexc_info(tresulttold_modetnew_mode(RRI(sA/tmp/pip-build-fiC0ax/numpy/numpy/testing/_private/noseclasses.pytrunJs     (tnumpy.core._multiarray_testsR(RRIR((RRIsA/tmp/pip-build-fiC0ax/numpy/numpy/testing/_private/noseclasses.pytprepareTestCaseGs (RR RR(((sA/tmp/pip-build-fiC0ax/numpy/numpy/testing/_private/noseclasses.pyRAstNumpyTestProgramcB`seZdZRS(cC`s|jdkrEtjjd|jjd|jjd|j|_n|jjj |j}|dk ru||_n|jj |j |_ |j j |_|jS(sRun Tests. Returns true on success, false on failure, and sets self.success to the same value. Because nose currently discards the test result object, but we need to return it to the user, override TestProgram.runTests to retain the result tstreamt verbosityRXN(t testRunnerR tnosetcoretTextTestRunnerRXRRRWtprepareTestRunnerRRIRt wasSuccessfultsuccess(Rt plug_runner((sA/tmp/pip-build-fiC0ax/numpy/numpy/testing/_private/noseclasses.pytrunTests]s   (RR R(((sA/tmp/pip-build-fiC0ax/numpy/numpy/testing/_private/noseclasses.pyR\s(+t __future__RRRR`RR$RRdRt nose.pluginsRRktnose.plugins.errorclassRRtnose.plugins.baseRt nose.utilRt nosetesterRtutilsR R R%R R8R6RGR@tget_printoptionsRxR}RKR RRt KnownFailureRRt TestProgramR(((sA/tmp/pip-build-fiC0ax/numpy/numpy/testing/_private/noseclasses.pyts,       O x