bg! dZddlZddlmZddlmZddlmZddlmZddlmZddlmZd d l m Z d d l m Z d d l m Z d d l mZd dl mZd dl mZd dl mZd dl mZd dl mZddlmZddlmZddlmZddlmZddlmZddlmZerddlmZgdZeeeZ dddde!deeeeeeffdee"d efd!Z#d"ed dfd#Z$ed$%d&ed eee%effd'Z&ej'Gd(d)Z(d*d+d&ed dfd,Z)ej'Gd-d.Z*d*d+d&ed dfd/Z+d0e"d1e"d e fd2Z,d*d+d&ed dfd3Z-d&ed dfd4Z.d&ed dfd5Z/dS)6z=Generic mechanism for marking and selecting python functions.N) AbstractSet) Collection)List)Optional) TYPE_CHECKING)Union) Expression) ParseError)EMPTY_PARAMETERSET_OPTION)get_empty_parameterset_mark)Mark)MARK_GEN) MarkDecorator) MarkGenerator) ParameterSet)Config)ExitCode)hookimpl) UsageError)Parser)StashKey)Item)rrrrrr marksidvaluesrrreturnc&tj|||dS)aSpecify a parameter in `pytest.mark.parametrize`_ calls or :ref:`parametrized fixtures `. .. code-block:: python @pytest.mark.parametrize( "test_input,expected", [ ("3+5", 8), pytest.param("6*9", 42, marks=pytest.mark.xfail), ], ) def test_eval(test_input, expected): assert eval(test_input) == expected :param values: Variable args of the values of the parameter set, in order. :param marks: A single mark or a list of marks to be applied to this parameter set. :param id: The id to attribute to this parameter set. r)rparam)rrrs f/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/_pytest/mark/__init__.pyr!r!+s0  vUr : : ::parserc0|d}|dddddd|d dd dd d |d dd|ddd|tddS)Ngeneralz-kstorekeyword EXPRESSIONaOnly 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. -k 'not test_method and not test_other' will eliminate the matches. 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. The matching is case-insensitive.)actiondestdefaultmetavarhelpz-mmarkexprMARKEXPRzUOnly run tests matching given mark expression. For example: -m 'mark1 and not mark2'.z --markers store_truez4show markers (builtin, plugin and per-project ones).)r+r/markerszMarkers for test functionslinelistz&Default marker for empty parametersets)getgroup _addoption addoptionaddinir )r$groups r"pytest_addoptionr:Fs OOI & &E    , (   1  OO C  MM)9:FFF MM+-UVVVVVr#T)tryfirstconfigcddl}|jjr||j|}|dD]}|dd}|d}t|dkr|dnd}| d|zd | || | dSdS) Nrr3:r r)z@pytest.mark.%s:T)bold) _pytest.configoptionr3 _do_configurer<create_terminal_writergetinisplitlenwriteline_ensure_unconfigure)r<_pytesttwrIpartsnamerests r"pytest_cmdline_mainrPps }  ^ 2 26 : :MM),,  DJJsA&&E8D"5zzQ588BD HH'$.TH : : : GGDMMM GGIIII""$$$q 4r#cVeZdZUdZdZeeed<ed dZ dede fd Z d S) KeywordMatcheraA matcher for keywords. Given a list of names, matches any substring of one of these names. The string inclusion check is case-insensitive. 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. )_namesrSitemrrct}ddl}|D]1}t||js||j2||t|dd}|r||j |d| D||S)Nrfunctionc3$K|] }|jV dSNrN.0marks r" z+KeywordMatcher.from_item..s$FF$DIFFFFFFr#) setpytest listchain isinstanceSessionaddrNupdatelistextrakeywordsgetattr__dict__ iter_markers)clsrT mapped_namesr_node function_objs r" from_itemzKeywordMatcher.from_itemsuu   NN$$ , ,DdFN33 ,  +++ D2244555tZ66  7    5 6 6 6 FF$2C2C2E2EFFFFFFs<   r#subnamech|}d|jD}|D] }||vrdS dS)Nc3>K|]}|VdSrX)lower)r[rNs r"r]z*KeywordMatcher.__call__..s*66$666666r#TF)rqrS)selfrnnamesrNs r"__call__zKeywordMatcher.__call__sM--//66$+666  D$ttur#N)rTrrrR __name__ __module__ __qualname____doc__ __slots__rstr__annotations__ classmethodrmboolrtrr#r"rRrRsx  I  !!![!.r#rRitemsz List[Item]cx|jj}|sdSt|d}g}g}|D]Z}|t |s||E||[|r$|j |||dd<dSdS)NzWrong expression passed to '-k'r) rBr(lstrip_parse_expressionevaluaterRrmappendhookpytest_deselected)rr< keywordexprexpr remaining deselectedcolitems r"deselect_by_keywordrs-'..00K  [*K L LDIJ&&}}^55g>>?? &   g & & & &   W % % % % %%J%777aaar#cVeZdZUdZdZeeed<ed dZ dede fd Z d S) MarkMatcherzuA matcher for markers which are present. Tries to match on any marker names, attached to the given colitem. own_mark_namesrrTrrcTd|D}||S)Nch|] }|j SrrYrZs r" z(MarkMatcher.from_item..s@@@Ddi@@@r#)rh)rirT mark_namess r"rmzMarkMatcher.from_items/@@D,=,=,?,?@@@ s:r#rNc||jvSrXr)rrrNs r"rtzMarkMatcher.__call__st***r#N)rTrrrrurr#r"rrsx $I$$$$[+S+T++++++r#rcT|jj}|sdSt|d}g}g}|D]Z}|t|r||E||[|r$|j|||dd<dSdS)NzWrong expression passed to '-m'r) rBr0rrrrmrrr)rr< matchexprrrrrTs r"deselect_by_markrs &I  Y(I J JDIJ$$ ==..t44 5 5 $   T " " " "   d # # # # %%J%777aaar#r exc_messagec tj|S#t$r}t|d|d|dd}~wwxYw)Nz: )r compiler r)rres r"rrsbB!$''' BBBK6646616677TABs =8=cFt||t||dSrX)rr)rr<s r"pytest_collection_modifyitemsrs(v&&&UF#####r#ctj|jt<|t_|t }|dvr(t dt |dS)N)skipxfailfail_at_collectNr)zA{!s} must be one of skip, xfail or fail_at_collect but it is {!r})r_configstashold_mark_config_keyrEr rformat)r<empty_parametersets r"pytest_configurersj(0(8FL$%H'@AA!OOO $f%>@RSS   POr#cZ|jtdt_dSrX)rgetrrr)r<s r"pytest_unconfigurer s#|''(;TBBHr#)0ry dataclassestypingrrrrrr expressionr r structuresr r rrrrrrArrrr_pytest.config.argparsingr _pytest.stashr _pytest.nodesr__all__robjectr{r!r:intrP dataclassrRrrrrrrrrr#r"rs$CC """"""""""""111111333333 %%%%%%%%%%%%$$$$$$!!!!!!############%%%%%%,,,,,,""""""#""""""   1hx/022 KM;;; ;  51D+E FF G;  ; ;;;;6'WV'W'W'W'W'WT 48E#x-4H+I& 11111111h|V( ++++++++&L&T$BCBcBjBBBB$$v$$$$$$  V       CvC$CCCCCCr#