GhostManSec
Server: Apache
System: Linux s323.xrea.com 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64
User: moonarc (17751)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //usr/lib/python2.7/site-packages/_pytest/doctest.pyc
�
��abc@`s�dZddlmZmZmZddlZddlZddlZddlZddl	m
Z
mZmZddl
mZdZdZdZd	Zd
ZeeeeefZd�Zd�Zd
�Zd�Zdefd��YZdejfd��YZd�Zd�Zdejfd��YZd�Z dejfd��YZ!d�Z"d�Z#d�Z$d�Z%d�Z&d�Z'ej(d d!�d"��Z)dS(#s5 discover and run doctests in modules and test files.i(tabsolute_importtdivisiontprint_functionN(t
ExceptionInfotReprFileLocationtTerminalRepr(tFixtureRequesttnonetcdifftndifftudifftonly_first_failurecC`s�|jddddddg�|jdddd	�|jd
�}|jddd
dtdddd�|jddtjdddddtdd�|jddddgdddddd�|jddd
dtdddd�dS( Ntdoctest_optionflagssoption flags for docteststtypetargstdefaulttELLIPSIStdoctest_encodingsencoding used for doctest filessutf-8tcollects--doctest-modulestactiont
store_truethelpsrun doctests in all .py modulestdesttdoctestmoduless--doctest-reportR
s9choose another output format for diffs on doctest failuretchoicest
doctestreports--doctest-globtappendtmetavartpats2doctests file matching pattern, default: test*.txttdoctestglobs--doctest-ignore-import-errorssignore doctest ImportErrorstdoctest_ignore_import_errors(taddinitgetgroupt	addoptiontFalsetstrtlowertDOCTEST_REPORT_CHOICES(tparsertgroup((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pytpytest_addoptions*cC`sj|j}|jdkrG|jjrft|||�rft||�Snt|||�rft||�SdS(Ns.py(tconfigtexttoptionRt_is_setup_pyt
DoctestModulet_is_doctesttDoctestTextfile(tpathtparentR)((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pytpytest_collect_file4s	cC`s5|jdkrtS|j�}d|kp4d|kS(Nssetup.pyt
setuptoolst	distutils(tbasenameR"tread(R)R0R1tcontents((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyR,=scC`sh|jdkr%|jj|�r%tS|jd�p:dg}x$|D]}|jd|�rDtSqDWtS(Ns.txts.rstRs	test*.txttfnmatch(s.txts.rst(R*tsessiont
isinitpathtTruet	getoptiontcheckR"(R)R0R1tglobstglob((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyR.Ds!
tReprFailDoctestcB`seZd�Zd�ZRS(cC`s||_||_dS(N(treprlocationtlines(tselfRARB((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyt__init__Ps	cC`s5x|jD]}|j|�q
W|jj|�dS(N(RBtlineRAt
toterminal(RCttwRE((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyRFTs(t__name__t
__module__RDRF(((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyR@Ns	tDoctestItemcB`sDeZddd�Zd�Zd�Zd�Zd�Zd�ZRS(cC`sAtt|�j||�||_||_d|_d|_dS(N(tsuperRJRDtrunnertdtesttNonetobjtfixture_request(RCtnameR1RLRM((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyRD[s
			cC`s�|jdk	r|t|�|_td|jj�}x0|jjd�j�D]\}}|||<qLW|jjj|�ndS(Nt
getfixturetdoctest_namespace(	RMRNt_setup_fixturesRPtdicttgetfixturevaluetitemsR>tupdate(RCR>RQtvalue((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pytsetupbs%cC`s.t|j�|j�|jj|j�dS(N(t_check_all_skippedRMt$_disable_output_capturing_for_darwinRLtrun(RC((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pytruntestjs

cC`sptj�dkrdS|jjjd�}|rl|jdt�\}}tjj	|�tj
j	|�ndS(sW
        Disable output capturing. Otherwise, stdout is lost to doctest (#985)
        tDarwinNtcapturemanagertin_(tplatformtsystemR)t
pluginmanagert	getplugintsuspend_global_captureR;tsyststdouttwritetstderr(RCtcapmantoutterr((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyR\oscC`s$ddl}|j|j|jf�r
|j}|j}|j}|j}|jdkrcd}n|j|jd}|j
j}t|||�}	t
�}
t|jjd��}|dk	r8|jjjt�}gt|�D]'\}
}d|
|jd|f^q�}|t|jdd�|jd!}nFdg}d}x4|jj�D]#}|jd||f�d	}qWW|j|j�r�||
j||j|�jd
�7}nEt|jj�}|dt|j�g7}|tj|jj�7}t |	|�St!t"|�j#|�SdS(NiiRs%03d %si	s?EXAMPLE LOCATION UNKNOWN, not showing all tests of that examples>>>s	??? %s %ss...s
sUNEXPECTED EXCEPTION: %s($tdoctestt
errisinstancetDocTestFailuretUnexpectedExceptionRYtexamplettesttfilenametlinenoRNR
RHRt_get_checkert_get_report_choiceR)R<t	docstringt
splitlinesR"t	enumeratetmaxtsourceRtoutput_differencetgottsplitRtexc_infotreprt	tracebacktformat_exceptionR@RKRJtrepr_failure(RCtexcinfoRntdoctestfailureRrRsRtRutmessageRAtcheckert
report_choiceRBtitxtindentREt
inner_excinfo((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyR�{sB						7'	

cC`s|j|jjd|jfS(Ns[doctest] %s(tfspathRMRuRQ(RC((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyt
reportinfo�sN(	RHRIRNRDRZR^R\R�R�(((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyRJZs				)cC`s[ddl}td|jd|jd|jd|jd|jd|jdt�d	t	��S(
NitDONT_ACCEPT_TRUE_FOR_1tDONT_ACCEPT_BLANKLINEtNORMALIZE_WHITESPACERtIGNORE_EXCEPTION_DETAILtCOMPARISON_FLAGSt
ALLOW_UNICODEtALLOW_BYTES(
RnRUR�R�R�RR�R�t_get_allow_unicode_flagt_get_allow_bytes_flag(Rn((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyt_get_flag_lookup�s						cC`sD|jjd�}t�}d}x|D]}|||O}q(W|S(NRi(R)tgetiniR�(R1toptionflags_strtflag_lookup_tabletflag_acctflag((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pytget_optionflags�s	
R/cB`seZdZd�ZRS(cc`s�ddl}|jjd�}|jj|�}t|j�}|jj}idd6}t|�}|jddd|dt	��}t
||�|j�}	|	j||||d�}
|
j
r�t|
j|||
�VndS(NiRt__main__RHtverbosetoptionflagsR�(RnR)R�R�t	read_textR#R5R�tDebugRunnerRvt_fix_spoof_python2t
DocTestParsertget_doctesttexamplesRJRQ(RCRntencodingttextRtRQR>R�RLR&Rs((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyR�s

	N(RHRIRNROR(((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyR/�sc`sEddl�t�fd�|jD��}|rAtjd�ndS(s\raises pytest.skip() if all examples in the given DocTest have the SKIP
    option set.
    iNc3`s'|]}|jj�jt�VqdS(N(toptionstgettSKIPR"(t.0R�(Rn(s3/usr/lib/python2.7/site-packages/_pytest/doctest.pys	<genexpr>�ss!all tests skipped by +SKIP option(RntallR�tpytesttskip(Rstall_skipped((Rns3/usr/lib/python2.7/site-packages/_pytest/doctest.pyR[�sR-cB`seZd�ZRS(cc`sddl}|jjdkr9|jjj|j�}nSy|jj�}Wn=tk
r�|jjd�r�t	j
d|j�q��nX|j�}t|�}|j
ddd|dt��}x@|j||j�D])}|jr�t|j|||�Vq�q�WdS(Nisconftest.pyRsunable to import module %rR�R�R�(RnR�R5R)Rdt_importconftesttpyimporttImportErrortgetvalueR�R�t
DocTestFinderR�R�RvtfindRHR�RJRQ(RCRntmoduletfinderR�RLRs((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyR�s 
	(RHRIR(((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyR-�sc	C`s_d�}i|_|jj}|jd|d|dddt�|_t|�}|j�|S(sO
    Used by DoctestTextfile and DoctestItem to setup fixture information.
    cS`sdS(N((((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pytfunc�stnodeR�tclstfuncargsN(	R�R9t_fixturemanagertgetfixtureinfoRNR"t_fixtureinfoRt
_fillfixtures(tdoctest_itemR�tfmRP((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyRT�s		
c`sfttd�rtj�Sddl�ddl�d�jf��fd��Y}|t_tj�S(sJ
    Returns a doctest.OutputChecker subclass that takes in account the
    ALLOW_UNICODE option to ignore u'' prefixes in strings and ALLOW_BYTES
    to strip b'' prefixes.
    Useful when the same doctest should run in Python 2 and Python 3.

    An inner class is used to avoid importing "doctest" at the module
    level.
    tLiteralsOutputCheckeriNc`sJeZdZ�jd�j�Z�jd�j�Z��fd�ZRS(s�
        Copied from doctest_nose_plugin.py from the nltk project:
            https://github.com/nltk/nltk

        Further extended to also support byte literals.
        s(\W|^)[uU]([rR]?[\'\"])s(\W|^)[bB]([rR]?[\'\"])c`s��jj||||�}|r%tS|t�@}|t�@}|rQ|rQtS�fd�}|r�||j|�}||j|�}n|r�||j|�}||j|�}n�jj||||�}|SdS(Nc`s�j|d|�S(Ns\1\2(tsub(tregexttxt(tre(s3/usr/lib/python2.7/site-packages/_pytest/doctest.pytremove_prefixes0s(t
OutputCheckertcheck_outputR;R�R�R"t_unicode_literal_ret_bytes_literal_re(RCtwantR~R�trest
allow_unicodetallow_bytesR�(RnR�(s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyR�$s$	

	(RHRIt__doc__tcompiletUNICODER�R�R�((RnR�(s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyR�s(thasattrRvR�RnR�R�(R�((RnR�s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyRv	s

"$	cC`sddl}|jd�S(s7
    Registers and returns the ALLOW_UNICODE flag.
    iNR�(Rntregister_optionflag(Rn((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyR�AscC`sddl}|jd�S(s5
    Registers and returns the ALLOW_BYTES flag.
    iNR�(RnR�(Rn((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyR�IscC`sCddl}i|jt6|jt6|jt6|jt6dt	6|S(s�
    This function returns the actual `doctest` module flag value, we want to do it as late as possible to avoid
    importing `doctest` and all its dependencies when parsing options, as it adds overhead and breaks tests.
    iN(
RntREPORT_UDIFFtDOCTEST_REPORT_CHOICE_UDIFFtREPORT_CDIFFtDOCTEST_REPORT_CHOICE_CDIFFtREPORT_NDIFFtDOCTEST_REPORT_CHOICE_NDIFFtREPORT_ONLY_FIRST_FAILUREt(DOCTEST_REPORT_CHOICE_ONLY_FIRST_FAILUREtDOCTEST_REPORT_CHOICE_NONE(tkeyRn((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyRwQs



c`sYddlm}|sdSddlm�d�f��fd��Y}|�|_dS(s�
    Installs a "SpoofOut" into the given DebugRunner so it properly deals with unicode output. This
    should patch only doctests for text files because they don't have a way to declare their
    encoding. Doctests in docstrings from Python modules don't have the same problem given that
    Python already decoded the strings.

    This fixes the problem related in issue #2434.
    i(t_PY2N(t	_SpoofOuttUnicodeSpoofc`seZ��fd�ZRS(c`s+�j|�}�r'|j��}n|S(N(R�tdecode(RCtresult(R�R�(s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyR�rs(RHRIR�((R�R�(s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyR�ps(t_pytest.compatR�RnR�t_fakeout(RLR�R�R�((R�R�s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyR�as	tscopeR9cC`st�S(s2
    Inject names into the doctest namespace.
    (RU(((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyRS{s(*R�t
__future__RRRR�RgRbR�t_pytest._code.codeRRRt_pytest.fixturesRR�R�R�R�R�R%R(R2R,R.R@tItemRJR�R�tModuleR/R[R-RTRvR�R�RwR�tfixtureRS(((s3/usr/lib/python2.7/site-packages/_pytest/doctest.pyt<module>sF						
N	
			
		8