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/mark.pyc
�
��abc@`sSdZddlmZmZmZddlZddlZddlZddlZddl	m
Z
ddlmZddl
mZddlmZdd	lmZdd
lmZmZdZdd�Zd
e
d
d�fd��YZd�Zdefd��YZd�Zd�Zd�Ze e_!d�Z"ej#de$fd��Y�Z%de$fd��YZ&dddgZ'd�Z(d�Z)d �Z*d!�Z+d"e$fd#��YZ,d$�Z-ej#d%e �d&e$fd'��Y�Z.ej#d(e$fd)��Y�Z/d*�Z0d+�Z1d,�Z2d-e$fd.��YZ3e,�Z4d/�Z5d0�Z6dS(1s? generic mechanism for marking and selecting python functions. i(tabsolute_importtdivisiontprint_functionN(t
namedtuple(t
attrgetter(tmap(t
UsageErrori(tMARK_PARAMETERSET_UNPACKING(tNOTSETtgetfslinenotempty_parameter_set_markc`sDt|����fd�}t�dkr3�n|dd|�S(Nc`stj�dd��|�S(Nt
stackleveli(twarningstwarn(tself(tgettertwarning(s0/usr/lib/python2.7/site-packages/_pytest/mark.pytwarnedstdocs
alias for (RtpropertytNone(tnameRR((RRs0/usr/lib/python2.7/site-packages/_pytest/mark.pytaliasstParameterSetsvalues, marks, idcB`s8eZed��Zeed��Zed��ZRS(cO`ss|jdd�}t|t�r-|f}nt|tttf�sKt�dd�}||�}||||�S(NtmarkscS`s|S(N((tid((s0/usr/lib/python2.7/site-packages/_pytest/mark.pytparam_extract_id&s((tpopt
isinstancet
MarkDecoratorttupletlisttsettAssertionErrorR(tclstvaluestkwRRR((s0/usr/lib/python2.7/site-packages/_pytest/mark.pytparamscC`s�t||�r|St|t�r6|r6|j|�Sg}|}xLt|t�r�|jtt|j|jd |j���|jd}qEWt|t�s�t	�|r�|f}n|r�t
jt�n||d|dd�S(sM
        :param parameterset:
            a legacy style parameterset that may or may not be a tuple,
            and may or may not be wrapped into a mess of mark objects

        :param legacy_force_tuple:
            enforce tuple wrapping so single argument tuple values
            don't get decomposed and break tests

        i����RRN(RRR%tappendtMarktmarknametargstkwargsRR!RR
RR(R"tparametersettlegacy_force_tupletnewmarkstargval((s0/usr/lib/python2.7/site-packages/_pytest/mark.pytextract_from,s 

 c	C`s�t|ttf�s^g|jd�D]}|j�r%|j�^q%}t|�dk}nt}g|D]}tj|d|�^qk}~|s�t	|||�}|j
tdtft|�d|gdd��n||fS(Nt,iR,R#RR(
RRRtsplittstriptlentFalseRR/tget_empty_parameterset_markR&RR(	R"targnamest	argvaluestfunctiontconfigtxtforce_tuplet
parameterstmark((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyt_for_parametrizeMs4%	
(t__name__t
__module__tclassmethodR%R4R/R>(((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyRs cC`s�|jt�}|dkr'tj}n-|dkrHtjdt�}nt|��t|�\}}d||j	||f}|d|�S(Nttskiptxfailtruns0got empty parameter set %r, function %s at %s:%dtreason(RBNRC(
tgetinitEMPTY_PARAMETERSET_OPTIONRtMARK_GENRCRDR4tLookupErrorR	R?(R9R6R8trequested_markR=tfstlinenoRF((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyR5cstMarkerErrorcB`seZdZRS(s*Error in use of a pytest marker/attribute.(R?R@t__doc__(((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyRNqscO`stj||�S(N(RR%(R#R$((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyR%vscC`s�|jd�}|jdddddddd	d
dd�|jd
ddddddd	ddd�|jddddd�|jddd�|jtd�dS(Ntgenerals-ktactiontstoretdesttkeywordtdefaultRBtmetavart
EXPRESSIONthelpsSonly run tests which match the given substring expression. An expression is a python evaluatable expression where all names are substring-matched against test names and their parent classes. Example: -k 'test_method or test_other' matches all test functions and classes whose name contains 'test_method' or 'test_other', while -k 'not test_method' matches those that don't contain 'test_method' in their names. Additionally keywords are matched to classes and functions containing extra names in their 'extra_keyword_matches' set, as well as functions which have names assigned directly to them.s-mtmarkexprtMARKEXPRsRonly run tests matching given mark expression.  example: -m 'mark1 and not mark2'.s	--markerst
store_trues4show markers (builtin, plugin and per-project ones).tmarkerssmarkers for test functionstlinelists&default marker for empty parametersets(tgetgroupt
_addoptiont	addoptiontaddiniRH(tparsertgroup((s0/usr/lib/python2.7/site-packages/_pytest/mark.pytpytest_addoptionzs cC`s�ddl}|jjr�|j�|jj|�}x�|jd�D]r}|jdd�}|d}t|�dkr�|dnd}|j	d|dt
�|j|�|j�qDW|j�dSdS(	NiR\t:iiRBs@pytest.mark.%s:tbold(
t_pytest.configtoptionR\t
_do_configureR9tcreate_terminal_writerRGR1R3twritetTruetlinet_ensure_unconfigure(R9t_pytestttwRmtpartsRtrest((s0/usr/lib/python2.7/site-packages/_pytest/mark.pytpytest_cmdline_main�s

"

cC`s*|jjj�}|jj}|r0|r0dS|jd�rPd|d}nt}|ddkryt}|d }ng}g}x{|D]s}|r�t||�r�|j|�q�|r�d}n|r�t
||�s�|j|�q�q�n|j|�q�W|r&|jjd|�||(ndS(Nt-snot ii����Retitems(
RhRTtlstripRYt
startswithR4RltmatchkeywordR&Rt	matchmarkthooktpytest_deselected(RuR9tkeywordexprt	matchexprtselectuntilt	remainingt
deselectedtcolitem((s0/usr/lib/python2.7/site-packages/_pytest/mark.pytpytest_collection_modifyitems�s2

	
	tMarkMappingcB`s2eZdZej�Zed��Zd�ZRS(sfProvides a local mapping for markers where item access
    resolves to True if the marker is present. cC`s^t�}xH|j�D]:\}}t|t�s@t|t�r|j|�qqW||�S(N(R RuRtMarkInfoRtadd(R"tkeywordst
mark_namestkeytvalue((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyt
from_keywords�s
	cC`s
||jkS(N(town_mark_names(RR((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyt__getitem__�s(	R?R@ROtattrtibR�RAR�R�(((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyR��stKeywordMappingcB`s eZdZd�Zd�ZRS(swProvides a local mapping for keywords.
    Given a list of names, map any substring of one of these names to True.
    cC`s
||_dS(N(t_names(Rtnames((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyt__init__�scC`s(x!|jD]}||kr
tSq
WtS(N(R�RlR4(RtsubnameR((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyR��s(R?R@ROR�R�(((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyR��s	tortandtnotcC`st|itj|j��S(sBTries to match on any marker names, attached to the given colitem.(tevalR�R�R�(R�RY((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyRy�scC`s�t�}ddl}x9|j�D]+}t||j�s"|j|j�q"q"Wx!|j�D]}|j|�q^Wt|d�r�x$|j	j
D]}|j|�q�Wnt|�}d|kr�||S|jd�r�d|dkr�||dSxG|j
�D]9}tj|�r|tkrtdj|���qqWyt|i|�SWn&tk
r}tdj|���nXdS(	s|Tries to match given keyword expression to given collector item.

    Will match on the name of colitem, including the names of its parents.
    Only matches names of items which are either a :class:`Class` or a
    :class:`Function`.
    Additionally, matches on names in the 'extra_keyword_matches' set of
    any item, as well as names directly assigned to test functions.
    iNR8t snot is>Python keyword '{}' not accepted in expressions passed to '-k's#Wrong expression passed to '-k': {}(R tpytestt	listchainRtInstanceR�RtlistextrakeywordsthasattrR8t__dict__R�RwR1RTt	iskeywordtpython_keywords_allowed_listRtformatR�tSyntaxError(R�R|tmapped_namesR�titemRtmappingtkwd((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyRx�s,		

cC`s^tj|_|jjr$|t_n|jt�}|dkrZtdj	t|���ndS(NRCRDRBs2{!s} must be one of skip and xfail, but it is {!r}(RCRDNRB(
RIt_configt_old_mark_configRhtstrictRGRHRRR�(R9tempty_parameterset((s0/usr/lib/python2.7/site-packages/_pytest/mark.pytpytest_configure%scC`st|dd�t_dS(NR�(tgetattrRRIR�(R9((s0/usr/lib/python2.7/site-packages/_pytest/mark.pytpytest_unconfigure2st
MarkGeneratorcB`s&eZdZdZd�Zd�ZRS(s- Factory for :class:`MarkDecorator` objects - exposed as
    a ``pytest.mark`` singleton instance.  Example::

         import pytest
         @pytest.mark.slowtest
         def test_function():
            pass

    will set a 'slowtest' :class:`MarkInfo` object
    on the ``test_function`` object. cC`sT|ddkrtd��n|jdk	r>|j|�ntt|di��S(Nit_s*Marker name must NOT start with underscore((tAttributeErrorR�Rt_checkRR'(RR((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyt__getattr__Cs
cC`s�y||jkrdSWntk
r*nXt�|_}x_|jjd�D]K}|jdd�d}|j�}|jdd�d}|j|�qNW||jkr�td|f��ndS(NR\Reiit(s%r not a registered marker(t_markersR�R R�RGR1trstripR�(RRR#RmtmarkerR:((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyR�Js
N(R?R@RORR�R�R�(((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyR�6s
	cC`s%t|d�o$t|dd�dkS(Nt__call__R?s<lambda>(R�R�(tfunc((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyt
istestfuncZstfrozenR'cB`s5eZej�Zej�Zej�Zd�ZRS(cC`sD|j|jkst�t|j|j|jt|j|j��S(N(RR!R'R)tdictR*(Rtother((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyt
combined_withes(R?R@R�R�RR)R*R�(((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyR'_sRcB`s�eZdZejdejje��Ze	d�Z
e	d�Ze	d�Ze
d��Zd�Zd�Zd�Zd	�ZRS(
s� A decorator for test functions and test classes.  When applied
    it will create :class:`MarkInfo` objects which may be
    :ref:`retrieved by hooks as item keywords <excontrolskip>`.
    MarkDecorator instances are often created like this::

        mark1 = pytest.mark.NAME              # simple MarkDecorator
        mark2 = pytest.mark.NAME(name1=value) # parametrized MarkDecorator

    and can then be applied as decorators to test functions::

        @mark2
        def test_function():
            pass

    When a MarkDecorator instance is called it does the following:
      1. If called with a single class as its only positional argument and no
         additional keyword arguments, it attaches itself to the class so it
         gets applied automatically to all test cases found in that class.
      2. If called with a single function as its only positional argument and
         no additional keyword arguments, it attaches a MarkInfo object to the
         function, containing all the arguments already stored internally in
         the MarkDecorator.
      3. When called in any other case, it performs a 'fake construction' call,
         i.e. it returns a new MarkDecorator instance with the original
         MarkDecorator's content updated with the arguments passed to this
         call.

    Note: The rules above prevent MarkDecorator objects from storing only a
    single function or class reference as their positional argument with no
    additional keyword or positional arguments.

    t	validators	mark.names	mark.argssmark.kwargscC`s|jS(N(R(R((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyR(�scC`s#t|t�r|j|jkStS(N(RRR=R4(RR�((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyt__eq__�scC`sd|jfS(Ns<MarkDecorator %r>(R=(R((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyt__repr__�scO`s.t|j||�}|j|jj|��S(s� return a MarkDecorator with extra arguments added

        unlike call this can be used even if the sole argument is a callable/class

        :return: MarkDecorator
        (R'Rt	__class__R=R�(RR)R*R=((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyt	with_args�scO`s�|r�|r�|d}tj|�}t|�dkr�t|�sJ|r�|rct||j�n t||j�t||j�|Sn|j||�S(s� if passed a single callable argument: decorate it with mark info.
            otherwise add *args/**kwargs in-place to mark information. ii(tinspecttisclassR3R�t
store_markR=tstore_legacy_markinfoR�(RR)R*R�tis_class((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyR��s

$(R?R@ROR�R�t
validatorstinstance_ofR'R=RRR)R*RR(R�R�R�R�(((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyRls!			cC`sPt|dg�}t|t�s-|g}ng|D]}t|d|�^q4S(s?
    obtain the unpacked marks that are stored on a object
    t
pytestmarkR=(R�RR(tobjt	mark_listR=((s0/usr/lib/python2.7/site-packages/_pytest/mark.pytget_unpacked_marks�s
cC`s5t|t�st|��t|�|g|_dS(sfstore a Mark on a object
    this is used to implement the Mark declarations/decorators correctly
    N(RR'R!R�R�(R�R=((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyR��scC`s~t|t�s*tdjd|���nt||jd�}|dkrmt|�}t||j|�n
|j	|�dS(sFcreate the legacy MarkInfo objects and put them onto the function
    sgot {mark!r} instead of a MarkR=N(
RR't	TypeErrorR�R�RRR�tsetattrtadd_mark(R�R=tholder((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyR��sR�cB`sVeZdZd�Zed�Zed�Zed�Zd�Zd�Z	d�Z
RS(s= Marking object created by :class:`MarkDecorator` instances. cC`s:t|t�s!tt|���||_|g|_dS(N(RR'R!treprtcombinedt_marks(RR=((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyR��s!	s
combined.names
combined.argsscombined.kwargscC`sdj|j�S(Ns<MarkInfo {0!r}>(R�R�(R((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyR��scC`s)|jj|�|jj|�|_dS(s0 add a MarkInfo with the given args and kwargs. N(R�R&R�R�(RR=((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyR��scC`stt|j�S(s9 yield MarkInfo objects each relating to a marking-call. (RR�R�(R((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyt__iter__�s(R?R@ROR�RRR)R*R�R�R�(((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyR��s			cC`sMyt||j�}Wntk
r*tSX|j|jkoL|j|jkS(s� Returns True if :func: is already marked with :mark:, False otherwise.
    This can happen if marker is applied to class and the test file is
    invoked more than once.
    (R�RR�R4R)R*(R�R=t	func_mark((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyt_marked�s

cC`sQxJ||fD]<}x3t|�D]%}t||�s t||�q q Wq
WdS(s�
    this function transfers class level markers and module level markers
    into function level markinfo objects

    this is the main reason why marks are so broken
    the resolution will involve phasing out function level MarkInfo objects

    N(R�R�R�(tfuncobjR"tmodR�R=((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyttransfer_markerss	(7ROt
__future__RRRR�RTRR�tcollectionsRtoperatorRt	six.movesRRgRt
deprecatedRtcompatRR	RHRRRR5t	ExceptionRNR%RdRsRlttryfirstR�tstobjectR�R�R�RyRxR�R�R�R�R'RR�R�R�R�RIR�R�(((s0/usr/lib/python2.7/site-packages/_pytest/mark.pyt<module>sT
F			#			"			)	
	$		M