Your IP : 216.73.216.196


Current Path : /opt/alt/python27/lib/python2.7/site-packages/_pytest/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyo

�
�mYc@`shdZddlmZmZmZddlZddlZddlmZddlZddl	m
Z
mZd�Zd�Z
d�Zd	�Zd
d5d��YZd�Zedd
�Zd�Zd�Zd�Zd�Zd�Zed�Zd�Zd�Zdd6d��YZd�Zdefd��YZ d�Z!de fd��YZ"de fd��YZ#d �Z$d!e fd"��YZ%d#e
fd$��YZ&d%efd&��YZ'd'�Z(d(e)fd)��YZ*d*e*fd+��YZ+d,e*fd-��YZ,d.e-fd/��YZ.d0�Z/e.e/_)d1d2�Z0e+e0_)d1ed3�Z1e,e1_)dd4�Z2dS(7s4 basic collect and runtest protocol implementations i(tabsolute_importtdivisiontprint_functionN(ttime(tTerminalReprt
ExceptionInfocC`sJ|jdddd�}|jddddtd	dd
ddd
�fdS(Nsterminal reportingt	reportingtaftertgenerals--durationstactiontstorettypetdefaulttmetavartNthelps2show N slowest setup/test durations (N=0 for all).(tgetgroupt	addoptiontinttNone(tparsertgroup((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytpytest_addoptionscC`s|jjj}|dkrdS|}g}xG|jj�D]6}x-|D]%}t|d�rH|j|�qHqHWq;W|sdS|jdd��|j	�|s�|j
dd�n|j
dd|�|| }xC|D];}|jjdd�}|j
d	|j|j|f�q�WdS(
NtdurationtkeycS`s|jS(N(R(tx((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyt<lambda>"tt=sslowest test durationssslowest %s test durationss::()::s::s%02.2fs %-8s %s(tconfigtoptiont	durationsRtstatstvaluesthasattrtappendtsorttreverset	write_septnodeidtreplacet
write_lineRtwhen(tterminalreporterRttrtdlisttreplisttrepR'((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytpytest_terminal_summarys*



	cC`st�|_dS(N(t
SetupStatet_setupstate(tsession((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytpytest_sessionstart/scC`s|jj�dS(N(R2tteardown_all(R3((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytpytest_sessionfinish1stNodeInfocB`seZd�ZRS(cC`s
||_dS(N(tlocation(tselfR8((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyt__init__5s(t__name__t
__module__R:(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR74scC`s3|jjd|jd|j�t|d|�tS(NR'R8tnextitem(tihooktpytest_runtest_logstartR'R8truntestprotocoltTrue(titemR=((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytpytest_runtest_protocol8scC`s�t|d�}|r,|jr,|j�nt|d|�}|g}|jr�|jjjrlt|�n|jjj	s�|j
t|d|��q�n|j
t|d|d|��|r�t|_d|_
n|S(Nt_requesttsetuptcalltteardownR=(R"RDt_initrequesttcall_and_reporttpassedRRt	setupshowtshow_test_itemt	setuponlyR#tFalseRtfuncargs(RBtlogR=t
hasrequestR/treports((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR@?s 
		

	cC`sz|jj�}|j�|jd�|j|j�t|jjj��}|rv|jdj	dj
|���ndS(sAShow test function, parameters and the fixtures of the test item.t is (fixtures used: {0})s, Ns        (Rtget_terminal_writertlinetwritet_nodeidtsortedt_fixtureinfotname2fixturedefstkeystformattjoin(RBttwt
used_fixtures((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyRLSs

cC`s|jjj|�dS(N(R3R2tprepare(RB((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytpytest_runtest_setup]scC`sey|j�WnPtk
r`tj�\}}}|j}|t_|t_|t_~�nXdS(N(truntestt	Exceptiontsystexc_infottb_nextt	last_typet
last_valuetlast_traceback(RBRtvaluettb((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytpytest_runtest_call`s
				cC`s|jjj||�dS(N(R3R2tteardown_exact(RBR=((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytpytest_runtest_teardownmscC`s4|jd
kr0|jrdS|jr)dSd
SndS(NRERGterrortEtERRORtskippedtstSKIPPEDR(RERG(RoRpRq(RrRsRt(RRR(R*tfailedRr(treport((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytpytest_report_teststatusps		cK`s~t|||�}|j}|jd|d|�}|rL|jd|�nt||�rz|jd|d|d|�n|S(NRBRFRvtnode(tcall_runtest_hookR>tpytest_runtest_makereporttpytest_runtest_logreporttcheck_interactive_exceptiontpytest_exception_interact(RBR*RPtkwdsRFthookRv((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyRI~s	cC`sA|jo@t|d�p?|jjtj�p?|jjtj�S(Ntwasxfail(texcinfoR"t
errisinstancetskipRctbdbtBdbQuit(RFRv((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR|�s	c`s;d|}t�j|��t���fd�d|�S(Ntpytest_runtest_c`s�d���S(NRB(((R>RBR~(s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR�RR*(tgetattrR>tCallInfo(RBR*R~thookname((R>RBR~s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyRy�s
R�cB`s&eZdZdZd�Zd�ZRS(s. Result/Exception info a function invocation. cC`sj||_t�|_y|�|_Wn2tk
rGt�|_�nt�|_nXt�|_dS(N(R*RtstarttresulttKeyboardInterrupttstopRR�(R9tfuncR*((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR:�s	
cC`sC|jr"dt|jj�}nd|jf}d|j|fS(Ns
exception: %ss
result: %rs<CallInfo when=%r %s>(R�tstrRjR�R*(R9tstatus((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyt__repr__�s	N(R;R<t__doc__RR�R:R�(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR��s	cC`shy|jSWnVtk
rc|j}d|dd }d|d|d||df|_}|SXdS(Ns%s.%s.%stversion_infois[%s] %s -- Python %s %stidtsysplatformt
executable(t_slaveinfocachetAttributeErrort	slaveinfo(RxtdtverRs((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytgetslaveinfoline�s
	&t
BaseReportcB`s�eZd�Zd�Zd�Zed��Zed��Zed��Zed��Z	ed��Z
ed��Zed	��ZRS(
cK`s|jj|�dS(N(t__dict__tupdate(R9tkw((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR:�scC`s�t|d�r(|jt|j��n|j}|dkrAdSt|d�r`|j|�n2y|j|�Wntk
r�|jd�nXdS(NRxt
toterminals<unprintable longrepr>(R"RUR�RxtlongreprRR�tUnicodeEncodeError(R9toutR�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR��s	
cc`s;x4|jD])\}}|j|�r
||fVq
q
WdS(N(tsectionst
startswith(R9tprefixtnametcontent((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytget_sections�scC`sDtjjdt�}t|_|j|�|jj�}|j	�S(s�
        Read-only property that returns the full string representation
        of ``longrepr``.

        .. versionadded:: 3.0
        tstringio(
tpytiotTerminalWriterRARNt	hasmarkupR�R�tgetvaluetstrip(R9R^texc((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytlongreprtext�s
	
cC`s djd�|jd�D��S(saReturn captured text from stdout, if capturing is enabled

        .. versionadded:: 3.0
        Rcs`s|]\}}|VqdS(N((t.0R�R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pys	<genexpr>�ssCaptured stdout(R]R�(R9((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyt	capstdout�scC`s djd�|jd�D��S(saReturn captured text from stderr, if capturing is enabled

        .. versionadded:: 3.0
        Rcs`s|]\}}|VqdS(N((R�R�R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pys	<genexpr>�ssCaptured stderr(R]R�(R9((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyt	capstderr�scC`s
|jdkS(NRJ(toutcome(R((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR�RcC`s
|jdkS(NRu(R�(R((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR�RcC`s
|jdkS(NRr(R�(R((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR�RcC`s|jjd�dS(Ns::i(R'tsplit(R9((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytfspath�s(
R;R<R:R�R�tpropertyR�R�R�RJRuRrR�(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR��s			c	C`so|j}|j|j}tg|jD]}|df^q&�}|j}g}|jshd}d}	n�t|t�s�d}|}	n�|j	t
j�r�d}|j�}
t
|
j�|
j|
jf}	nEd}|jdkr�|j|�}	n|j|d|jjj�}	x7|jD],\}}}
|jd||f|
f�qWt|j|j|||	|||�S(NiRJRuRrRFtstylesCaptured %s %s(R*R�R�tdicttkeywordsR�Rt
isinstanceRR�R�Rct
_getreprcrashR�tpathtlinenotmessagetrepr_failuret_repr_failure_pyRRttbstylet_report_sectionsR#t
TestReportR'R8(RBRFR*RRR�R�R�R�R�trtrwhenRR�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyRz�s2	(				!!R�cB`s&eZdZddd�Zd�ZRS(sY Basic test report object (also used for setup and teardown calls if
    they fail).
    ic	
K`sb||_||_||_||_||_||_t|�|_||_|j	j
|	�dS(N(R'R8R�R�R�R*tlistR�RR�R�(
R9R'R8R�R�R�R*R�Rtextra((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR:s							cC`sd|j|j|jfS(Ns"<TestReport %r when=%r outcome=%r>(R'R*R�(R9((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR�:s((R;R<R�R:R�(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR�s!tTeardownErrorReportcB`seZdZdZd�ZRS(RuRGcK`s&||_g|_|jj|�dS(N(R�R�R�R�(R9R�R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR:As		(R;R<R�R*R:(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR�>sc	`st�fd�d�}d}|js0d}n�ddlm}tf|j�}|jj|�r�d}�j|jd�j	}t
|j�|j|j
f}n<d}�j|j�}t|d	�s�t|�}n|}t�j||t|d
d��}||_|S(Nc`st�j��S(N(R�tcollect((t	collector(s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyRHRR�RJi(tnoseRrRURuR�R�(R�RR�t_pytestR�tSkippedtget_skip_exceptionsR�R�t	reprcrashR�R�R�R�R�R"tCollectErrorReprt
CollectReportR'R�RF(	R�RFR�R�R�tskip_exceptionsR�t	errorinfoR/((R�s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytpytest_make_collect_reportFs*			!	R�cB`s,eZdd�Zed��Zd�ZRS(cK`sM||_||_||_|p$g|_t|�|_|jj|�dS(N(R'R�R�R�R�R�R�R�(R9R'R�R�R�R�R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR:as			cC`s|jd|jfS(N(R�R(R9((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR8jscC`s d|jt|j�|jfS(Ns*<CollectReport %r lenresult=%s outcome=%r>(R'tlenR�R�(R9((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR�ns((R;R<R:R�R8R�(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR�`sR�cB`seZd�Zd�ZRS(cC`s
||_dS(N(R�(R9tmsg((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR:sscC`s|j|jdt�dS(Ntred(RUR�RA(R9R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR�us(R;R<R:R�(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR�rs	R1cB`s_eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�ZRS(
sD shared state for setting up/tearing down test items or collectors. cC`sg|_i|_dS(N(tstackt_finalizers(R9((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR:zs	cC`s |jj|g�j|�dS(s� attach a finalizer to the given colitem.
        if colitem is None, this will add a finalizer that
        is called at the end of teardown_all().
        N(R�t
setdefaultR#(R9t	finalizertcolitem((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytaddfinalizer~scC`s |jj�}|j|�dS(N(R�tpopt_teardown_with_finalization(R9R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyt_pop_and_teardown�scC`s�|jj|d�}d}xP|rm|j�}y|�Wqtk
ri|dkrjtj�}qjqXqW|r�tjj|�ndS(N(	R�R�RRcRdReR�tbuiltint_reraise(R9R�t
finalizersR�tfin((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyt_callfinalizers�s	
cC`sA|j|�t|d�r)|j�nx|jD]}q3WdS(NRG(R�R"RGR�(R9R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR��s


cC`sEx|jr|j�qWx$t|j�D]}|j|�q*WdS(N(R�R�R�R�R�(R9R((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR5�s
cC`s)|r|j�pg}|j|�dS(N(t	listchaint_teardown_towards(R9RBR=tneeded_collectors((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyRm�scC`s>x7|jr9|j|t|j� kr,Pn|j�qWdS(N(R�R�R�(R9R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR��scC`s�|j�}|j|�x6|jD]+}t|d�r#tjj|j�q#q#Wx_|t|j�D]J}|jj	|�y|j
�Wqftk
r�tj
�|_�qfXqfWdS(sn setup objects along the collector chain to the test-method
            and teardown previously setup objects.t_prepare_excN(R�R�R�R"R�R�R�R�R�R#RERcRdRe(R9R�R�tcol((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR`�s

(R;R<R�R:R�R�R�R�R5RmR�R`(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR1xs		
						cC`sx|j}|jd|�|jd|�}|jjdd�}|rtt||�rt|jd|d|d|�n|S(NR�RFRxRv(R>tpytest_collectstartR�R�R�RR|R}(R�R>R/RF((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytcollect_one_node�s	tOutcomeExceptioncB`s,eZdZded�Zd�ZeZRS(sw OutcomeException and its subclass instances indicate and
        contain info about test and collection outcomes.
    cC`s&tj||�||_||_dS(N(RcR:R�tpytrace(R9R�R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR:�s	cC`sQ|jr@|j}t|t�r<tjj|dd�}n|Sd|jjfS(NterrorsR(s
<%s instance>(R�R�tbytesR�t_builtint_totextt	__class__R;(R9tval((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR��s		N(R;R<R�RRAR:R�t__str__(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR��s	R�cB`s eZdZdeed�ZRS(tbuiltinscC`s&tj|d|d|�||_dS(NR�R�(R�R:tallow_module_level(R9R�R�R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR:�sN(R;R<RRARNR:(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR��stFailedcB`seZdZdZRS(s/ raised from an explicit call to pytest.fail() R�(R;R<R�(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR��stExitcB`seZdZdd�ZRS(s= raised for immediate program exits (no tracebacks/summaries)sunknown reasoncC`s||_tj||�dS(N(R�R�R:(R9R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR:�s	(R;R<R�R:(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR��scC`st}t|��dS(s= exit testing process as if KeyboardInterrupt was triggered. N(RAR�(R�t__tracebackhide__((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytexit�sRcC`st}td|��dS(s skip an executing test with the given message.  Note: it's usually
    better to use the pytest.mark.skipif marker to declare a test to be
    skipped under certain conditions like mismatching platforms or
    dependencies.  See the pytest_skipping plugin for details.
    R�N(RAR�(R�R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyR�scC`st}td|d|��dS(s� explicitly fail an currently-executing test with the given Message.

    :arg pytrace: if false the msg represents the full failure information
                  and no python traceback will be reported.
    R�R�N(RAR�(R�R�R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytfailsc	C`s[ddl}t}t|dd�t}|j��:|jd�yt|�Wntk
rit}nXWdQX|r�td|fdt��nt	j
|}|dkr�|St|dd�}|dk	rWydd	l
m}Wn*tk
r
td
|fdt��nX|dks2||�||�krWtd|||fdt��qWn|S(s� return imported module if it has at least "minversion" as its
    __version__ attribute.  If no minversion is specified the a skip
    is only triggered if the module can not be imported.
    iNRtevaltignorescould not import %rR�t__version__(t
parse_versions\we have a required version for %r but can not import pkg_resources to parse version strings.s-module %r has __version__ %r, required is: %r(twarningsRAtcompileRNtcatch_warningstsimplefiltert
__import__tImportErrorR�RdtmodulesRR�t
pkg_resourcesR(tmodnamet
minversionRR�tshould_skiptmodtverattrtpv((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pytimportorskip s6






$(((3R�t
__future__RRRR�RdRR�t_pytest._code.codeRRRR0R4R6R7RCRARR@RLRaRlRnRwRIR|RyR�R�tobjectR�RzR�R�R�R�R�R1R�RcR�R�R�R�R�R�R�RR(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/runner.pyt<module>sV						
		
		
			
@	*	N