Current File : //proc/self/root/proc/self/root/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyc
�
E�`Qc@sdddlZddlZddlZddlmZddlmZmZddl	m
Z
ddlmZddl
Z
ddlmZddlZdejfd��YZd	ejfd
��YZdejfd��YZe
j�Zd
ejfd��YZdefd��YZdefd��YZdefd��YZdej j!fd��YZ"dS(i����N(tdoctests(t
ErrorClasstErrorClassPlugin(tPlugin(tsrc(tget_package_nametNumpyDocTestFindercBseZd�Zd�ZRS(cCs�|dkrtStj|�r/|j|jkStj|�rN|j|jkStj	|�rm|j|jkStj
|�r�|j|jjkStj|�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/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyt_from_modules"cCs�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	isroutineRtismoduleRRs%s.%sN(tdoctestt
DocTestFindert_findR
RRRRRt_recurseRtitemsRRtstaticmethodtgetattrtclassmethodtim_funcR(RtteststobjtnameRtsource_linestglobstseenRRRRRtvalnametvaltvalname1((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyR As,
((RRRR (((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyRs	%tNumpyOutputCheckercBseZd�ZRS(cCs�tjj||||�}|s�d|kr1tS|jdd�}|jdd�}x@ddgD]2}|jd|d�}|jd|d�}qbWtjj||||�}n|S(Ns#randoms'>s'<iis'<i%d'tint(Rt
OutputCheckertcheck_outputR	treplace(Rtwanttgottoptionflagstrettsz((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyR3vs	(RRR3(((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyR0ustNumpyDocTestCasecBs#eZddddddd�ZRS(it_cCsA||_||_tjj||d|d|d|d|�dS(NR7tsetUpttearDowntchecker(t_result_vart	_nose_objRtDocTestCaset__init__(RttestR7R<R=R>R(t
result_var((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyRB�s		N(RRRRB(((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyR:�s	tNumpyDoctestcBs�eZdZdZejejBZddddgZe	Z
eZe
Zejd�Zd�Zd�Zd	�Zd
�Zd�ZRS(tnumpydoctesti�sgenerate_numpy_api.pysscons_support.pys
setupscons.pyssetup.pycCs)tj|||�t|_d|_dS(N(RtoptionsR	t
doctest_testsRtdoctest_result_var(Rtparsertenv((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyRG�s	cCsutj|||�|j�|_tj�|_|jrqg|jjD]}|j	dkrG|^qG|j_ndS(NR(
Rt	configurettest_finder_classtfinderRt
DocTestParserRJtenabledtpluginsR)(RRGtconfigtp((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyRL�s	cCs�ttjj|j��}itd6dd6dd6td6|_d|kr�|jd�}|d}t	||ji|g�|j|<nd	S(
s` Configure `test` object to set test context

        We set the numpy / scipy standard doctest namespace

        Parameters
        ----------
        test : test object
            with ``globs`` dictionary defining namespace

        Returns
        -------
        None

        Notes
        -----
        `test` object modified in place
        t__builtins__t__main__t__file__Rtnptscipyt.i����N(
RtostpathtdirnametfilenameRTtnumpyR+tsplitt
__import__(RRCtpkg_nameRStp2((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pytset_test_context�s



c	cs�|j|j�s)tjjd|�dSy|jj|�}Wntk
rSdSX|s^dS|j�t	|j
�}xk|D]c}|js�q~n|js�||_n|j
|�|j|d|jd|j�d|j�Vq~WdS(NsDoctest doesn't want module %sR7R>RD(tmatchesRtnpdtlogtdebugRNtfindtAttributeErrortsortRRVtexamplesR]Rctdoctest_case_classtdoctest_optflagstout_check_classRI(RRR'tmodule_fileRC((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pytloadTestsFromModule�s*


		
	cCstjt�dS(N(R^tset_printoptionstprint_state(R((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pytafterContextscCs8tjj|�}||jkr%tStjj||�S(N(RZR[tbasenametdoctest_ignoretFalseRetDoctesttwantFile(Rtfiletbn((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyRxs(RRR)tscoreRtNORMALIZE_WHITESPACEtELLIPSISRmRuR:RlR0RnRRMRZtenvironRGRLRcRpRsRx(((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyRE�s 			
	*		t	UnpluggercBs>eZdZdZeZdZdd�Zd�Zd�Z	RS(si Nose plugin to remove named plugin late in loading

    By default it removes the "doctest" plugin.
    t	unpluggeri�RcCs
||_dS(N(t	to_unplug(RR�((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyRB"scCsdS(N((RRJRK((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyRG%scCs;g|jjD]}|j|jkr
|^q
|j_dS(N(RQR)R�(RRGRRRS((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyRL(s(
RRt__doc__R)R	RPR{RBRGRL(((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyRs	tKnownFailureTestcBseZdZRS(s<Raise this exception to mark a test as a known failing test.(RRR�(((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyR�.stKnownFailurecBsDeZdZeZeeddde�Ze	j
d�Zd�ZRS(s5Plugin that installs a KNOWNFAIL error class for the
    KnownFailureClass exception.  When KnownFailureTest 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
Cs;d}|jdddddd|j|t�dd	�dS(
NtNOSE_WITHOUT_KNOWNFAILs--no-knownfailtactiont
store_truetdesttnoKnownFailtdefaultthelps7Disable special handling of KnownFailureTest exceptions(t
add_optiontgetRv(RRJRKtenv_opt((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyRG>scCs>|js
dS||_t|dt�}|r:t|_ndS(NR�(t
can_configuretconfR$RvRP(RRGR�tdisable((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyRLEs		(
RRR�R	RPRR�Rvt	knownfailRZR~RGRL(((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyR�3s		tNumpyTestProgramcBseZd�ZRS(cCs�|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	verbosityRRN(t
testRunnerRtnosetcoretTextTestRunnerRRR�R�RQtprepareTestRunnertrunRCtresultt
wasSuccessfultsuccess(Rtplug_runner((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pytrunTestsQs(RRR�(((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyR�Ps(#RZRR�tnose.pluginsRRetnose.plugins.errorclassRRtnose.plugins.baseRt	nose.utilRR^t
nosetesterRR
RRR2R0RAR:tget_printoptionsRrRwRERRt	ExceptionR�R�R�tTestProgramR�(((s?/usr/lib64/python2.7/site-packages/numpy/testing/noseclasses.pyt<module>s$[z