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/config.pyc
�
��abc@`sdZddlmZmZmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlmZmZmZddlmZed�Zed�Zdefd��YZeed	�Zd
efd��YZdefd
��YZ defd��YZ!d�Z"d�Z#dj$�Z%e&e%�Z'e'j(d�d�Z)d�Z*eed�Z+defd��YZ,d�Z-defd��YZ.defd��YZ/defd��YZ0d efd!��YZ1d"ej2fd#��YZ3d$ej4fd%��YZ5d&�Z6d'efd(��YZ7d)efd*��YZ8e8�Z9d+Z:d,�Z;d-efd.��YZ<e=d/�Z>ed0�Z?d1�Z@d2�ZAed3�ZBd4�ZCd5�ZDd6�ZEdS(7s< 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((s2/usr/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((s2/usr/lib/python2.7/site-packages/_pytest/config.pyt__str__!s(t__name__t
__module__R
R(((s2/usr/lib/python2.7/site-packages/_pytest/config.pyRs	cC`sy�yt||�}Wnytk
r�}tjjtj�}x3tj|j	�D]}|j
|j�dt�qPW|j
d|j
dt�dSXz|jjd|�SWd|j�XWnYtk
r}tjjtj�}x-|jD]"}|j
dj|�dt�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: {}
(t_prepareconfigRtpytiotTerminalWritertsyststderrRtformat_exceptionRtlinetrstriptTrueRthooktpytest_cmdline_maint_ensure_unconfiguret
UsageErrortargstformat(R*tpluginsRtettwR#tmsg((s2/usr/lib/python2.7/site-packages/_pytest/config.pytmain(s" tcmdlinecB`seZee�ZRS((RRtstaticmethodR0(((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR1EsR)cB`seZdZRS(s$ error in pytest usage or invocation(RRt__doc__(((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR)Ist	PrintHelpcB`seZdZRS(sfRaised when pytest should print it's help to skip the rest of the
    argument parsing and validation.(RRR3(((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR4MscC`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)R+(Rtoptname((s2/usr/lib/python2.7/site-packages/_pytest/config.pytfilename_argSscC`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}(R5RR6R)R+(RR7((s2/usr/lib/python2.7/site-packages/_pytest/config.pyt
directory_arg^ss�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 warnings loggingtpytestercC`s7t�}t|�}xtD]}|j|�qW|S(N(tPytestPluginManagertConfigtdefault_pluginst
import_plugin(t
pluginmanagerRtspec((s2/usr/lib/python2.7/site-packages/_pytest/config.pyt
get_configts
	
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.
    (RAR?(((s2/usr/lib/python2.7/site-packages/_pytest/config.pytget_plugin_manager}s	cC`ssd}|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|rx@|D]5}t|tj�r|j|�q�|j|�q�Wn|r4|jd|�n|jjd|d	|�SWntk
rn|j��nXdS(
Nis!not a string or argument list: %rtposixtwin32i(t
deprecatedtC1R?R*(tNoneR targvt
isinstanceRRtlocaltstrttupletlistt
ValueErrortshlextsplittplatformt_pytestREt
MAIN_STR_ARGSRAR?tsixtstring_typestconsider_pluginargtregistertwarnR&tpytest_cmdline_parset
BaseExceptionR((R*R,twarningRERR?tplugin((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR�s4		


R;cB`s�eZdZd�Zd�Zd�Zd�Zdd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(s?
    Overwrites :py:class:`pluggy.PluginManager <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("tsuperR;R
tsett_conftest_pluginst_path2confmodst_conftestpath2modRGt_confcutdirtFalset_noconftestt_duplicatepathst
add_hookspecsRRthookspecRWR5tenvirontgetR R!tgetattrRRtdupfileR	ttracetroott	setwritertwritetenable_tracingt	assertiontDummyRewriteHooktrewrite_hook(R
terrR`((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR
�s&				
	

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

        Use :py:meth:`pluggy.PluginManager.add_hookspecs <PluginManager.add_hookspecs>`
        instead.
        tcodetI2t
fslocationitnodeidtmessagesHuse pluginmanager.add_hookspecs instead of deprecated addhooks() method.N(	tdictRRt_codetgetfslinenoR t	_getframeRGt_warnRk(R
tmodule_or_classR[((s2/usr/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(	NR^tpytest_pluginstpytest_funcarg__ttryfirstttrylasttoptionalhookthookwrapper(R�R�R�R�(t
startswithRoRbR;tparse_hookimpl_optsRGt
setdefaultthasattr(R
R\tnametmethodtopts((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR��s
 cC`sutt|�j||�}|dkrqt||�}|jd�rqit|d�d6t|d�d6}qqn|S(NR^tfirstresultthistoric(RbR;tparse_hookspec_optsRGRoR�R�(R
R�R�R�R�((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR��scC`s�|d	kr2|jdj|jdd���dStt|�j||�}|r�|jjjdt	d|d|��t
|tj�r�|j
|�q�n|S(
Ntpytest_catchlogtpytest_capturelogsR{0} plugin has been merged into the core, please remove it from your requirements.t_t-tkwargsR\tmanager(R�R�(R�R+treplaceRbR;RWR&tpytest_plugin_registeredt
call_historicRRIttypest
ModuleTypetconsider_module(R
R\R�tret((s2/usr/lib/python2.7/site-packages/_pytest/config.pyRW�scC`s
|j|�S(N(t
get_plugin(R
R�((s2/usr/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�((s2/usr/lib/python2.7/site-packages/_pytest/config.pyt	haspluginscC`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((s2/usr/lib/python2.7/site-packages/_pytest/config.pytpytest_configures		cC`sQt|t�r|nidd6|d6dd6dd6}|jjjd|�dS(NtI1RzR~R|R}R�(RIRRGR&tpytest_logwarningR�(R
R~R�((s2/usr/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(RRRJt
confcutdirRR%RGRgt
noconftestRitfile_or_dirRhRKtfindtexistst_try_load_conftest(R
t	namespacetcurrentt	testpathstfoundanchorRtitanchor((s2/usr/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((s2/usr/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(RiRetKeyErrortisfileR�tdirpathtpartsRgtreltoRt_importconftesttappend(R
Rtclisttparenttconftestpathtmod((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR�Es"	

cC`sd|j|�}xBt|�D]4}y|t||�fSWqtk
rOqqXqWt|��dS(N(R�treversedRotAttributeErrorR�(R
R�RtmodulesR�((s2/usr/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(RfR�t	pypkgpathRGt_ensure_removed_sysmoduletpurebasenametpyimportR	RR texc_infoRdtaddR�RetitemsR�tAssertionErrorR�Rqtconsider_conftest(R
R�tpkgpathR�R�Rtmods((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR�fs*


!
cC`sDx=t||d�D](\}}|dkr|j|�qqWdS(Nis-p(tzipRV(R
R*topt1topt2((s2/usr/lib/python2.7/site-packages/_pytest/config.pytconsider_preparse�s cC`s]|jd�rL|d}|j|�|jd�sY|jd|�qYn
|j|�dS(Nsno:iR^(R�tset_blockedR>(R
targR�((s2/usr/lib/python2.7/site-packages/_pytest/config.pyRV�s

cC`s|j|d|j�dS(NR�(RWt__file__(R
tconftestmodule((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR��scC`s|jtjjd��dS(NtPYTEST_PLUGINS(t_import_plugin_specsR5RmRn(R
((s2/usr/lib/python2.7/site-packages/_pytest/config.pytconsider_env�scC`s|jt|dg��dS(NR�(R�Ro(R
R�((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR��scC`s.t|�}x|D]}|j|�qWdS(N(t_get_plugin_specs_as_listR>(R
R@R,timport_spec((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR��s
c	C`s�t|tjtf�s(td|��t|�}|j|�sX|j|�dk	r\dS|tkrud|}n|}|j	j
|�yt|�Wn�tk
r�}t}d|t
|jd�f}||�}tj||tj�d�n�tk
r^}ddl}t|d�s;t||jj�rA�n|jd||jf�nXtj|}|j||�dS(Ns$module name as text required, got %rs_pytest.sError importing plugin "%s": %siitskipsskipped plugin %r: %s(RIRTt	text_typeRKR�t
is_blockedR�RGtbuiltin_pluginsRxtmark_rewritet
__import__tImportErrorRR*treraiseR R�R	RR�R�R�R/R�RW(	R
tmodnamet
importspecR-tnew_exc_typetnew_exc_messagetnew_excRR�((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR>�s,($
 &
N(RRR3R
R�R�R�RGRWR�R�R�R�R�R�R�R�R�R�RVR�R�R�R�R>(((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR;�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(RGRIRKRPRMRLR)(tspecs((s2/usr/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((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR
�s					cC`s)|jr%|jr%|j|�q%ndS(N(R�tdest(R
toption((s2/usr/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((s2/usr/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((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR�scC`s[ddlm}|j�|_||j�|jjg|D]}t|�^q<d|�S(Ni(ttry_argcompleteR�(t_pytest._argcompleteR
t
_getparsert	optparsert
parse_argsRK(R
R*R�R
R�((s2/usr/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
RRtgroupsRtdesctarggroupRtnta((s2/usr/lib/python2.7/site-packages/_pytest/config.pyRs
	cC`sR|j|d|�}x-|jj�D]\}}t|||�q%Wt|t�S(NR�(Rt__dict__R�tsetattrRoR(R
R*RR�tparsedoptionR�tvalue((s2/usr/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�((s2/usr/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�(RRKR((R
R*R�RR�((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR'0s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�(RGR�R�R�R�(R
R�thelpttypetdefault((s2/usr/lib/python2.7/site-packages/_pytest/config.pytaddini8sN(RRR3RGR
RR
RRRR&R(R'R.(((s2/usr/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/RKt	option_id(R
R/R((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR
Ns	cC`s(|jrd|j|jfS|jSdS(Ns
option %s: %s(R0R/(R
((s2/usr/lib/python2.7/site-packages/_pytest/config.pyRRs	(RRR3R
R(((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR/Hs	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
j�r|d	kr�tjd
||ftdd�t|dd�|d<n1tjd
||ftdd�t
j||d<|d|_n	||_y|d|_Wntk
rJnX|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-iR�R�isneed a long or short optionN(t_attrst_short_optst
_long_optsRnRtwarningsRXtDeprecationWarningR�RIRTRUR,R1t_typ_mapR-t_set_opt_stringsR�t
IndexErrorR/(R
RRttyp((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR
gsT			



	

		#
cC`s|j|jS(N(R:R;(R
((s2/usr/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(RPRR�RoR9R�RnR�(R
RtattrR!((s2/usr/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 longiR�isMinvalid 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((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR?�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-R+R(R
R*((s2/usr/lib/python2.7/site-packages/_pytest/config.pyt__repr__�s		(
RRR3R2RKR4R5R>R
RRR?RE(((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR1Ys
	:			R�cB`s5eZddd�Zd�Zd�Zed�ZRS(RcC`s(||_||_g|_||_dS(N(R�RRR�(R
R�RR�((s2/usr/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.0RDR�((s2/usr/lib/python2.7/site-packages/_pytest/config.pys	<genexpr>�ssoption names %s already addedt
shortupperN(RctintersectionRRNR1t_addoption_instanceRh(R
toptnamesRtconflictR((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR�scO`s&t||�}|j|dt�dS(NRG(R1RIR%(R
RJRR((s2/usr/lib/python2.7/site-packages/_pytest/config.pyt
_addoption�scC`s||sLxC|jD]5}|ddkr|dj�rtd��qqWn|jrh|jj|�n|jj|�dS(NiR�islowercase shortoptions reserved(R:tislowerRNR�RRR�(R
RRGRD((s2/usr/lib/python2.7/site-packages/_pytest/config.pyRI�s 	N(RRRGR
RRLRhRI(((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR��s		RcB`s#eZdd�Zddd�ZRS(cC`sJ|si}n||_tjj|d|jdtdt�||_dS(NR�tadd_helptformatter_class(t_parsertargparsetArgumentParserR
R�RhtDropShorterLongHelpFormatterR�(R
R�R�((s2/usr/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 argumentsiR�sunrecognized arguments: %st s  %s: %ss
(
R(RtsortedR�R�R�terrorRoRtextend(R
R*R�RHR�tlinestktv((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR
s
"N(RRRGR
R(((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR�s
RScB`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(
NiR�t_formatted_action_invocations, iitmap_long_optionRTs--s)long optional argument without "--": [%s]Rt=(RQt
HelpFormattert_format_action_invocationRoRGRPRCR[R�R/R�R�RnR(R
tactiontorgstrtresRtreturn_listt
option_mapt
short_longRtxxoptiont	shortened((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR_"sD>		
"

"%#(RRR3R_(((s2/usr/lib/python2.7/site-packages/_pytest/config.pyRSscC`s&ytj|=Wntk
r!nXdS(N(R R�R�(R�((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR�Js
t
CmdOptionscB`s,eZdZdd�Zd�Zd�ZRS(s% holds cmdline options as attributes.cC`s|jj|�dS(N(R"tupdate(R
tvalues((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR
TscC`sd|jfS(Ns<CmdOptions %r>(R"(R
((s2/usr/lib/python2.7/site-packages/_pytest/config.pyREWscC`s
t|j�S(N(RhR"(R
((s2/usr/lib/python2.7/site-packages/_pytest/config.pytcopyZs((RRR3R
RERk(((s2/usr/lib/python2.7/site-packages/_pytest/config.pyRhQs	tNotsetcB`seZd�ZRS(cC`sdS(Ns<NOTSET>((R
((s2/usr/lib/python2.7/site-packages/_pytest/config.pyRE_s(RRRE(((s2/usr/lib/python2.7/site-packages/_pytest/config.pyRl^sR�cc`s�x�|D]�}d|ko%|jd�}|jd�dkoI|jd�}|rrtjj|�\}}|Vq|rtjj|�}|VqqWdS(Nt/s.pyis__init__.py(tendswithtcountR5Rtsplitexttdirname(t
package_filestfntis_simple_modulet
is_packagetmodule_nameR�tpackage_name((s2/usr/lib/python2.7/site-packages/_pytest/config.pyt_iter_rewritable_modulesgs
$R<cB`s1eZdZd�Zd�Zd�Zd�Zddd�Zd�Z	d�Z
dd�Zd	�Ze
d
��Zd�Zede�d
��Zd�Zd�Zd�Zd�Zed�Zd�Zed�Zd�Zd�Zd�Zd�Zd�Zee d�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(
NR�s#%%(prog)s [options] [%s] [%s] [...]RRtpytestconfigcS`sddl}t||�dS(Ni(Rtsetns(tdicR((s2/usr/lib/python2.7/site-packages/_pytest/config.pytdo_setns�sR�R�((RhRRR�R�RPR?RqRrRnR&t	_inicachet
_override_init	_opt2destt_cleanupR�RWRht_configuredtpytest_namespaceR�tpytest_addoptionR(R
R?t_aR|((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR
vs$							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(R�R�(R
tfunc((s2/usr/lib/python2.7/site-packages/_pytest/config.pytadd_cleanup�scC`s<|jst�t|_|jjjdtd|��dS(NR�R(R�R�R%R&R�R�R(R
((s2/usr/lib/python2.7/site-packages/_pytest/config.pyt
_do_configure�s	cC`sa|jr7t|_|jjd|�g|jj_nx#|jr\|jj�}|�q:WdS(NR(R�RhR&tpytest_unconfigureR�t
_call_historyR�tpop(R
tfin((s2/usr/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�RzR~R|R}N(R&R�R�R(R
RzR~R|R}((s2/usr/lib/python2.7/site-packages/_pytest/config.pyRX�scC`s|jjd�jS(Ntterminalreporter(R?R�t_tw(R
((s2/usr/lib/python2.7/site-packages/_pytest/config.pytget_terminal_writer�scC`s|j|�|S(N(R(R
R?R*((s2/usr/lib/python2.7/site-packages/_pytest/config.pyRY�s
cC`s�|r|jrd}nd}|jdtdt|dt�d|�}|jjd|d|�}t|�s�xAt|�j	d�D]'}t
jjd	|�t
jj
�q�WndS(
Ntlongtnativetfuncargst
showlocalststyletexcreprRs
sINTERNALERROR> %s
(t	fulltracetgetreprR%RoRhR&tpytest_internalerrortanyRKRPR R!Rttflush(R
RRR�R�RbR#((s2/usr/lib/python2.7/site-packages/_pytest/config.pytnotify_exception�s			cC`s=|j|jkr9|jj|�}|jj|�}n|S(N(tinvocation_dirtrootdirRtbestrelpath(R
R}tfullpath((s2/usr/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(	RARR"RiRRhR,R?RV(tclstoption_dictR*RR�((s2/usr/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;RRR�RR#R-(R
RDR�((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR��s
R�cC`s|jj|j�dS(N(R?R�tknown_args_namespace(R
tearly_config((s2/usr/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((RPR'RRktdetermine_setuptinifilenameR�RXR�R�tinicfgR�RRRJR�R.toverride_iniR~(R
R*tnstunknown_argstr((s2/usr/lib/python2.7/site-packages/_pytest/config.pyt_initini�s'"cC`s~|jj|�\}}|j}|dkrmytjj|�}Wntk
r\d}qmX|j|�n|j|�dS(s�Install the PEP 302 import hook if using assertion rewriting.

        Needs to parse the --assert=<mode> option from the commandline
        and find all the installed plugins to mark them for rewriting
        by the importhook.
        trewritetplainN(	RPR't
assertmodeRRRvtinstall_importhooktSystemErrort_mark_plugins_for_rewritet_warn_about_missing_assertion(R
R*R�R�tmodeR&((s2/usr/lib/python2.7/site-packages/_pytest/config.pyt_consider_importhook�s	

c`seddl}||j_d��fd�|jd�D�}x!t|�D]}|j|�qJWdS(s�
        Given an importhook, mark for rewrite any top-level
        modules or packages in the distribution package for
        all pytest plugins.
        iNtRECORDsSOURCES.txtc3`sH|]>}�D]1}|jj|�D]}|jd�dVq#q
qdS(R�iN(tdistt
_get_metadataRP(RFt
entrypointtmetadatatentry(tmetadata_files(s2/usr/lib/python2.7/site-packages/_pytest/config.pys	<genexpr>
s
tpytest11(R�sSOURCES.txt(t
pkg_resourcesR?Rxtiter_entry_pointsRxR�(R
R&R�RrR�((R�s2/usr/lib/python2.7/site-packages/_pytest/config.pyR��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?)
(RhR�R R!Rt(R
R�((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR�s
cC`s~|r,tjtjjdd��||(n|j|�|rV|jd�||(n|j�|j|�|j	j
|�|j	jd�|j	j�|j
j|d|jj��|_}|jjdkr|jrtjj|j�j}||j_ny&|jjd|d|d|j
�WnMtk
rytj�d	}|js\|jrs|j d
|j�qz�nXdS(NtPYTEST_ADDOPTSRR�R�R�R�R*R�is&could not load initial conftests (%s)
(!RORPR5RmRnR�tgetinit
_checkversionR�R?R�tload_setuptools_entrypointsR�RPR(RRkR�R�RGR�RRRJRqR&R�RR R�R+tversionR�(R
R*R�R�R�R-((s2/usr/lib/python2.7/site-packages/_pytest/config.pyt	_preparse's,&



(
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�RnRGRPt__version__R)RRtlineof(R
Rtminvertvertmyver((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR�BscC`s
t|d�std��||_|jjjdtd|j��|j|d|�|jj	d|d|�t
|j_yv|jj
||jd|j�}|s�tj�}||jkr�|jd�}n|s�|g}q�n||_Wntk
rnXdS(	NR*s:can only parse cmdline args at most once per Config objectR�R?R�RR�R�(R�R�t	_origargsR&tpytest_addhooksR�RR?R�tpytest_cmdline_preparseR%RPtafter_preparseR&RR5tgetcwdR�R�R*R4(R
R*R�tcwd((s2/usr/lib/python2.7/site-packages/_pytest/config.pyRNs&		!

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�RIRMR�R�(R
R�R#R�((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR�escC`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(R}R�t_getini(R
R�tval((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR�ms

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�((s2/usr/lib/python2.7/site-packages/_pytest/config.pyt<lambda>�Rs
R�(RPR�R�RNt_get_override_ini_valueRGR�RRRJRR�RORPR�RR%tmapR�t
_strtoboolR�R�(
R
R�RR,R-R%tdpRjtrelpathtt((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR�xs8

! 
2cC`s�y|jj||�\}}Wntk
r3dSXtjj|j�j�}g}xc|D][}t	|tjj�s�|j
dtjjj�}|j|dt
�}n|j|�q\W|S(NRmR�(R?R�R�RGRRRJR�R�RIR�tsepRR%R�(R
R�RR�trelrootstmodpathRjtrelroot((s2/usr/lib/python2.7/site-packages/_pytest/config.pyt_getconftest_pathlist�s

cC`sod}xb|jD]W}y|jdd�\}}Wntk
rQtd��qX||kr|}qqW|S(NR]is--o/--override-ini expects option=value style.(RGR~RPRNR)(R
R�R%t
ini_configtkeytuser_ini_value((s2/usr/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(
RRnRoRRGR�tnotsetRR�RN(R
R�R-R�R�R((s2/usr/lib/python2.7/site-packages/_pytest/config.pyt	getoption�s	
cC`s
|j|�S(s (deprecated, use getoption()) (R�(R
R�R((s2/usr/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((s2/usr/lib/python2.7/site-packages/_pytest/config.pytgetvalueorskip�sN($RRR3R
R�R�R(RGRXR�RYR�R�tclassmethodR�R�thookimplR%R�R�R�R�R�R�R�RR�R�R�R�R�R�RhR�R�R�(((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR<ss8								
											cC`s'y|j�SWn|k
r"tSXdS(N(R�Rh(Rtignore((s2/usr/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.cfgR�treverseRRFstool:pytestN(NNN(t_pytest.deprecatedR�RKR�RRRJR�R%RR�t	iniconfigt	IniConfigtsectionsRG(
R*R�R�tinibasenamesR�R�tbasetinibasenametpR�((s2/usr/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(	RGR�R�tcommonRRRJR�R�(tpathstcommon_ancestorRtshared((s2/usr/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(NR�(RKR�(R�((s2/usr/lib/python2.7/site-packages/_pytest/config.pyt	is_optionscS`st|�jd�dS(Ns::i(RKRP(R�((s2/usr/lib/python2.7/site-packages/_pytest/config.pytget_file_part_from_node_idscS`s#|j�r|Stjj|j�S(N(R6RRRJRq(R((s2/usr/lib/python2.7/site-packages/_pytest/config.pytget_dir_from_pathsc3`s3|])}�|�stjj�|��VqdS(N(RRRJ(RFR�(RR(s2/usr/lib/python2.7/site-packages/_pytest/config.pys	<genexpr>"s(R�(R*Rtpossible_pathsR((RRs2/usr/lib/python2.7/site-packages/_pytest/config.pytget_dirs_from_argss			

cC`s�t|�}|r�tjj|�}t|�jd�}|rKddgndg}x7|D]/}y||}PWq[tk
r�d}q[Xq[Wt|�}	n�t|�}
t	|
gd|�\}	}}|	dkr�x�|
j
dt�D]}	|	jd�j
�r�Pq�q�Wt	|d|�\}	}}|	dkr�ttjj�|
g�}	tjjt|	��ddk}|r|
}	qq�n|	||p�ifS(	Ns.cfgstool:pytestRR�R�ssetup.pyiRm(RRR�R�RKRnR�RGR�R�R�R%RR�RRJR5t
splitdrive(R�R*R�tdirsR�tis_cfg_fileR�tsectionR�R�tancestort
is_fs_root((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR�.s2


"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�RIRRoRGR�R�R R�t__all__R#R�Rz(tobjR{RR�R%R�R�((s2/usr/lib/python2.7/site-packages/_pytest/config.pyRzLs

	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	hasmarkupRh(RR*R�R.((s2/usr/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
    tyR
R�ttruetont1iR Rtftfalsetofft0isinvalid truth value %rN(RR
R�RRR(R RRRRR(tlowerRN(R�((s2/usr/lib/python2.7/site-packages/_pytest/config.pyR�ns	(FR3t
__future__RRRRQRORR�R<RTRR R5t
_pytest._codeRRt_pytest.hookspect_pytest.assertiontpluggyRRRt_pytest.compatRR�RlR	RRGR0tobjectR1R)R4R8R9RPR=RcR�R�RARBRR;R�R�R/R1R�RRRR^RSR�RhRlR�RRxR<tEnvironmentErrorR�R�R�RR�RzRR�(((s2/usr/lib/python2.7/site-packages/_pytest/config.pyt<module>sn
		
			�	v�$2	
		�b"