Ë
    æØjj�&  ã                  ó,  — d Z ddlmZ ddlZddlmZ ddlmZ ddlmZ ddl	Z	ddl
mZ dd	lmZ dd
lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z  ddl!m"Z" erddl#m$Z$ g d¢Z% e"edz     «       Z&dddœ	 	 	 	 	 	 	 d-d„Z'd.d„Z( ed ¬!«      d/d"„«       Z)e	jT                   G d#„ d$«      «       Z+d0d%„Z,e	jT                   G d&„ d'«      «       Z-d0d(„Z.d1d)„Z/d0d*„Z0d2d+„Z1d2d,„Z2y)3z=Generic mechanism for marking and selecting python functions.é    )ÚannotationsN)Ú
Collection)ÚIterable)ÚSet)ÚTYPE_CHECKINGé   )Ú
Expression)Ú_HiddenParam)ÚEMPTY_PARAMETERSET_OPTION)Úget_empty_parameterset_mark)ÚHIDDEN_PARAM)ÚMark)ÚMARK_GEN)ÚMarkDecorator)ÚMarkGenerator)ÚParameterSet)ÚNOTSET)ÚConfig)ÚExitCode)Úhookimpl)Ú
UsageError)ÚParser)ÚStashKey)ÚItem)r   r   r   r   r   r   r   © ©ÚmarksÚidc                ó.   — t        j                  || |dœŽS )a$  Specify a parameter in `pytest.mark.parametrize`_ calls or
    :ref:`parametrized fixtures <fixture-parametrize-marks>`.

    .. 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.

        :ref:`pytest.mark.usefixtures <pytest.mark.usefixtures ref>` cannot be added via this parameter.

    :type id: str | Literal[pytest.HIDDEN_PARAM] | None
    :param id:
        The id to attribute to this parameter set.

        .. versionadded:: 8.4
            :ref:`hidden-param` means to hide the parameter set
            from the test name. Can only be used at most 1 time, as
            test names need to be unique.
    r   )r   Úparam)r   r   Úvaluess      úW/opt/eval-harness/bench_task/venv/lib/python3.12/site-packages/_pytest/mark/__init__.pyr    r    1   s   € ôH ×Ñ˜v¨U°rÒ:Ð:ó    c                óü   — | j                  d«      }|j                  dddddd¬«       |j                  d	dd
ddd¬«       |j                  ddd¬«       | j                  ddd«       | j                  t        d«       y )NÚgeneralz-kÚstoreÚkeywordÚ Ú
EXPRESSIONa·  Only run tests which match the given substring expression. An expression is a Python evaluable 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.)ÚactionÚdestÚdefaultÚmetavarÚhelpz-mÚmarkexprÚMARKEXPRzUOnly 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.   Úmarkersz'Register new markers for test functionsÚlinelistz&Default marker for empty parametersets)ÚgetgroupÚ
_addoptionÚ	addoptionÚaddinir   )ÚparserÚgroups     r"   Úpytest_addoptionr:   X   sŸ   € Ø�O‰O˜IÓ&€EØ	×ÑØØØØØð,ð ô ð( 
×ÑØØØØØð1ð ô ð 
‡O�OØØØCð ô ð ‡M�M�)ÐFÈ
ÔSØ
‡M�MÔ+Ð-UÕVr#   T)Útryfirstc                ó¤  — dd l }| j                  j                  r¶| j                  «        |j                  j                  | «      }| j                  d«      D ]f  }|j                  dd«      }|d   }t        |«      dk(  r|d   nd}|j                  d|› d�d¬	«       |j                  |«       |j                  «        Œh | j                  «        yy )
Nr   r2   ú:r   é   r(   z@pytest.mark.T)Úbold)Ú_pytest.configÚoptionr2   Ú_do_configureÚconfigÚcreate_terminal_writerÚgetiniÚsplitÚlenÚwriteÚlineÚ_ensure_unconfigure)rC   Ú_pytestÚtwrI   ÚpartsÚnameÚrests          r"   Úpytest_cmdline_mainrP   ‚   s¹   € ãà‡}�}×ÒØ×ÑÔØ�^‰^×2Ñ2°6Ó:ˆØ—M‘M )Ó,ò 	ˆDØ—J‘J˜s AÓ&ˆEØ˜‘8ˆDÜ" 5›z¨Qš�5˜’8°BˆDØ�H‰H�} T F¨!Ð,°4ˆHÔ8Ø�G‰G�DŒMØ�G‰G�Ið	ð 	×"Ñ"Ô$Øàr#   c                  ó:   — e Zd ZU dZdZded<   edd„«       Zd	d„Zy)
ÚKeywordMatcheraÑ  A 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.
    )Ú_nameszAbstractSet[str]rS   c                ó  — t        «       }dd l}|j                  «       D ]k  }t        ||j                  «      rŒt        ||j
                  «      r!t        |j                  |j                  «      rŒQ|j                  |j                  «       Œm |j                  |j                  «       «       t        |dd «      }|r|j                  |j                  «       |j                  d„ |j                  «       D «       «        | |«      S )Nr   Úfunctionc              3  ó4   K  — | ]  }|j                   –— Œ y ­w©N)rN   )Ú.0Úmarks     r"   ú	<genexpr>z+KeywordMatcher.from_item.<locals>.<genexpr>Ä   s   è ø€ ÒF¨$˜DŸI�IÑFùs   ‚)ÚsetÚpytestÚ	listchainÚ
isinstanceÚSessionÚ	DirectoryÚparentÚaddrN   ÚupdateÚlistextrakeywordsÚgetattrÚ__dict__Úiter_markers)ÚclsÚitemÚmapped_namesr\   ÚnodeÚfunction_objs         r"   Ú	from_itemzKeywordMatcher.from_item©   sÚ   € ä“uˆó
 	à—N‘NÓ$ò 	(ˆDÜ˜$ §¡Ô/ØÜ˜$ × 0Ñ 0Ô1´jØ—‘˜VŸ^™^ô7ð Ø×Ñ˜TŸY™YÕ'ð	(ð 	×Ñ˜D×2Ñ2Ó4Ô5ô ˜t Z°Ó6ˆÙØ×Ñ × 5Ñ 5Ô6ð 	×ÑÑF°$×2CÑ2CÓ2EÔFÔFá�<Ó Ð r#   c               óz   ‡— |rt        d«      ‚‰j                  «       Št        ˆfd„| j                  D «       «      S )Nz3Keyword expressions do not support call parameters.c              3  óB   •K  — | ]  }‰|j                  «       v –— Œ y ­wrW   )Úlower)rX   rN   Úsubnames     €r"   rZ   z*KeywordMatcher.__call__.<locals>.<genexpr>Ì   s   øè ø€ ÒC¨t�7˜dŸj™j›lÔ*ÑCùs   ƒ)r   rp   ÚanyrS   )Úselfrq   Úkwargss    ` r"   Ú__call__zKeywordMatcher.__call__È   s2   ø€ ÙÜÐRÓSÐSØ—-‘-“/ˆÜÓC°t·{±{ÔCÓCÐCr#   N)ri   r   ÚreturnrR   )rq   Ústrrt   ústr | int | bool | Nonerv   Úbool)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú	__slots__Ú__annotations__Úclassmethodrm   ru   r   r#   r"   rR   rR   –   s,   … ñð €IàÓàò!ó ð!ô<Dr#   rR   c                óV  — |j                   j                  j                  «       }|sy t        |d«      }g }g }| D ]I  }|j	                  t
        j                  |«      «      s|j                  |«       Œ9|j                  |«       ŒK |r"|j                  j                  |¬«       || d d  y y )NzWrong expression passed to '-k'©Úitems)
rA   r'   ÚlstripÚ_parse_expressionÚevaluaterR   rm   ÚappendÚhookÚpytest_deselected)rƒ   rC   ÚkeywordexprÚexprÚ	remainingÚ
deselectedÚcolitems          r"   Údeselect_by_keywordr�   Ï   s¡   € Ø—-‘-×'Ñ'×.Ñ.Ó0€KÙØä˜[Ð*KÓL€Dà€IØ€JØò &ˆØ�}‰}œ^×5Ñ5°gÓ>Ô?Ø×Ñ˜gÕ&à×Ñ˜WÕ%ð	&ñ Ø�‰×%Ñ%¨JÐ%Ô7Øˆ‰a‰ð r#   c                  ó:   — e Zd ZU dZdZded<   edd„«       Zd	d„Zy)
ÚMarkMatcherzuA matcher for markers which are present.

    Tries to match on any marker names, attached to the given colitem.
    )Úown_mark_name_mappingzdict[str, list[Mark]]r’   c                óŽ   — t        j                  t        «      }|D ]   }||j                     j	                  |«       Œ"  | |«      S rW   )ÚcollectionsÚdefaultdictÚlistrN   r‡   )rh   r2   Úmark_name_mappingrY   s       r"   Úfrom_markerszMarkMatcher.from_markersî   sE   € ä'×3Ñ3´DÓ9ÐØò 	6ˆDØ˜dŸi™iÑ(×/Ñ/°Õ5ð	6áÐ$Ó%Ð%r#   c               óš   ‡— | j                   j                  |g «      x}sy|D ]&  Št        ˆfd„|j                  «       D «       «      sŒ& y y)NFc              3  ój   •K  — | ]*  \  }}‰j                   j                  |t        «      |k(  –— Œ, y ­wrW   )rt   Úgetr   )rX   ÚkÚvrY   s      €r"   rZ   z'MarkMatcher.__call__.<locals>.<genexpr>ú   s)   øè ø€ ÒN±t°q¸!�4—;‘;—?‘? 1¤fÓ-°Õ2ÑNùs   ƒ03T)r’   r›   Úallrƒ   )rs   rN   rt   ÚmatchesrY   s       @r"   ru   zMarkMatcher.__call__õ   sO   ø€ Ø×5Ñ5×9Ñ9¸$ÀÓCÐC�ÐCØàò 	ˆDÜÓN¸v¿|¹|»~ÔNÕNÙð	ð r#   N)r2   zIterable[Mark]rv   r‘   )rN   rw   rt   rx   rv   ry   )	rz   r{   r|   r}   r~   r   r€   r˜   ru   r   r#   r"   r‘   r‘   ã   s+   … ñð
 +€Ià0Ó0àò&ó ð&ôr#   r‘   c                óV  — |j                   j                  }|sy t        |d«      }g }g }| D ]W  }|j                  t        j                  |j                  «       «      «      r|j                  |«       ŒG|j                  |«       ŒY |r"|j                  j                  |¬«       || d d  y y )NzWrong expression passed to '-m'r‚   )
rA   r/   r…   r†   r‘   r˜   rg   r‡   rˆ   r‰   )rƒ   rC   Ú	matchexprr‹   rŒ   r�   ri   s          r"   Údeselect_by_markr¢   ÿ   s¡   € Ø—‘×&Ñ&€IÙØä˜YÐ(IÓJ€DØ€IØ€JØò $ˆØ�=‰=œ×1Ñ1°$×2CÑ2CÓ2EÓFÔGØ×Ñ˜TÕ"à×Ñ˜dÕ#ð	$ñ
 Ø�‰×%Ñ%¨JÐ%Ô7Øˆ‰a‰ð r#   c           
     óº   — 	 t        j                  | «      S # t        $ r:}t        |› d|j                  › d|j
                  › d|j                  › �«      d ‚d }~ww xY w)Nz: z: at column )r	   ÚcompileÚSyntaxErrorr   ÚtextÚoffsetÚmsg)r‹   Úexc_messageÚes      r"   r…   r…     s^   € ðÜ×!Ñ! $Ó'Ð'øÜò ÜØˆm˜2˜aŸf™f˜X \°!·(±(°¸2¸a¿e¹e¸WÐEó
àð	ûðús   ‚ —	A 5AÁAc                ó4   — t        | |«       t        | |«       y rW   )r�   r¢   )rƒ   rC   s     r"   Úpytest_collection_modifyitemsr¬     s   € Ü˜˜vÔ&Ü�U˜FÕ#r#   c                ó¶   — t         j                  | j                  t        <   | t         _        | j	                  t
        «      }|dvrt        t
        ›d|›�«      ‚y )N)ÚskipÚxfailÚfail_at_collectNr(   z9 must be one of skip, xfail or fail_at_collect but it is )r   Ú_configÚstashÚold_mark_config_keyrE   r   r   )rC   Úempty_parametersets     r"   Úpytest_configurerµ     sa   € Ü(0×(8Ñ(8€F‡L�LÔ$Ñ%Ø„HÔàŸ™Ô'@ÓAÐàÐ!OÑOÜÜ(Ð+ð ,Ø,Ð/ð1ó
ð 	
ð Pr#   c                óV   — | j                   j                  t        d «      t        _        y rW   )r²   r›   r³   r   r±   )rC   s    r"   Úpytest_unconfigurer·   ,  s   € Ø—|‘|×'Ñ'Ô(;¸TÓB„HÕr#   )r!   Úobjectr   z0MarkDecorator | Collection[MarkDecorator | Mark]r   zstr | _HiddenParam | Nonerv   r   )r8   r   rv   ÚNone)rC   r   rv   zint | ExitCode | None)rƒ   z
list[Item]rC   r   rv   r¹   )r‹   rw   r©   rw   rv   r	   )rC   r   rv   r¹   )3r}   Ú
__future__r   r”   Úcollections.abcr   r   r   ÚAbstractSetÚdataclassesÚtypingr   Ú
expressionr	   Ú
structuresr
   r   r   r   r   r   r   r   r   Ú_pytest.compatr   r@   r   r   r   r   Ú_pytest.config.argparsingr   Ú_pytest.stashr   Ú_pytest.nodesr   Ú__all__r³   r    r:   rP   Ú	dataclassrR   r�   r‘   r¢   r…   r¬   rµ   r·   r   r#   r"   ú<module>rÇ      s)  ðÙ Cå "ã Ý &Ý $Ý .Û Ý  å "Ý $Ý 1Ý 3Ý $Ý Ý  Ý %Ý %Ý $Ý !Ý !Ý #Ý #Ý %Ý ,Ý "ñ Ý"ò€ð .�h˜v¨™}Ñ-Ó/Ð ð
 ?AØ$(ñ$;Øð$;à;ð$;ð 	"ð$;ð ó	$;óN'WñT 
�4Ôòó ðð& ×Ñ÷5Dð 5Dó ð5Dópð( ×Ñ÷ð ó ðó6ó$ó$ó


ôCr#   