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/fixtures.pyc
�
��abc@`s�ddlmZmZmZddlZddlZddlZddlZddlm	Z	m
Z
mZddlZddl
Z
ddlmZddlZddlmZddlmZddlmZmZmZmZmZmZmZmZmZmZmZm Z ddl!m"Z"m#Z#ej$d	e%�d
e&fd��Y�Z'd�Z(iZ)e*d
f�Z+ddfe+d<e+ddfe+d<e+ddfe+d<e+dddfe+d<e,e,d�Z-d�Z.d�Z/d�Z0d�Z1d�Z2d�Z3d�Z4d�Z5d�Z6de&fd ��YZ7d!e fd"��YZ8d#e8fd$��YZ9d%e:fd&��YZ;d'j<�Z=e=j>d�Z?d(�Z@e,d)�ZAd*eBfd+��YZCd,efd-��YZDd.�ZEd/�ZFd0e&fd1��YZGd2�ZHd3�ZIej$d	e%�d4e&fd5��Y�ZJde,eKe,e,d6�ZLde,eKe,e,d7�ZMeL�ZNeLd8d
�d9��ZOd:e&fd;��YZPdS(<i(tabsolute_importtdivisiontprint_functionN(tOrderedDicttdequetdefaultdict(tFormattedExcinfo(tnodes(tTerminalRepr(tNOTSETt	exc_cleart_format_argstgetfslinenot
get_real_functis_generatortisclasst	getimfunctgetlocationtgetfuncargnamestsafe_getattrtFuncargnamesCompatAttr(tfailtTEST_OUTCOMEtfrozentPseudoFixtureDefcB`s eZej�Zej�ZRS((t__name__t
__module__tattrtibt
cached_resulttscope(((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyRscC`slddl}ddl}tji|jjd6|jjd6|jjd6|j	j
d6�t|�|_dS(Nitclasstmoduletfunctiontsession(
t_pytest.pythont
_pytest.nodestscopename2classtupdatetpythontClasstModuleRtItemtmaintSessiontFixtureManagert_fixturemanager(R"t_pytest((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytpytest_sessionstart!s	


R"tfspathR tclsRtinstanceR!tkeywordsc`s�fd�}|S(Nc`s7�p�j���fd�}t|dd�j�S(Nc`s=�jt|jkr �|�Std�|jf��dS(Ns%%s not available in %s-scoped context(Rtscope2propsRtAttributeError(tself(tfunct	scopename(s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytprovide<s
(RtpropertytNonet__doc__(R8R:(tname(R8R9s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyt
decoratescope9s((R>tdocR?((R>s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyt
scopeproperty8s
cC`s7tj|�}|dkr*td��n|j|�S(Ns
unknown scope(R%tgetR<t
ValueErrort	getparent(tnodeRR2((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytget_scope_nodeFsc
C`s�|jdjsdSi}i}x�|jD]�}x�|jj�D]�\}}||jksat�||j|<|j|g�}t|�|j|<|j|�||kr@|j	j
|t�}	t|	||<q@q@W|jj
�q*W|j}
x�|j�D]�\}}||}d}
|dkrst||�}
|
dkrs|dkrat|tjj�sgt�|}
qsn|
r�||
jkr�|
j|g|
|<q�t|d|t|||tt�}|g|
|<|
dk	r�||
j|<q�q�WdS(NiR!Rt(t_callstfuncargstitemstparamstAssertionErrort
setdefaulttlentindicestappendt
_arg2scopenumRBtscopenum_functiontscopestcleart_arg2fixturedefsR<RFt
isinstanceR/R'R)t_name2pseudofixturedeft
FixtureDeftget_direct_param_fixture_functFalse(t	collectortmetafunctfixturemanagert
arg2paramst	arg2scopetcallspectargnametargvaluetarg2params_listtscopenumtarg2fixturedefst	valuelistRREt
fixturedef((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytadd_funcarg_pseudo_fixture_defMsD

		
'
cC`s-yt|dd�SWntk
r(dSXdS(sK return fixturemarker or None if it doesn't exist or raised
    exceptions.t_pytestfixturefunctionN(tgetattrR<R(tobj((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytgetfixturemarker�s
cc`s�|tkst�y
|j}Wntk
r2n�Xx�t|jj��D]�\}}|j||krnqIn|dkr�||f}nH|dkr�|||jf}n'|dkr�|||j|j	f}n|VqIWdS(sY return list of keys for all parametrized arguments which match
    the specified scope. iiiN(
RRRLR`R6tsortedRORJRQR1R2(titemRdtcsRatparam_indextkey((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytget_parametrized_fixture_keys�s

"c	C`s�i}i}x�tdt�D]�}i||<}tt�||<}x[|D]S}tjt||��}|rK|||<x"|D]}||j|�q�WqKqKWqWtj|�}tt	|||d��S(Ni(
trangeRRRRRtfromkeysRrRPtlisttreorder_items_atscope(	RJt
argkeys_cachetitems_by_argkeyRdtdtitem_dRntkeysRq((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyt
reorder_items�s


 cC`sTxMtdt�D]<}x3||j|g�D]}|||j|�q-WqWdS(Ni(RsRRRBt
appendleft(RnRwRxRdRq((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytfix_cache_order�sc`s�|tkst|�dkr"|St��t|�}t�}||}||}xH|r�t�}d}	x�|rP|j�}
|
|kso|
|kr�qontj�fd�|j|
g�D��}|s�d||
<qo|j	�\}	}g||	D]}
|
|kr�|
^q�}x1t
|�D]#}
t|
||�|j|
�q%WPqoW|r�t
||||d�}x|D]}
d||
<qwWn�j|	�qWW|S(Nic3`s!|]}|�kr|VqdS(N((t.0tk(tignore(s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pys	<genexpr>�si(RRRNtsetRRR<tpopleftRtRBtpopitemtreversedR~R}Rvtadd(RJRwRxRdtitems_dequet
items_donetscoped_items_by_argkeytscoped_argkeys_cachetno_argkey_grouptslicing_argkeyRntargkeyst_titmatching_items((R�s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyRv�s<		

			+
)
cC`s�y
|j}Wn�tk
r�|jj}|j|j|jd�}||_t	|�}|_|j
�i}x"|jD]}|j|||<qzW||_nX|j
�dS(s, fill missing funcargs for a test function. N(
t_requestR6R"R.tgetfixtureinfotparentRkR<t_fixtureinfotFixtureRequestt
_fillfixturestargnamesRI(R!trequesttfmtfitnewfuncargsR>((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytfillfixtures�s

	

cC`s|jS(N(tparam(R�((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyRY�stFuncFixtureInfocB`seZd�ZRS(cC`s||_||_||_dS(N(R�t
names_closuretname2fixturedefs(R7R�R�R�((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyt__init__�s		(RRR�(((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR��sR�cB`sUeZdZd�Zed��Zed��Zd�Zed��Ze	�d��Z
e	d�d��Zed	��Ze	�d
��Z
e	�d��Zed��Zed
��Zd�Zd�Zd�Zd�Zd�Zdddd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z RS(s� A request for a fixture from a test or fixture function.

    A request object gives access to the requesting test context
    and has an optional ``param`` attribute in case
    the fixture is parametrized indirectly.
    cC`s[||_d|_d|_i|_|j}|jj�|_i|_	|j
j|_dS(NR!(t_pyfuncitemR<tfixturenameRt
_fixture_defsR�R�tcopyRUt
_arg2indexR"R.(R7t
pyfuncitemtfixtureinfo((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR�s						cC`st|jjj�S(N(RuR�R�R�(R7((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytfixturenamesscC`s|j|j�S(s> underlying collection node (depends on current request scope)(t
_getscopeitemR(R7((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyREscC`s�|jj|d�}|dkrU|jjj}|jj||�}||j|<n|jj|d�d}|dks�|t	|�kr�t
||��n||j|<||S(Nii(RURBR<R�R�tnodeidR.tgetfixturedefsR�RNtFixtureLookupError(R7Ratfixturedefstparentidtindex((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyt_getnextfixturedef"s
cC`s
|jjS(s8 the pytest config object associated with this request. (R�tconfig(R7((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR�2scC`s
|jjS(s? test function object if the request has a per-function scope. (R�Rk(R7((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR!7sRcC`s)|jjtjj�}|r%|jSdS(s< class (can be None) where the test function was collected. N(R�RDR/R'R(Rk(R7tclscol((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR2<scC`sTy|jjSWn?tk
rOt|dd�}|dk	rPtjj|�SnXdS(s> instance (can be None) on which test function was collected. R!N(R�t	_testcaseR6RjR<tpytbuiltint
_getimself(R7R!((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR3Cs
cC`s|jjtjj�jS(s= python module object where the test function was collected. (R�RDR/R'R)Rk(R7((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR NscC`s
|jjS(sD the file system path of the test module which collected this test. (R�R1(R7((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR1SscC`s
|jjS(s6 keywords/markers dictionary for the underlying node. (RER4(R7((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR4XscC`s
|jjS(s pytest session object. (R�R"(R7((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR"]scC`s|j|d|j�dS(s� add finalizer/teardown function to be called after the
        last test within the requesting test context finished
        execution. RN(t
_addfinalizerR(R7t	finalizer((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytaddfinalizerbscC`s2|j|�}|jjjjd|d|�dS(NR�tcolitem(R�R�R"t_setupstateR�(R7R�RR�((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR�iscC`s;y||jj|j<Wntk
r6t|��nXdS(s. Apply a marker to a single test function invocation.
        This method is useful if you don't want to have a keyword/marker
        on all function invocations.

        :arg marker: a :py:class:`_pytest.mark.MarkDecorator` object
            created by a call to ``pytest.mark.NAME(...)``.
        N(RER4tmarknameR6RC(R7tmarker((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytapplymarkerns
cC`s|jjd||��dS(s4 raise a FixtureLookupError with the given message. N(R.R�R<(R7tmsg((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyt
raiseerror{scC`s[|j}t|d|j�}x6|D].}||jkr%|j|�|j|<q%q%WdS(NR�(R�RjR�RItgetfixturevalue(R7RnR�Ra((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR�s
	
R c`s�t|jd�s!i|j_n|j|j|�|f�|jj�y���Wnwtk
r�|j|j|j|�|�����<�dk	r�����fd�}|j	|d|�q�nX�S(sD (deprecated) Return a testing resource managed by ``setup`` &
        ``teardown`` calls.  ``scope`` and ``extrakey`` determine when the
        ``teardown`` function will be called so that subsequent calls to
        ``setup`` would recreate the resource.  With pytest-2.3 you often
        do not need ``cached_setup()`` as you can directly declare a scope
        on a fixture function and register a finalizer through
        ``request.addfinalizer()``.

        :arg teardown: function receiving a previously setup resource.
        :arg setup: a no-argument function creating a resource.
        :arg scope: a string value out of ``function``, ``class``, ``module``
            or ``session`` indicating the caching lifecycle of the resource.
        :arg extrakey: added to internal caching key of (funcargname, scope).
        t_setupcachec`s��=���dS(N(((tcachetcachekeytteardowntval(s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR��sRN(
thasattrR�R�R�R�tKeyErrort_check_scopeRR<R�(R7tsetupR�RtextrakeyR�((R�R�R�R�s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytcached_setup�s
	
cC`s|j|�jdS(s; Dynamically run a named fixture function.

        Declaring fixtures via function argument is recommended where possible.
        But if you can only decide whether to use another fixture at test
        setup time, you may use this function to retrieve it inside a fixture
        or test function body.
        i(t_get_active_fixturedefR(R7Ra((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR��scC`s6ddlm}tj|jtdd�|j|�S(s" Deprecated, use getfixturevalue. i(t
deprecatedt
stackleveli(R/R�twarningstwarntGETFUNCARGVALUEtDeprecationWarningR�(R7RaR�((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytgetfuncargvalue�scC`s�y|j|SWnltk
r}y|j|�}Wq~tk
ry|dkrs|dgdf}d}t||�S�q~XnX|j|�||j|<|S(NR�iR!(R�R�R�R�R<Rt_compute_fixture_value(R7RaRgRR((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR��s




cC`sY|}g}xFt|dd�}|dkr;|j�|S|j|�|j}qWdS(Nt_fixturedef(RjR<treverseRPt_parent_request(R7tcurrenttvaluesRg((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyt_get_fixturestack�s

cC`s�|j}|j}|j}y|jj|�}Wn�ttfk
rt}d}|jdk	rZt
j�d}t
j|d�}|j
}	|j}
tjj|	�}	|	j|jj�r�|	j|jj�}	ndj|jt|j|jj�|	|
�}t|�qZnGX|jjj|d�}|jjj|�}|dk	rZt|}nt|||||�}
|
j||j|�t�z|j d|
�Wd|j!j"j#t$j%|j&d|
�|
j'�XdS(sL
        Creates a SubRequest based on "self" and calls the execute method of the given fixturedef object. This will
        force the FixtureDef object to throw away any previous results and compute a new fixture value, which
        will be stored into the FixtureDef object itself.

        :param FixtureDef fixturedef:
        iis�The requested fixture has no parameter defined for the current test.

Requested fixture '{0}' defined in:
{1}

Requested here:
{2}:{3}R�N((RaR�RR`tgetparamR6RCR	RKR<tinspecttstacktgetframeinfotfilenametlinenoR�tpathtlocaltreltoR�trootdirtformatRR8RRORBRQRSt
SubRequestR�R
texecuteR"R�R�t	functoolstpartialtfinishRE(R7RgRatfuncitemRR�Rptframet	frameinfotsource_patht
source_linenoR�t
paramscopenumt
subrequest((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR��sB
						
!cC`s[|dkrdSt||�rW|j�}td|||dj|�fdt�ndS(NR�srScopeMismatch: You tried to access the %r scoped fixture %r with a %r scoped request object, involved factories
%ss
tpytrace(t
scopemismatcht_factorytracebackRtjoinRZ(R7Ratinvoking_scopetrequested_scopetlines((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR�scC`s�g}xs|j�D]e}|j}t|�\}}|jjjj|�}t|�}|jd|||j	|f�qW|S(Ns%s:%d:  def %s%s(
R�R8RR�R"R1tbestrelpathRRPR(R7R�RgtfactorytfsR�tptargs((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR� s		cC`sn|dkr|jSt|j|�}|dkrI|dkrI|j}n|sjtdj||j���|S(NR!Rs8Could not obtain a node for scope "{}" for function {!r}(R�RFR<RLR�(R7RRE((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR�+s!cC`sd|jS(Ns<FixtureRequest for %r>(RE(R7((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyt__repr__6sN(!RRR=R�R;R�RER�R�RAR!R2R3R R1R4R"R�R�R�R�R�R<R�R�R�R�R�R�R�R�R�R(((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR�s8					
		 	
					>			R�cB`s)eZdZd�Zd�Zd�ZRS(sP a sub request for handling getting a fixture from a
    test function/fixture. cC`s�||_|j|_|tk	r-||_n||_||_||_|j|_|j	|_	|j
|_
|j|_|j|_dS(N(
R�RaR�R	R�RpRR�R�R�RUR�R.(R7R�RR�RpRg((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR�>s				cC`sd|j|jfS(Ns<SubRequest %r for %r>(R�R�(R7((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyRLscC`s|jj|�dS(N(R�R�(R7R�((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR�Os(RRR=R�RR�(((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR�:s		tScopeMismatchErrorcB`seZdZRS(s� A fixture function tries to use a different fixture function which
    which has a lower scope (e.g. a Session one calls a function one)
    (RRR=(((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyRSsssession module class functioncC`stj|�tj|�kS(N(RSR�(tcurrentscopetnewscope((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR�]scC`sYytj|�SWnAtk
rTtdj||rBdj|�nd|���nXdS(s[Look up the index of ``scope`` and raise a descriptive value error
    if not defined.
    s+{0} {1}has an unsupported scope value '{2}'s	from {0} RGN(RSR�RCR�(Rtdescrtwhere((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytscope2indexas
R�cB`s#eZdZdd�Zd�ZRS(s< could not return a requested Fixture (missing or invalid). cC`s.||_||_|j�|_||_dS(N(RaR�R�tfixturestackR�(R7RaR�R�((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR�rs		cC`s$g}|j}|jjjg}|jtd�|j��|j}|dk	r_|d }nx�|D]�}t	|�\}}yt
jt|��\}}	Wn8t
ttfk
r�d}
||
||df�qfX|d||df�xMt|�D]?\}}|j�}|d|�|j�jd�r�Pq�q�WqfW|dkr|jj}
g}|jjjj}xW|
jj�D]F\}}t|
j||��}|r�||kr�|j|�q�q�Wd|jf}|d	d
jt|��f7}|d7}nt|||||j�S(NcS`s|jS(N(R8(tx((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyt<lambda>|RGi����s+file %s, line %s: source code not availableisfile %s, line %ss  tdefsfixture %r not founds
 available fixtures: %ss, s6
 use 'pytest --fixtures [testpath]' for help on them.(RPR�R�RktextendtmapRR�R<RR�tgetsourcelinesR
tIOErrort
IndexErrort	TypeErrort	enumeratetrstriptlstript
startswithR.R�R�RURJRut_matchfactoriesRaR�RmtFixtureLookupErrorRepr(R7ttblinestaddlineR�R�R!R1R�R�R�t	error_msgR�tlineR�t	availableR�R>R�tfaclist((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyt
formatreprxs@		

 
N(RRR=R<R�R(((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR�osRcB`seZd�Zd�ZRS(cC`s1||_||_||_||_||_dS(N(RterrorstringR�tfirstlinenoRa(R7R�RRRRa((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR��s
				cC`s�x$|jD]}|j|j��q
W|jjd�}|r�|jdjtj|dj��dt	�x=|dD].}|jdjtj
|j��dt	�qvWn|j�|jd|j|jdf�dS(Ns
s
{0}       {1}itredis%s:%d(
RRRRtsplitR�Rtfail_markertstriptTruetflow_markerR�R(R7ttwttblineR�R((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyt
toterminal�s
(RRR�R((((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR�s	cC`sht|�\}}d||df}tjj|�}t|dt|j��d|dt�dS(Ns%s:%sis:

s
R�(RR/t_codetSourceRtstrtindentRZ(tfixturefuncR�R�R�tlocationtsource((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytfail_fixturefunc�s
%c`s\t��}|rL�|��t��}��fd�}|j|�n�|�}|S(Nc`s3yt��Wntk
r!nXt�d�dS(Ns0yield_fixture function has more than one 'yield'(tnextt
StopIterationR0((R-tit(s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR��s
(RR1R�(R-R�tkwargstyieldctxtresR�((R-R3s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytcall_fixture_func�s	RXcB`sAeZdZedd�Zd�Zd�Zd�Zd�Z	RS(s' A container for a factory definition. c		C`s�||_|pd|_|dk	|_||_||_||_t|pNdddj|j	�d|�|_
||_t|d|�|_
||_||_g|_dS(NRGR!Rsfixture {0}Rt	is_method(R.tbaseidR<thas_locationR8RaRRR�RRdRKRR�tunittesttidst_finalizers(	R7R]R9RaR8RRKR;R<((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR��s							cC`s|jj|�dS(N(R=RP(R7R�((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR��scC`s�g}zqxD|jrOy|jj�}|�Wq|jtj��qXqW|rv|d}~tjj|�nWd|jj	j
|jj�}|j
d|d|�t|d�r�|`ng|_XdS(NiRgR�R(R=tpopRPtsystexc_infoR�R�t_reraiseR.R"tgethookproxyRER1tpytest_fixture_post_finalizerR�R(R7R�t
exceptionsR8tethook((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR��s"
	c
C`sxN|jD]C}|j|�}|dkr
|jtj|jd|��q
q
W|j}t|dd�}|dk	r�|\}}}||kr�|dk	r�t	j
j|�q�|Sn|j|�t|d�s�t
�n|jjj|jj�}	|	jd|d|�S(NR�RRg(R�R�R�R�R�R�RpRjR<R�R�RAR�RLR.R"RBRER1tpytest_fixture_setup(
R7R�RaRgtmy_cache_keyRtresultt	cache_keyterrRF((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR�s &	
cC`sd|j|j|jfS(Ns(<FixtureDef name=%r scope=%r baseid=%r >(RaRR9(R7((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyRsN(
RRR=RZR<R�R�R�R�R(((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyRX�s			c
C`sCi}xU|jD]J}|j|�}|j\}}}|j||j|j�|||<qW|j}|jr�|jdk	r�|jj	|j�}q�nE|jdk	r�t
|j�}||jkr�|j	|j�}q�n|j}	yt|||�}Wn,t
k
r,d|	tj�f|_�nX||	df|_|S(s Execution of fixture setup. N(R�R�RR�RR8R;R3R<t__get__RRpR7RR?R@(
RgR�R4RatfixdefRIt
arg_cache_keytexcR-RH((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyRG$s,			
cC`s*|dkrdSt|�r |St|�S(N(R<tcallablettuple(R<((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyt_ensure_immutable_idsDs
tFixtureFunctionMarkercB`sweZej�Zejdejje��Zejde	�Z
ejddde�Z
ejdd�Zd�ZRS(tconverttdefaultcC`s(t|�rtd��n||_|S(Ns3class fixtures not supported (may be in the future)(RRCRi(R7R!((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyt__call__Ts
	N(RRRRRt
converterstoptionalRQRKRZtautouseR<RRR<R>RV(((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyRSLscC`s�t|�r@|dkr@|tkr@td||d|�|�S|dk	rqt|ttf�rqt|�}nt|||d|d|�S(s� (return a) decorator to mark a fixture factory function.

    This decorator can be used (with or without parameters) to define a
    fixture function.  The name of the fixture function can later be
    referenced to cause its invocation ahead of running tests: test
    modules or classes can use the pytest.mark.usefixtures(fixturename)
    marker.  Test functions can directly use fixture names as input
    arguments in which case the fixture instance returned from the fixture
    function will be injected.

    :arg scope: the scope for which this fixture is shared, one of
                "function" (default), "class", "module" or "session".

    :arg params: an optional list of parameters which will cause multiple
                invocations of the fixture function and all of the tests
                using it.

    :arg autouse: if True, the fixture func is activated for all tests that
                can see it.  If False (the default) then an explicit
                reference is needed to activate the fixture.

    :arg ids: list of string ids each corresponding to the params
                so that they are part of the test id. If no ids are provided
                they will be generated automatically from the params.

    :arg name: the name of the fixture. This defaults to the name of the
                decorated function. If a fixture is used in the same module in
                which it is defined, the function name of the fixture will be
                shadowed by the function arg that requests the fixture; one way
                to resolve this is to name the decorated function
                ``fixture_<fixturename>`` and then use
                ``@pytest.fixture(name='<fixturename>')``.

    Fixtures can optionally provide their values to test functions using a ``yield`` statement,
    instead of ``return``. In this case, the code block after the ``yield`` statement is executed
    as teardown code regardless of the test outcome. A fixture function must yield exactly once.
    R!R>R<N(RPR<RZRSRVRuRQ(RRKRYR<R>((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytfixture\s&$"cC`sat|�rA|dkrA|rAtd||d|d|�|�St|||d|d|�SdS(s� (return a) decorator to mark a yield-fixture factory function.

    .. deprecated:: 3.0
        Use :py:func:`pytest.fixture` directly instead.
    R!R<R>N(RPR<RS(RRKRYR<R>((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyt
yield_fixture�sRcC`s|jS(s; the pytest config object with access to command line opts.(R�(R�((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytpytestconfig�sR-cB`s�eZdZdZeZeZd�Zed�Zd�Z	d�Z
d�Zd�Zd�Z
eed	�Zd
�Zd�ZRS(s�
    pytest fixtures definitions and information is stored and managed
    from this class.

    During collection fm.parsefactories() is called multiple times to parse
    fixture function definitions into FixtureDef objects and internal
    data structures.

    During collection of test functions, metafunc-mechanics instantiate
    a FuncFixtureInfo object which is cached per node/func-name.
    This FuncFixtureInfo object is later retrieved by Function nodes
    which themselves offer a fixturenames attribute.

    The FuncFixtureInfo object holds information about fixtures and FixtureDefs
    relevant for a particular function.  An initial list of fixtures is
    assembled like this:

    - ini-defined usefixtures
    - autouse-marked fixtures along the collection chain up from the function
    - usefixtures markers at module/class/function level
    - test function funcargs

    Subsequently the funcfixtureinfo.fixturenames attribute is computed
    as the closure of the fixtures needed to setup the initial fixtures,
    i. e. fixtures needed by fixture functions themselves are appended
    to the fixturenames list.

    Upon the test-setup phases all fixturenames are instantiated, retrieved
    by a lookup of their FuncFixtureInfo.
    tpytest_funcarg__cC`sk||_|j|_i|_t�|_i|_d|jjd�fg|_|jjj	|d�dS(NRGtusefixturest
funcmanage(
R"R�RUR�t_holderobjseent_arg2finishtgetinit_nodeid_and_autousenamest
pluginmanagertregister(R7R"((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR��s			cC`s�|r+t|d�r+t|d|�}nd}t|dd�}|}|dk	re|j|}n|jj}|j||�\}	}
t||	|
�S(Nt
nofuncargsR2R^((	R�RRjR<R�R"R.tgetfixtureclosureR�(R7RER8R2RIR�R^tinitialnamesR�R�Re((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR��s	cC`s�d}ytjj|j�}Wntk
r2n^X|jjd�r�|j�j	|j
j�}|jt
jkr�|j|jt
j�}q�n|j||�dS(Nsconftest.py(R<R�R�R�t__file__R6tbasenameRtdirpathR�R�R�tsepRtSEPtreplacetparsefactories(R7tpluginR�R�((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytpytest_plugin_registered�s
c`s�g}xt�jD]i\}}|j|�r|rit|�}|||d!}|ri|dkriqqin|j|�qqW|jd�fd��|S(s- return a tuple of fixture names to be used. is:/Rqc`s�j|djS(Ni����(RURd(R(R7(s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR	�RG(RcRRNRtsort(R7R�tautousenamesR9t	basenamesR�tnextchar((R7s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyt_getautousenames�s		c	`s�|j}|j|���fd�}||�i}d}x{|t��kr�t��}xV�D]N}||kr}qen|j||�}|re|||<||dj�qeqeWq@W�|fS(Nc`s1x*|D]"}|�kr�j|�qqWdS(N(RP(t	otherlisttarg(tfixturenames_closure(s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytmerges
i����(R�RvRNR�R�(	R7R�t
parentnodeR�RzRetlastlenRaR�((Rys4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyRg�s 	


c

C`sIxB|jD]7}|jj|�}|r
|d}|jdk	rAt|jdd�}t|ddgg�}t|di�}d|kr�|jd}n
|d}t|t	t
f�s�g|jd�D]}	|	j�r�|	j�^q�}n||kr;||kr;|j
||jdtd	|jd
|j�q;qAq
q
q
WdS(Ni����tparametrizeR�R4R�it,tindirectRR<(R�RURBRKR<RjR!R4RVRQRuR!R#R}R$RR<(
R7R\RaRRgtparametrize_functfunc_paramstfunc_kwargsR�R((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytpytest_generate_testss$

7cC`st|�|(dS(N(R|(R7RJ((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pytpytest_collection_modifyitems2scC`s:|tk	r|}n|j}|j}||jkr:dS|jj|�g}x�t|�D]�}t||d�}t|�}|dkr|j	|j
�s�q]nt|�s�q]nt}ddl
m}	|jjd|	jjd|�d|�|t|j
�}nSt|t�s q]n>|jr5|j}nd|}
|j	|j
�s^t|
��t|||||j|jd|d|j�}|jj|g�}|jr�|j|�n8tg|D]}
|
js�|
^q��}|j ||�|j!r]|j|�q]q]W|r6|j"j|p)d	|f�ndS(
Ni(R�tC1R>R�sXfixtures cannot have "pytest_funcarg__" prefix and be decorated with @pytest.fixture:
%sR;R<RG(#R	RkR�R`R�tdirRR<RlRt
_argprefixRPtdefaultfuncargprefixmarkerR/R�R�R�tFUNCARG_PREFIXR�RNRVRSR>RLRXRRKR<RURMR:RPtinsertRYRc(R7tnode_or_objR�R;t	holderobjRsR>RkR�R�R�tfixture_defRtfR�((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyRo6sN			(		(	cC`s@y|j|}Wntk
r%dSXt|j||��SdS(s�
        Gets a list of fixtures which are applicable to the given node id.

        :param str argname: name of the fixture to search for
        :param str nodeid: full node id of the requesting test.
        :return: list[FixtureDef]
        N(RUR�R<RQR(R7RaR�R�((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR�os

cc`s2x+|D]#}tj|j|�r|VqqWdS(N(RtischildnodeR9(R7R�R�Rg((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR~s
(RRR=R�R�RR�R$R�RqRvRgR�R�R	RZRoR�R(((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyR-�s							9	(Qt
__future__RRRR�R�R?R�tcollectionsRRRRR�t
py._code.codeRR/Rt_pytest._code.codeRt_pytest.compatR	R
RRR
RRRRRRRt_pytest.outcomesRRtsR$tobjectRR0R%tdictR5R<RARFRhRlRrR|R~RvR�RYR�R�R�t	ExceptionRR!RSR�RRR�RtLookupErrorR�RR0R7RXRGRRRSRZRZR[R�R\R-(((s4/usr/lib/python2.7/site-packages/_pytest/fixtures.pyt<module>snR	
		5					#		�7	1		P	 	/