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/config.pyc

�
�mYc@`s�dZddlmZmZmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
ZddlZddlZddlmZmZmZddlmZed�Zed�Zdefd��YZeed	�Zd
fd��YZdefd
��YZd�Zd�Z gZ!dj"�Z#e$e#�Z%e%j&d�d�Z'd�Z(d�Z)eed�Z*defd��YZ+d�Z,dfd��YZ-defd��YZ.dfd��YZ/dfd ��YZ0d!ej1fd"��YZ2d#ej3fd$��YZ4d%�Z5d&e6fd'��YZ7d(fd)��YZ8e8�Z9d*Z:d+e6fd,��YZ;e<d-�Z=ed.�Z>d/�Z?d0�Z@ed1�ZAd2�ZBd3�ZCd4�ZDdS(5s< command line options, ini-file and conftest.py processing. i(tabsolute_importtdivisiontprint_functionN(t
PluginManagertHookimplMarkertHookspecMarker(tsafe_strtpytesttConftestImportFailurecB`seZd�Zd�ZRS(cC`s)tj|||�||_||_dS(N(t	Exceptiont__init__tpathtexcinfo(tselfRR((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR
s	cC`s@|j\}}}tj|�}t|�ddj|d�S(Ns
ti(Rt	tracebackt	format_tbtreprtjoin(R
tetypetevaluetetbt	formatted((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt__str__ s(t__name__t
__module__R
R(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyRs	cC`s�y�yt||�}Wnytk
r�}tjjtj�}x3tj|j	�D]}|j
|j�dt�qPW|j
d|j
dt�dSXz|jjd|�SWd|j�XWn?tk
r�}x(|jD]}tjjd|f�q�WdSXdS(s� return exit code, after performing an in-process test run.

    :arg args: list of command line arguments.

    :arg plugins: list of plugin objects to be auto-registered during
                  initialization.
    tredsERROR: could not load %s
itconfigNs
ERROR: %s
(t_prepareconfigRtpytiotTerminalWritertsyststderrRtformat_exceptionRtlinetrstriptTrueRthooktpytest_cmdline_maint_ensure_unconfiguret
UsageErrortargstwrite(R*tpluginsRtettwR#tmsg((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytmain's tcmdlinecB`seZee�ZRS((RRtstaticmethodR0(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR1BsR)cB`seZdZRS(s$ error in pytest usage or invocation(RRt__doc__(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR)FscC`s1tjj|�r-tdj||���n|S(ss Argparse type validator for filename arguments.

    :path: path of filename
    :optname: name of the option
    s"{0} must be a filename, given: {1}(tosRtisdirR)tformat(Rtoptname((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytfilename_argJscC`s1tjj|�s-tdj||���n|S(stArgparse type validator for directory arguments.

    :path: path of directory
    :optname: name of the option
    s#{0} must be a directory, given: {1}(R4RR5R)R6(RR7((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt
directory_argUss�mark main terminal runner python fixtures debugging unittest capture skipping tmpdir monkeypatch recwarn pastebin helpconfig nose assertion junitxml resultlog doctest cacheprovider freeze_support setuponly setupplan warningstpytestercC`s!ts
t�tjt��dS(N(t_preinittAssertionErrortappendt
get_config(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt_preloadpluginsms
cC`sJtrtjd�St�}t|�}xtD]}|j|�q/W|S(Ni(R;tpoptPytestPluginManagertConfigtdefault_pluginst
import_plugin(t
pluginmanagerRtspec((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR>qs
	
cC`s
t�jS(s�
    Obtain a new instance of the
    :py:class:`_pytest.config.PytestPluginManager`, with default plugins
    already loaded.

    This function can be used by integration with other tools, like hooking
    into pytest to run tests into an IDE.
    (R>RE(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytget_plugin_manager{s	cC`svd}|dkr"tjd}n�t|tjj�rIt|�g}ntt|tt	f�s�t|t�s�t
d|f��ntj|dtj
dk�}ddlm}|j}nt�}|j}y�|rxC|D]8}t|tjj�r
|j|�q�|j|�q�Wn|r7|jd|�n|jjd|d	|�SWntk
rq|j��nXdS(
Nis!not a string or argument list: %rtposixtwin32i(t
deprecatedtC1RER*(tNoneR targvt
isinstanceRRtlocaltstrttupletlistt
ValueErrortshlextsplittplatformt_pytestRJt
MAIN_STR_ARGSR>REtbuiltint_basestringtconsider_pluginargtregistertwarnR&tpytest_cmdline_parset
BaseExceptionR((R*R,twarningRJRREtplugin((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR�s4		


RAcB`s�eZdZd�Zd�Zd�Zd�Zd�Zdd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(s(
    Overwrites :py:class:`pluggy.PluginManager` to add pytest-specific
    functionality:

    * loading plugins from the command line, ``PYTEST_PLUGIN`` env variable and
      ``pytest_plugins`` global variables found in plugins being loaded;
    * ``conftest.py`` loading during start-up;
    cC`stt|�jddd�t�|_i|_i|_d|_t	|_
t�|_|jt
j�|j|�tjjd�r�tj}t|dd�}ytjj|d|�}Wntk
r�nX|jjj|j�|j�nt
jj �|_!dS(NRt
implprefixtpytest_tPYTEST_DEBUGtencodingtutf8("tsuperRAR
tsett_conftest_pluginst_path2confmodst_conftestpath2modRLt_confcutdirtFalset_noconftestt_duplicatepathst
add_hookspecsRWthookspecR\R4tenvirontgetR R!tgetattrRRtdupfileR	ttracetroott	setwriterR+tenable_tracingt	assertiontDummyRewriteHooktrewrite_hook(R
terrRe((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR
�s&				
	

c	C`sPtdddtjjtjd��dddd�}|j|�|j|�S(	si
        .. deprecated:: 2.8

        Use :py:meth:`pluggy.PluginManager.add_hookspecs` instead.
        tcodetI2t
fslocationitnodeidtmessagesHuse pluginmanager.add_hookspecs instead of deprecated addhooks() method.N(	tdictRWt_codetgetfslinenoR t	_getframeRLt_warnRp(R
tmodule_or_classR`((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytaddhooks�s	
cC`s�|jd�sdS|dks.|jd�r2dSt||�}tt|�j||�}|dk	r�x*dD]}|j|t||��qoWn|S(	NRctpytest_pluginstpytest_funcarg__ttryfirstttrylasttoptionalhookthookwrapper(R�R�R�R�(t
startswithRtRgRAtparse_hookimpl_optsRLt
setdefaultthasattr(R
Ratnametmethodtopts((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR��s
 cC`sutt|�j||�}|dkrqt||�}|jd�rqit|d�d6t|d�d6}qqn|S(NRctfirstresultthistoric(RgRAtparse_hookspec_optsRLRtR�R�(R
R�R�R�R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR��sc
C`sytt|�j||�d|jkrutjj|j�}tddd|dddd|j
�}|j|�ndS(Nt
__multicall__R~tI1R�R�R�s.%r hook uses deprecated __multicall__ argument(RgRAt_verify_hooktargnamesRWR�R�tfunctionR�RLR�R�(R
R&t
hookmethodtfslinenoR`((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR��s
cC`sott|�j||�}|rk|jjjdtd|d|��t|tj	�rk|j
|�qkn|S(NtkwargsRatmanager(RgRAR\R&tpytest_plugin_registeredt
call_historicR�RNttypest
ModuleTypetconsider_module(R
RaR�tret((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR\�scC`s
|j|�S(N(t
get_plugin(R
R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt	getpluginscC`st|j|��S(s<Return True if the plugin with the given name is registered.(tboolR�(R
R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt	hasplugin	scC`s$|jdd�|jdd�dS(Ntmarkerss|tryfirst: mark a hook implementation function such that the plugin machinery will try to call it first/as early as possible.sytrylast: mark a hook implementation function such that the plugin machinery will try to call it last/as late as possible.(taddinivalue_line(R
R((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytpytest_configure
s		cC`sQt|t�r|nidd6|d6dd6dd6}|jjjd|�dS(NR�R~R�R�R�R�(RNR�RLR&tpytest_logwarningR�(R
R�R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR�s
cC`s�tjj�}|jr0|j|jdt�nd|_|j|_	|j
}t}xy|D]q}t|�}|j
d�}|dkr�|| }n|j|dd�}t|�r[|j|�t}q[q[W|s�|j|�ndS(s} load initial conftest files given a preparsed "namespace".
            As conftest files may add their own command line options
            which have arguments ('--my-opt somepath') we might get some
            false positives.  All builtin and 3rd party plugins will have
            been loaded, however, so common options will not confuse our logic
            here.
        tabss::i����iN(RRROt
confcutdirRR%RLRlt
noconftestRntfile_or_dirRmRPtfindtexistst_try_load_conftest(R
t	namespacetcurrentt	testpathstfoundanchorRtitanchor((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt_set_initial_conftests#s *	



cC`sb|j|�|jdd�r^x<|jd�D](}|jdd�r/|j|�q/q/WndS(Ntdiristest*(t_getconftestmodulestchecktlistdir(R
R�tx((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR�>s

cC`s�|jr
gSy|j|SWn�tk
r�|j�rP|j|j��}nxg}xo|j�D]a}|jr�|jj|�r�qcn|j	d�}|j�rc|j
|�}|j|�qcqcW||j|<|SXdS(Nsconftest.py(RnRjtKeyErrortisfileR�tdirpathtpartsRltreltoRt_importconftestR=(R
Rtclisttparenttconftestpathtmod((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR�Fs"	

cC`sd|j|�}xBt|�D]4}y|t||�fSWqtk
rOqqXqWt|��dS(N(R�treversedRttAttributeErrorR�(R
R�RtmodulesR�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt_rget_with_confmod^s
cC`sEy|j|SWn/tk
r@|j�}|dkrGt|j�ny|j�}Wn&tk
rt|t	j
���nX|jj|�||j|<|j
�}||jkrxc|jj�D]O\}}|r�|j|�s�||kr�||kst�|j|�q�q�Wn|jd|�|j|�|SXdS(Nsloaded conftestmodule %r(RkR�t	pypkgpathRLt_ensure_removed_sysmoduletpurebasenametpyimportR	RR texc_infoRitaddR�RjtitemsR�R<R=Rvtconsider_conftest(R
R�tpkgpathR�R�Rtmods((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR�gs*


!
cC`sDx=t||d�D](\}}|dkr|j|�qqWdS(Nis-p(tzipR[(R
R*topt1topt2((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytconsider_preparse�s cC`s]|jd�rL|d}|j|�|jd�sY|jd|�qYn
|j|�dS(Nsno:iRc(R�tset_blockedRD(R
targR�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR[�s

cC`s|j|d|j�dS(NR�(R\t__file__(R
tconftestmodule((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR��scC`s|jtjjd��dS(NtPYTEST_PLUGINS(t_import_plugin_specsR4RrRs(R
((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytconsider_env�scC`s|jt|dg��dS(NR�(R�Rt(R
R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR��scC`s.t|�}x|D]}|j|�qWdS(N(t_get_plugin_specs_as_listRD(R
RFR,timport_spec((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR��s
cC`s�t|tjjtf�s+td|��t|�}|j|�dk	rPdS|tkrid|}n|}|j	j
|�yt|�Wn�tk
r}td|t
|jd�f�}x9d	D]1}t||�r�t||t||��q�q�W|�n�tk
rk}ddl}t|d�sHt||jj�rN�n|jd||jf�nXtj|}|j||�dS(
Ns$module name as text required, got %rs_pytest.sError importing plugin "%s": %siR�Rtskipsskipped plugin %r: %s(R�R(RNRRYttextRPR<R�RLtbuiltin_pluginsR|tmark_rewritet
__import__tImportErrorRR*R�tsetattrRtR	RR�R�R/R R�R\(R
tmodnamet
importspecR-tnew_exctattrRR�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyRD�s.+
#
 	&
N(RRR3R
R�R�R�R�RLR\R�R�R�R�R�R�R�R�R�R�R[R�R�R�R�RD(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyRA�s.				
	
			
														cC`so|dk	rkt|t�r9|r0|jd�ng}nt|ttf�satd|��nt|�SgS(s
    Parses a list of "plugin specs" and returns a list of plugin names.

    Plugin specs can be given as a list of strings separated by "," or already as a list/tuple in
    which case it is returned as a list. Specs can also be `None` in which case an
    empty list is returned.
    t,sbPlugin specs must be a ','-separated string or a list/tuple of strings for plugin names. Given: %rN(RLRNRPRURRRQR)(tspecs((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR��s

tParsercB`s�eZdZddd�Zd�Zddd�Zd�Zdd�Zd�Z	dd�Z
dd	�Zdd
�Zddd�Z
RS(
s� Parser for command line arguments and ini-file values.

    :ivar extra_info: dict of generic param -> value to display in case
        there's an error processing the command line arguments.
    cC`sOtdd|�|_g|_||_||_i|_g|_i|_dS(Nscustom optionstparser(tOptionGroupt
_anonymoust_groupst_processoptt_usaget_inidictt	_ininamest
extra_info(R
tusaget
processopt((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR
�s					cC`s)|jr%|jr%|j|�q%ndS(N(R�tdest(R
toption((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt
processoption�s		RcC`s�x$|jD]}|j|kr
|Sq
Wt||d|�}d}x0t|j�D]\}}|j|krRPqRqRW|jj|d|�|S(s� get (or create) a named option Group.

        :name: name of the option group.
        :description: long description for --help output.
        :after: name of other group, used for ordering --help output.

        The returned group object has an ``addoption`` method with the same
        signature as :py:func:`parser.addoption
        <_pytest.config.Parser.addoption>` but will be shown in the
        respective group in the output of ``pytest. --help``.
        R�ii(R�R�R�t	enumeratetinsert(R
R�tdescriptiontaftertgroupR�tgrp((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytgetgroup�scO`s|jj||�dS(s register a command line option.

        :opts: option names, can be short or long options.
        :attrs: same attributes which the ``add_option()`` function of the
           `argparse library
           <http://docs.python.org/2/library/argparse.html>`_
           accepts.

        After command line parsing options are available on the pytest config
        object via ``config.option.NAME`` where ``NAME`` is usually set
        by passing a ``dest`` attribute, for example
        ``addoption("--long", dest="NAME", ...)``.
        N(R�t	addoption(R
R�tattrs((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR�scC`s[ddlm}|j�|_||j�|jjg|D]}t|�^q<d|�S(Ni(ttry_argcompleteR�(t_pytest._argcompleteRt
_getparsert	optparsert
parse_argsRP(R
R*R�RR�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytparses
c
C`s�ddlm}t||j�}|j|jg}xw|D]o}|jr<|jpZ|j}|j	|�}x<|jD].}|j
�}|j�}	|j||	�qvWq<q<W||jt
dd�_|S(Ni(tfilescompletertnargst*(RRtMyOptionParserR�R�R�toptionsRR�tadd_argument_grouptnamesR
tadd_argumenttFILE_OR_DIRt	completer(
R
RRtgroupsR	tdesctarggroupRtnta((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyRs
	cC`sR|j|d|�}x-|jj�D]\}}t|||�q%Wt|t�S(NR�(Rt__dict__R�R�RtR(R
R*RR�tparsedoptionR�tvalue((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytparse_setoption%scC`s|j|d|�dS(sZparses and returns a namespace object with known arguments at this
        point.
        R�i(tparse_known_and_unknown_args(R
R*R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytparse_known_args+scC`s>|j�}g|D]}t|�^q}|j|d|�S(sparses and returns a namespace object with known arguments, and
        the remaining arguments unknown at this point.
        R�(RRPR((R
R*R�RR�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR'1scC`s<|dkst�|||f|j|<|jj|�dS(s� register an ini-file option.

        :name: name of the ini-variable
        :type: type of the variable, can be ``pathlist``, ``args``, ``linelist``
               or ``bool``.
        :default: default value if no ini-file option exists but is queried.

        The value of ini-variables can be retrieved via a call to
        :py:func:`config.getini(name) <_pytest.config.Config.getini>`.
        tpathlistR*tlinelistR�N(NR)R*R*R�(RLR<R�R�R=(R
R�thelpttypetdefault((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytaddini9sN(RRR3RLR
RRRRRR&R(R'R.(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR��s				t
ArgumentErrorcB`s eZdZd�Zd�ZRS(s_
    Raised if an Argument instance is created with invalid or
    inconsistent arguments.
    cC`s||_t|�|_dS(N(R/RPt	option_id(R
R/R((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR
Os	cC`s(|jrd|j|jfS|jSdS(Ns
option %s: %s(R0R/(R
((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyRSs	(RRR3R
R(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR/Is	tArgumentcB`s]eZdZied6ed6ed6ed6Zd�Zd�Z	d�Z
d�Zd	�ZRS(
s�class that mimics the necessary behaviour of optparse.Option

    its currently a least effort implementation
    and ignoring choices and integer prefixes
    https://docs.python.org/3/library/optparse.html#optparse-standard-option-types
    tinttstringtfloattcomplexcO`s�||_g|_g|_|jd�|_d|jd�pBdkratjdtdd�ny|d}Wntk
r�n�Xt	|t
jj�r |d	kr�tjd
||ftdd�t
|dd�|d<n1tjd
||ftdd�tj||d<|d|_
n	||_
y|d|_Wntk
rMnX|j|�|js�|jr�|jddjdd�|_q�y|jdd|_Wq�tk
r�td|��q�XndS(s3store parms in private vars for use in add_argumentRs%defaultR+RsHpytest now uses argparse. "%default" should be changed to "%(default)s" t
stackleveliR,tchoices|type argument to addoption() is a string %r. For parsearg this is optional and when supplied should be a type. (options: %s)tchoicesis^type argument to addoption() is a string %r. For parsearg this should be a type. (options: %s)R-it-t_isneed a long or short optionN(t_attrst_short_optst
_long_optsRsRtwarningsR]tDeprecationWarningR�RNRRYRZR,R1t_typ_mapR-t_set_opt_stringstreplacet
IndexErrorR/(R
RR
ttyp((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR
hsT			



	

		#
cC`s|j|jS(N(R<R=(R
((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR�scC`s�dj�}|jr(|j|j�nx<|D]4}yt||�|j|<Wq/tk
rbq/Xq/W|jjd�r�|jd}|jdd�}||jd<n|jS(Nsdefault dest helpR+s%defaults%(default)s(RURR=RtR;R�RsRB(R
R
R�R"((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR
�s	


cC`s�x�|D]�}t|�dkr5td||��qt|�dkr�|ddkod|ddks}td||��n|jj|�q|dd!dko�|ddks�td||��n|jj|�qWd	S(
s]directly from optparse

        might not be necessary as this is passed to argparse later onis>invalid option string %r: must be at least two characters longiR9isMinvalid short option string %r: must be of the form -x, (x any non-dash char)s--sGinvalid long option string %r: must start with --, followed by non-dashN(tlenR/R<R=R=(R
R�topt((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyRA�s$
 #cC`s�g}|jr,|dt|j�g7}n|jrR|dt|j�g7}n|dt|j�g7}t|d�r�|dt|j�g7}nt|d�r�|dt|j�g7}ndjd	j|��S(
Ns
_short_opts: s_long_opts: sdest: R,stype: R-s	default: s
Argument({0})s, (	R<RR=RR�R,R-R6R(R
R*((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt__repr__�s		(
RRR3R2RPR4R5R@R
RR
RARG(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR1Zs
	:			R�cB`s5eZddd�Zd�Zd�Zed�ZRS(RcC`s(||_||_g|_||_dS(N(R�RRR�(R
R�RR�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR
�s			cO`sat|�jd�|jD��}|r;td|��nt||�}|j|dt�dS(sE add an option to this group.

        if a shortened version of a long option is specified it will
        be suppressed in the help. addoption('--twowords', '--two-words')
        results in help showing '--two-words' only, but --twowords gets
        accepted **and** the automatic destination is in args.twowords
        cs`s(|]}|j�D]}|VqqdS(N(R(t.0RFR�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pys	<genexpr>�ssoption names %s already addedt
shortupperN(RhtintersectionRRSR1t_addoption_instanceRm(R
toptnamesR
tconflictR((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR�scO`s&t||�}|j|dt�dS(NRI(R1RKR%(R
RLR
R((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt
_addoption�scC`s||sLxC|jD]5}|ddkr|dj�rtd��qqWn|jrh|jj|�n|jj|�dS(NiR9islowercase shortoptions reserved(R<tislowerRSR�RRR=(R
RRIRF((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyRK�s 	N(RRRLR
RRNRmRK(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR��s		RcB`s#eZdd�Zddd�ZRS(cC`sJ|si}n||_tjj|d|jdtdt�||_dS(NRtadd_helptformatter_class(t_parsertargparsetArgumentParserR
R�RmtDropShorterLongHelpFormatterR�(R
R�R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR
s		
cC`s�|j||�\}}|r�x�|D]�}|r%|ddkr%ddj|�g}x:t|jj��D]#\}}|jd||f�qmW|jdj|��q%q%Wt|t�j	|�n|S(s'allow splitting of positional argumentsiR9sunrecognized arguments: %st s  %s: %ss
(
R(RtsortedR�R�R=terrorRtRtextend(R
R*R�RMR�tlinestktv((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyRs
"N(RRRLR
R(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyRs
RUcB`seZdZd�ZRS(s�shorten help for long options that differ only in extra hyphens

    - collapse **long** options that are the same except for extra hyphens
    - special action attribute map_long_option allows surpressing additional
      long options
    - shortcut if there are only two options and one of them is a short one
    - cache result on action object as this is called at least 2 times
    cC`s@tjj||�}|r/|ddkr/|St|dd�}|rK|S|jd�}t|�dkr�t|d�dks�t|d�dkr�||_|Sg}t|di�}|dkr�i}ni}x�|D]�}t|�dks�|ddkr
q�n|jd	�s2t	d
||��n|d}	|	j�d|kr�|	j
dd�}
|
|ks�t||
�t|	�kr�|	||
<q�q�q�Wx�|D]|}t|�dks�|ddkr�|j|�n|d|j|j
dd��kr�|j|j
ddd��q�q�Wdj
|�|_|jS(
NiR9t_formatted_action_invocations, iitmap_long_optionRVs--s)long optional argument without "--": [%s]Rt=(RSt
HelpFormattert_format_action_invocationRtRLRURER]R�R/RBR=RsR(R
tactiontorgstrtresRtreturn_listt
option_mapt
short_longRtxxoptiont	shortened((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyRa"sD>		
"

"%#(RRR3Ra(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyRUscC`s&ytj|=Wntk
r!nXdS(N(R R�R�(R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR�Ks
t
CmdOptionscB`s,eZdZdd�Zd�Zd�ZRS(s% holds cmdline options as attributes.cC`s|jj|�dS(N(R#tupdate(R
tvalues((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR
SscC`sd|jfS(Ns<CmdOptions %r>(R#(R
((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyRGUscC`s
t|j�S(N(RjR#(R
((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytcopyWs((RRR3R
RGRm(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyRjQs	tNotsetcB`seZd�ZRS(cC`sdS(Ns<NOTSET>((R
((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyRG[s(RRRG(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyRnZsR�RBcB`s(eZdZd�Zd�Zd�Zd�Zddd�Zd�Z	d�Z
dd�Zd	�Ze
d
��Zd�Zede�d
��Zd�Zd�Zd�Zed�Zd�Zed�Zd�Zd�Zd�Zd�Zd�Zeed�Z dd�Z!dd�Z"RS(sB access to configuration values, pluginmanager and plugin hooks.  cC`s�t�|_t}tdd||fd|j�|_||_|jjjj	d�|_|jj
|_
i|_d	|_i|_
g|_|jj|_|jj|d�t|_d�}|j
jj|i�|j
jjdtd|j��dS(
NRs#%%(prog)s [options] [%s] [%s] [...]RRtpytestconfigcS`sddl}t||�dS(Ni(Rtsetns(tdicR((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytdo_setns{sR�R�((RjRRR�R�RRRERvRwRsR&t	_inicachet
_override_init	_opt2destt_cleanupR�R\Rmt_configuredtpytest_namespaceR�tpytest_addoptionR�(R
REt_aRr((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR
fs$							cC`s|jj|�dS(sz Add a function to be called when the config object gets out of
        use (usually coninciding with pytest_unconfigure).N(RvR=(R
tfunc((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytadd_cleanup�scC`s<|jst�t|_|jjjdtd|��dS(NR�R(RwR<R%R&R�R�R�(R
((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt
_do_configure�s	cC`sa|jr7t|_|jjd|�g|jj_nx#|jr\|jj�}|�q:WdS(NR(RwRmR&tpytest_unconfigureR�t
_call_historyRvR@(R
tfin((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR(�s		cC`s5|jjjdtd|d|d|d|��dS(s+ generate a warning for this test session. R�R~R�R�R�N(R&R�R�R�(R
R~R�R�R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR]�scC`s|jjd�jS(Ntterminalreporter(RER�t_tw(R
((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytget_terminal_writer�scC`s|j|�|S(N(R(R
RER*((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR^�s
cC`s�|r|jrd}nd}|jdtdt|dt�d|�}|jjd|d|�}tjj	|�s�xAt
|�jd�D]'}tj
jd	|�tj
j�q�WndS(
Ntlongtnativetfuncargst
showlocalststyletexcreprRs
sINTERNALERROR> %s
(t	fulltracetgetreprR%RtRmR&tpytest_internalerrorRRYtanyRPRUR R!R+tflush(R
RRR�R�RdR#((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytnotify_exception�s			cC`s=|j|jkr9|jj|�}|jj|�}n|S(N(tinvocation_dirtrootdirRtbestrelpath(R
R�tfullpath((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytcwd_relative_nodeid�scC`sZt�}|jjj|�|j|dt�x$|jjD]}|jj|�q<W|S(s' constructor useable for subprocesses. taddopts(	R>RR#RkRRmR,RER[(tclstoption_dictR*RR�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytfromdictargs�s	cC`s{x(|j|jD]}|j|j|<qWt|d�rw|jrwt|j|j�swt|j|j|j�qwndS(NR-(R<R=RRuR�RR�R-(R
RFR�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR��s
R�cC`s|jj|j�dS(N(RER�tknown_args_namespace(R
tearly_config((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytpytest_load_initial_conftests�scC`s�|jj|d|jj��\}}t|j|j|d|j�}|\|_|_	|_
|j|jjd<|j	|jjd<tj
j�|_|jjddd�|jjdd	�|jp�d
|_dS(NR�twarnfuncR�tinifileR�sextra command line optionsR*t
minversions!minimally required pytest version((RRR'RRmtdetermine_setuptinifilenameR�R]R�R�tinicfgR�RRROR�R.toverride_iniRt(R
R*tnstunknown_argstr((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt_initini�s'"cC`s|jj|�\}}|j}|dkrnytjj|�}Wntk
r\d}qnXddl}||j_	x�|j
d�D]�}x�dD]�}	x�|jj|	�D]�}
|
j
d�d}tj|ko�|jd	�}|jtj�d
ko|jd�}
|r7tjj|�\}}|j|�q�|
r�tjj|�}|j|�q�q�Wq�Wq�Wn|j|�dS(
s�Install the PEP 302 import hook if using assertion re-writing.

        Needs to parse the --assert=<mode> option from the commandline
        and find all the installed plugins to mark them for re-writing
        by the importhook.
        trewritetplainiNtpytest11tRECORDsSOURCES.txtR�s.pyis__init__.py(R�sSOURCES.txt(RRR't
assertmodeRWRztinstall_importhooktSystemErrort
pkg_resourcesRER|titer_entry_pointstdistt
_get_metadataRUR4tseptendswithtcountRtsplitextR�tdirnamet_warn_about_missing_assertion(R
R*tentrypoint_nameR�R�tmodeR&R�t
entrypointtmetadatatentrytfntis_simple_modulet
is_packagetmodule_nametexttpackage_name((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt_consider_importhook�s,	


'cC`sWytst�Wntk
r#n0X|dkrCtjjd�ntjjd�dS(NR�s[WARNING: ASSERTIONS ARE NOT EXECUTED and FAILING TESTS WILL PASS.  Are you using python -O?s�WARNING: assertions not in test modules or plugins will be ignored because assert statements are not executed by the underlying Python interpreter (are you using python -O?)
(RmR<R R!R+(R
R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR��s
cC`s�|j|�|rMtjtjjdd��||(|jd�||(n|j�d}|j||�|j	j
|�|j	j|�|j	j�|j
j|d|jj��|_}|jj}|jjdkr|jrtjj|j�j}||j_ny&|jjd|d|d|j
�WnMtk
r�tj�d	}|jsh|jr|j d
|j�q��nXdS(NtPYTEST_ADDOPTSRR�R�R�R�R*R�is&could not load initial conftests (%s)
(!R�RTRUR4RrRstgetinit
_checkversionR�RER�tload_setuptools_entrypointsR�RRR(RRmR�R�RLR�RRROR�R&R�RR R�R+tversionR�(R
R*R�R�R�R�R-((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt	_preparses.
#

(
cC`s�ddl}|jjdd�}|r�|jd�}|jjd�}||kr�|jd|jjj|jj	d�||jf��q�ndS(NiR�t.s,%s:%d: requires pytest-%s, actual pytest-%s'(
RR�RsRLRUt__version__R)RRtlineof(R
Rtminvertvertmyver((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR�+scC`s�t|d�std��||_|jjjdtd|j��|j|d|�|jj	d|d|�|j
j||jd|j�}|s�t
j�}||jkr�|jd�}n|s�|g}q�n||_dS(	NR*s:can only parse cmdline args at most once per Config objectR�RER�RR�R�(R�R<t	_origargsR&tpytest_addhooksR�R�RER�tpytest_cmdline_preparseRRR&RR4tgetcwdR�R�R*(R
R*R�tcwd((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR7s		!cC`s5|j|�}t|t�s$t�|j|�dS(s� add a line to an ini-file option. The option must have been
        declared but might not yet be set in which case the line becomes the
        the first line in its value. N(R�RNRRR<R=(R
R�R#R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR�JscC`sBy|j|SWn,tk
r=|j|�|j|<}|SXdS(s return configuration value from an :ref:`ini file <inifiles>`. If the
        specified name hasn't been registered through a prior
        :py:func:`parser.addini <pytest.config.Parser.addini>`
        call (usually from a plugin), a ValueError is raised. N(RsR�t_getini(R
R�tval((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR�Rs

c
C`s�y|jj|\}}}Wn$tk
rCtd|f��nX|j|�}|dkr�y|j|}Wq�tk
r�|dk	r�|S|dkr�dSgSXn|dkrtjj	|jj
j�j�}g}x3tj
|�D]"}|j|j|dt��q�W|S|dkr.tj
|�S|dkrlgtd�|j
d��D]}	|	rV|	^qVS|d	kr�tt|j���S|dks�t�|SdS(
Nsunknown configuration value: %rRR)R�R*R*cS`s
|j�S(N(tstrip(R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt<lambda>uRs
R�(RRR�R�RSt_get_override_ini_valueRLR�RRRORR�RTRUR=RR%tmapR�t
_strtoboolR�R<(
R
R�RR,R-R%tdptltrelpathtt((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR�]s8

! 
2cC`s�y|jj||�\}}Wntk
r3dSXtjj|j�j�}g}xc|D][}t	|tjj�s�|j
dtjjj�}|j|dt
�}n|j|�q\W|S(Nt/R�(RER�R�RLRRROR�R�RNRBR�RR%R=(R
R�RR�trelrootstmodpathR�trelroot((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt_getconftest_pathlist|s

cC`s�d}xs|jD]h}x_|D]W}y|jdd�\}}Wntk
r^td��nX||kr|}qqWqW|S(NR_is--o/--override-ini expects option=value style.(RLRtRURSR)(R
R�R%tini_config_listt
ini_configtkeytuser_ini_value((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR��s

cC`s�|jj||�}y;t|j|�}|dkrK|rKt|��n|SWn]tk
r�|tk	rp|S|r�ddl}|jd|f�nt	d|f��nXdS(sc return command line option value.

        :arg name: name of the option.  You may also specify
            the literal ``--OPT`` option instead of the "dest" option name.
        :arg default: default value if no option of that name exists.
        :arg skip: if True raise pytest.skip if option does not exists
            or has a None value.
        iNsno %r option foundsno option named %r(
RuRsRtRRLR�tnotsetRR�RS(R
R�R-R�R�R((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt	getoption�s	
cC`s
|j|�S(s (deprecated, use getoption()) (R�(R
R�R((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytgetvalue�scC`s|j|dt�S(s( (deprecated, use getoption(skip=True)) R�(R�R%(R
R�R((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytgetvalueorskip�sN(#RRR3R
R|R}R(RLR]R�R^R�R�tclassmethodR�R�thookimplR%R�R�R�R�R�R�RR�R�R�R�R�R�RmR�R�R�(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyRBcs6								
			#							cC`s'y|j�SWn|k
r"tSXdS(N(R�Rm(Rtignore((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR��s
c
C`stddlm}dddg}g|D]!}t|�jd�s&|^q&}|shtjj�g}nx|D]�}tjj|�}x�|jdt�D]�}x�|D]�}|j	|�}t
|�r�tjj|�}	d|	j
kr|dkr|r|d	|�n|||	dfS|dkrHd
|	j
krH|||	d
fS|dkrd||ifSq�q�Wq�WqoWdS(
sY
    Search the list of arguments for a valid ini-file for pytest,
    and return a tuple of (rootdir, inifile, cfg-dict).

    note: warnfunc is an optional function used to warn
        about ini-files that use deprecated features.
        This parameter should be removed when pytest
        adopts standard deprecation warnings (#1804).
    i(tSETUP_CFG_PYTESTs
pytest.inistox.inis	setup.cfgR9treverseRRKstool:pytestN(NNN(t_pytest.deprecatedR�RPR�RRROR�R%RR�t	iniconfigt	IniConfigtsectionsRL(
R*R�R�tinibasenamesR�R�tbasetinibasenametpR�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytgetcfg�s*
.

cC`s�d}x�|D]�}|j�s%q
n|dkr:|}q
|j|�s
||kr[q
q
|j|�rs|}q
|j|�}|dk	r
|}q
q
W|dkr�tjj�}n|j�r�|j�}n|S(N(	RLR�R�tcommonRRROR�R�(tpathstcommon_ancestorRtshared((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytget_common_ancestor�s$
		
c`s]d��d��d�}��fd�|D�}g|D]}|j�r;||�^q;S(NcS`st|�jd�S(NR9(RPR�(R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt	is_option�scS`st|�jd�dS(Ns::i(RPRU(R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytget_file_part_from_node_id�scS`s#|j�r|Stjj|j�S(N(R5RRROR�(R((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytget_dir_from_path�sc3`s3|])}�|�stjj�|��VqdS(N(RRRO(RHR�(RR(s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pys	<genexpr>s(R�(R*Rtpossible_pathsR((RRs?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytget_dirs_from_args�s			

c	C`sVt|�}|r[tjj|�}y|d}Wntk
rKd}nXt|�}n�t|�}t|gd|�\}}}|dkrCx�|jdt	�D]}|j
d�j�r�Pq�q�Wt|d|�\}}}|dkrCttjj
�|g�}tjjt|��dtjk}|r@|}q@qCn|||pRifS(NRR�R�ssetup.pyi(RRR�R�R�RLR�R�R�R%RR�RROR4t
splitdriveRPR�(	R�R*R�tdirsR�R�R�tancestort
is_fs_root((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR�s*

%cC`s�ddl}x�|j�D]�\}}t|t�r�t||d�}|dkr�d|}tj|�}|tj	|<g|_
t|||�n|j
j|�t
||�qt|||�|j
j|�t|||�qWdS(Nis	pytest.%s(RR�RNR�RtRLR�R�R R�t__all__R�R=Rp(tobjRqRR�R%R�R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyRp,s

	cO`sUtjj||�}|jjdkr3t|_n|jjdkrQt|_n|S(s�Create a TerminalWriter instance configured according to the options
    in the config object. Every code which requires a TerminalWriter object
    and has access to a config object should use this function.
    tyestno(RRRRtcolorR%t	hasmarkupRm(RR*R�R.((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pytcreate_terminal_writerAscC`sC|j�}|dkrdS|dkr,dStd|f��dS(sConvert a string representation of truth to true (1) or false (0).

    True values are 'y', 'yes', 't', 'true', 'on', and '1'; false values
    are 'n', 'no', 'f', 'false', 'off', and '0'.  Raises ValueError if
    'val' is anything else.

    .. note:: copied from distutils.util
    tyRR�ttruetont1iR!Rtftfalsetofft0isinvalid truth value %rN(RRR�RRR(R!RRRRR(tlowerRS(R�((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyR�Ns	(ER3t
__future__RRRRSRTRR�R>RR R4t
_pytest._codeRWt_pytest.hookspect_pytest.assertiont_pytest._pluggyRRRt_pytest.compatRR�RqR	RRLR0R1R)R8R9R;RURCRhR�R�R?R>RGRRAR�R�R/R1R�RTRR`RUR�tobjectRjRnR�RRBtEnvironmentErrorR�R�R�RR�RpRR�(((s?/opt/alt/python27/lib/python2.7/site-packages/_pytest/config.pyt<module>sl
		
		
	�	v�$2			�W"