§
    ×Ž’je+  ã                  ó\  — d Z ddlmZ ddlmZ ddlmZ ddlZddlZddlZddl	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„Z!d;d„Z"d<d"„Z# ej$        d#¬$¦  «         G d%„ d&¦  «        ¦   «         Z%d=d(„Z& ej$        d#¬$¦  «         G d)„ d*¦  «        ¦   «         Z'd>d,„Z( e e'dz           ¦   «         Z) ed#¬-¦  «        d?d.„¦   «         Z* ed#¬/¦  «        d@d1„¦   «         Z+ ed#¬/¦  «        dAd5„¦   «         Z,dBd9„Z-dS )Cz-Support for skip/xfail functions and markers.é    )Úannotations)Ú	Generator)ÚMappingN)ÚConfig)Úhookimpl)ÚParser)ÚMark)ÚItem)Úfail)Úskip)Úxfail)ÚAbstractRaises)Ú
BaseReport)Ú
TestReport)ÚCallInfo)ÚStashKeyÚparserr   ÚreturnÚNonec                óš   — |                       d¦  «        }|                     ddddd¬¦  «         |                      dd	d
d dg¬¦  «         d S )NÚgeneralz
--runxfailÚ
store_trueÚrunxfailFz<Report the results of xfail tests as if they were not marked)ÚactionÚdestÚdefaultÚhelpÚstrict_xfailzrDefault for the strict parameter of xfail markers when not given explicitly (default: False) (alias: xfail_strict)ÚboolÚxfail_strict)Útyper   Úaliases)ÚgetgroupÚ	addoptionÚaddini)r   Úgroups     ú>C:\Projects\DSCons\.venv\Lib\site-packages\_pytest\skipping.pyÚpytest_addoptionr(      sy   € Ø�OŠO˜IÑ&Ô&€EØ	‡O‚OØØØØØKð ñ ô ð ð ‡M‚MØð	SààØÐ ð ñ ô ð ð ð ó    Úconfigr   c                ó8  ‡‡— | j         j        rIdd lŠ‰j        Š|                      ˆˆfd„¦  «         d„ }t          j        |_        t          ‰d|¦  «         |                      dd¦  «         |                      dd¦  «         |                      dd¦  «         d S )	Nr   c                 ó&   •— t          ‰d‰ ¦  «        S )Nr   )Úsetattr)ÚoldÚpytests   €€r'   ú<lambda>z"pytest_configure.<locals>.<lambda>8   s   ø€ ¥7¨6°7¸CÑ#@Ô#@€ r)   c                 ó   — d S )N© )ÚargsÚkwargss     r'   Únopzpytest_configure.<locals>.nop:   s   € ØˆDr)   r   Úmarkersz‘skip(reason=None): skip the given test function with an optional reason. Example: skip(reason="no way of currently testing this") skips the test.a  skipif(condition, ..., *, reason=...): skip the given test function if any of the conditions evaluate to True. Example: skipif(sys.platform == 'win32') skips the test if we are on the win32 platform. See https://docs.pytest.org/en/stable/reference/reference.html#pytest-mark-skipifa  xfail(condition, ..., *, reason=..., run=True, raises=None, strict=strict_xfail): mark the test function as an expected failure if any of the conditions evaluate to True. Optionally specify a reason for better reporting and run=False if you don't even want to execute the test function. If only specific exception(s) are expected, you can list them in raises, and if the test fails in other ways, it will be reported as a true failure. See https://docs.pytest.org/en/stable/reference/reference.html#pytest-mark-xfail)Úoptionr   r/   r   Úadd_cleanupÚ	Exceptionr-   Úaddinivalue_line)r*   r5   r.   r/   s     @@r'   Úpytest_configurer;   2   sÞ   øø€ Ø„}Ôð &àˆˆˆàŒlˆØ×ÒÐ@Ð@Ð@Ð@Ð@ÑAÔAÐAð	ð 	ð 	õ œˆŒÝ�˜ Ñ%Ô%Ð%à
×ÒØð	ñô ð ð ×ÒØð	\ñô ð ð ×ÒØð	kñ	ô 	ð 	ð 	ð 	r)   Úitemr
   Úmarkr	   Ú	conditionÚobjectútuple[bool, str]c                óô  — t          |t          ¦  «        �rœt          t          t          | j        dœ}t          | j                             | j        ¬¦  «        ¦  «        D ]>}t          |t          ¦  «        st          d|›�¦  «        ‚|                     |¦  «         Œ?t          | d¦  «        r|                     | j        j        ¦  «         	 d|j        › d�}t!          ||d¦  «        }t#          ||¦  «        }�n## t$          $ rP}d|j        ›d	�d
|z   d
d|j        pdz  z   dz   dg}	t)          d                     |	¦  «        d¬¦  «         Y d}~nÎd}~wt,          $ rR}d|j        ›d	�d
|z   gt/          j        |¦  «        ¢}	t)          d                     |	¦  «        d¬¦  «         Y d}~ntd}~ww xY w	 t3          |¦  «        }n[# t,          $ rN}d|j        ›d�gt/          j        |¦  «        ¢}	t)          d                     |	¦  «        d¬¦  «         Y d}~nd}~ww xY w|j                             dd¦  «        }
|
€:t          |t          ¦  «        rd|z   }
nd|j        ›d�dz   }t)          |d¬¦  «         ||
fS )a.  Evaluate a single skipif/xfail condition.

    If an old-style string condition is given, it is eval()'d, otherwise the
    condition is bool()'d. If this fails, an appropriately formatted pytest.fail
    is raised.

    Returns (result, reason). The reason is only relevant if the result is True.
    )ÚosÚsysÚplatformr*   )r*   z8pytest_markeval_namespace() needs to return a dict, got Úobjú<z condition>ÚevalzError evaluating z
 conditionz    ú r   ú^zSyntaxError: invalid syntaxú
F)ÚpytraceNz condition as a booleanÚreasonzcondition: z: zDyou need to specify reason=STRING when using booleans as conditions.)Ú
isinstanceÚstrrB   rC   rD   r*   ÚreversedÚihookÚpytest_markeval_namespacer   Ú
ValueErrorÚupdateÚhasattrrE   Ú__globals__ÚnameÚcompilerG   ÚSyntaxErrorÚoffsetr   Újoinr9   Ú	tracebackÚformat_exception_onlyr   r4   Úget)r<   r=   r>   Úglobals_Ú
dictionaryÚfilenameÚcondition_codeÚresultÚexcÚmsglinesrL   Úmsgs               r'   Úevaluate_conditionrf   Y   s  € õ �)�SÑ!Ô!ñ .5åÝÝ Ø”kð	
ð 
ˆõ #ØŒJ×0Ò0¸¼Ð0ÑDÔDñ
ô 
ð 	(ð 	(ˆJõ ˜j­'Ñ2Ô2ð Ý Ø]ÈzÐ]Ð]ñô ð ð �OŠO˜JÑ'Ô'Ð'Ð'Ý�4˜ÑÔð 	2Ø�OŠO˜DœHÔ0Ñ1Ô1Ð1ð	5Ø1˜4œ9Ð1Ð1Ð1ˆHÝ$ Y°¸&ÑAÔAˆNÝ˜.¨(Ñ3Ô3ˆF‰FøÝð 	5ð 	5ð 	5à; D¤IÐ;Ð;Ð;Ø˜Ñ"Ø˜ ¤
 ¨aÑ0Ñ0°3Ñ6Ø-ð	ˆHõ �—’˜8Ñ$Ô$¨eÐ4Ñ4Ô4Ð4Ð4Ð4Ð4Ð4Ð4øøøøÝð 	5ð 	5ð 	5à; D¤IÐ;Ð;Ð;Ø˜Ñ"ðõ Ô0°Ñ5Ô5ðˆHõ
 �—’˜8Ñ$Ô$¨eÐ4Ñ4Ô4Ð4Ð4Ð4Ð4Ð4Ð4øøøøð	5øøøð	5Ý˜)‘_”_ˆFˆFøÝð 	5ð 	5ð 	5àH D¤IÐHÐHÐHðåÔ0°Ñ5Ô5ðˆHõ �—’˜8Ñ$Ô$¨eÐ4Ñ4Ô4Ð4Ð4Ð4Ð4Ð4Ð4øøøøð	5øøøð Œ[�_Š_˜X tÑ,Ô,€FØ€~Ý�i¥Ñ%Ô%ð 	%Ø" YÑ.ˆFˆFð 4 D¤IÐ3Ð3Ð3ØXñYð õ �˜eÐ$Ñ$Ô$Ð$à�6ˆ>Ðs?   Ã,C< Ã<
F0ÄAEÅF0ÅAF+Æ+F0Æ4G Ç
HÇAHÈHT)Úfrozenc                  ó"   — e Zd ZU dZdZded<   dS )ÚSkipz$The result of evaluate_skip_marks().zunconditional skiprN   rL   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rL   Ú__annotations__r2   r)   r'   ri   ri   ¢   s)   € € € € € € à.Ð.à&€FÐ&Ð&Ð&Ñ&Ð&Ð&r)   ri   úSkip | Nonec                óô  — |                       d¬¦  «        D ]}}d|j        vr|j        }n|j        d         f}|s,|j                             dd¦  «        }t	          |¦  «        c S |D ]+}t          | ||¦  «        \  }}|rt	          |¦  «        c c S Œ,Œ~|                       d¬¦  «        D ]L}	 t	          |j        i |j        ¤Žc S # t          $ r%}t          t          |¦  «        dz   ¦  «        d‚d}~ww xY wdS )	zDEvaluate skip and skipif marks on item, returning Skip if triggered.Úskipif©rV   r>   rL   Ú r   z& - maybe you meant pytest.mark.skipif?N)Úiter_markersr4   r3   r]   ri   rf   Ú	TypeErrorrN   )r<   r=   Ú
conditionsrL   r>   rb   Úes          r'   Úevaluate_skip_marksrx   ©   sV  € à×!Ò! xÐ!Ñ0Ô0ð $ð $ˆØ˜dœkÐ)Ð)ØœˆJˆJàœ+ kÔ2Ð4ˆJð ð 	 Ø”[—_’_ X¨rÑ2Ô2ˆFÝ˜‘<”<ÐÐÐð $ð 	$ð 	$ˆIÝ/°°d¸IÑFÔF‰NˆF�FØð $Ý˜F‘|”|Ð#Ð#Ð#Ð#Ð#ð$ð	$ð
 ×!Ò! vÐ!Ñ.Ô.ð Yð Yˆð	YÝ˜œÐ2 d¤kÐ2Ð2Ð2Ð2Ð2øÝð 	Yð 	Yð 	YÝ�C ™FœFÐ%MÑMÑNÔNÐTXÐXøøøøð	Yøøøð ˆ4s   Â.CÃ
C5Ã C0Ã0C5c                  ó@   — e Zd ZU dZdZded<   ded<   ded<   ded	<   d
S )ÚXfailz%The result of evaluate_xfail_marks().)ÚraisesrL   ÚrunÚstrictrN   rL   r   r|   r}   z\type[BaseException] | tuple[type[BaseException], ...] | AbstractRaises[BaseException] | Noner{   N)rj   rk   rl   rm   Ú	__slots__rn   r2   r)   r'   rz   rz   Å   sP   € € € € € € à/Ð/à5€Ià€K€K�KØ€I€I�IØ€L€L�Lðð ð ñ ð ð r)   rz   úXfail | Nonec                óN  — |                       d¬¦  «        D �]}|j                             dd¦  «        }|j                             d¦  «        }|€| j                             d¦  «        }|€| j                             d¦  «        }|j                             dd¦  «        }d	|j        vr|j        }n|j        d	         f}|s/|j                             d
d¦  «        }t          ||||¦  «        c S |D ].}t          | ||¦  «        \  }}|rt          ||||¦  «        c c S Œ/�ŒdS )z;Evaluate xfail marks on item, returning Xfail if triggered.r   rr   r|   Tr}   Nr   r{   r>   rL   rs   )rt   r4   r]   r*   Úgetinir3   rz   rf   )	r<   r=   r|   r}   r{   rv   rL   r>   rb   s	            r'   Úevaluate_xfail_marksr‚   Ö   sP  € à×!Ò! wÐ!Ñ/Ô/ð :ñ :ˆØŒk�oŠo˜e TÑ*Ô*ˆØ”—’ Ñ*Ô*ˆØˆ>Ø”[×'Ò'¨Ñ7Ô7ˆFØˆ>Ø”[×'Ò'¨Ñ1Ô1ˆFØ”—’ ¨4Ñ0Ô0ˆØ˜dœkÐ)Ð)ØœˆJˆJàœ+ kÔ2Ð4ˆJð ð 	6Ø”[—_’_ X¨rÑ2Ô2ˆFÝ˜  f¨fÑ5Ô5Ð5Ð5Ð5ð $ð 	:ð 	:ˆIÝ/°°d¸IÑFÔF‰NˆF�FØð :Ý˜V S¨&°&Ñ9Ô9Ð9Ð9Ð9Ð9Ð9ð:ñ	:ð
 ˆ4r)   )Útryfirstc                ó  — t          | ¦  «        }|rt          j        |j        d¬¦  «        ‚t	          | ¦  «        x| j        t          <   }|r1| j        j        j	        s"|j
        st          d|j        z   ¦  «         d S d S d S d S )NT)Ú_use_item_locationú	[NOTRUN] )rx   r   r9   rL   r‚   ÚstashÚxfailed_keyr*   r7   r   r|   r   )r<   ÚskippedÚxfaileds      r'   Úpytest_runtest_setupr‹   ÷   s¡   € å! $Ñ'Ô'€GØð FÝŒn˜Wœ^ÀÐEÑEÔEÐEå(<¸TÑ(BÔ(BÐB€D„J�{Ñ˜gØð ,�t”{Ô)Ô2ð ,¸7¼;ð ,Ýˆk˜GœNÑ*Ñ+Ô+Ð+Ð+Ð+ð,ð ,ð ,ð ,ð ,ð ,r)   )ÚwrapperúGenerator[None]c              #  óþ  K  — | j                              t          d ¦  «        }|€t          | ¦  «        x| j         t          <   }|r/| j        j        j        s|j        st          d|j	        z   ¦  «         	 d V —| j                              t          d ¦  «        }|€t          | ¦  «        x| j         t          <   }S S # | j                              t          d ¦  «        }|€t          | ¦  «        x| j         t          <   }w xY w)Nr†   )
r‡   r]   rˆ   r‚   r*   r7   r   r|   r   rL   )r<   rŠ   s     r'   Úpytest_runtest_callr�     sù   è è € àŒj�nŠn�[¨$Ñ/Ô/€GØ€Ý,@ÀÑ,FÔ,FÐFˆŒ
•;Ñ 'àð ,�t”{Ô)Ô2ð ,¸7¼;ð ,Ýˆk˜GœNÑ*Ñ+Ô+Ð+ðKØ��ð ”*—.’.¥¨dÑ3Ô3ˆØˆ?Ý0DÀTÑ0JÔ0JÐJˆDŒJ•{Ñ# g gð øð ”*—.’.¥¨dÑ3Ô3ˆØˆ?Ý0DÀTÑ0JÔ0JÐJˆDŒJ•{Ñ# gÐJÐJÐJÐJs   Á5B: Â:AC<ÚcallúCallInfo[None]ú'Generator[None, TestReport, TestReport]c              #  óè  K  — d V —}| j                              t          d ¦  «        }| j        j        j        r�n8|j        rUt          |j        j        t          j
        ¦  «        r1|j        j        j        €J ‚|j        j        j        |_        d|_        nÜ|j        sÕ|rÓ|j        r�|j        }|�kt          |t           t"          z  ¦  «        rt          |j        j        |¦  «        s4t          |t$          ¦  «        r3|                     |j        j        ¦  «        rd|_        |j        |_        nDd|_        n<|j        dk    r1|j        rd|_        d|j        z   |_        nd|_        |j        |_        |S )Nr‰   Úfailedr�   z[XPASS(strict)] Úpassed)r‡   r]   rˆ   r*   r7   r   ÚexcinforM   Úvaluer   r9   re   ÚwasxfailÚoutcomer‰   r{   r!   Útupler   ÚmatchesrL   Úwhenr}   Úlongrepr)r<   r�   ÚreprŠ   r{   s        r'   Úpytest_runtest_makereportrŸ     sl  è è € ð ˆ%ˆ%€CØŒj�nŠn�[¨$Ñ/Ô/€GØ„{ÔÔ"ð .ÙØ	Œð .�* T¤\Ô%7½¼ÑIÔIð .ØŒ|Ô!Ô%Ð1Ð1Ð1Ø”|Ô)Ô-ˆŒØˆŒˆØŒ[ð .˜Wð .ØŒ<ð 	.Ø”^ˆFØˆ~å˜v¥t­e¡|Ñ4Ô4ð õ # 4¤<Ô#5°vÑ>Ô>ð õ ˜v¥~Ñ6Ô6ð ð Ÿš t¤|Ô'9Ñ:Ô:ð ð (�”Ø&œ~�”�à&�”�ØŒY˜&Ò Ð ØŒ~ð .Ø&�”Ø1°G´NÑB�”�à&�”Ø&œ~�”Ø€Jr)   Úreportr   útuple[str, str, str] | Nonec                óJ   — t          | d¦  «        r| j        rdS | j        rdS d S )Nr˜   )rŠ   ÚxÚXFAIL)ÚxpassedÚXÚXPASS)rT   r‰   r•   )r    s    r'   Úpytest_report_teststatusr¨   ;  s9   € Ýˆv�zÑ"Ô"ð +ØŒ>ð 	+Ø*Ð*ØŒ]ð 	+Ø*Ð*Øˆ4r)   )r   r   r   r   )r*   r   r   r   )r<   r
   r=   r	   r>   r?   r   r@   )r<   r
   r   ro   )r<   r
   r   r   )r<   r
   r   r   )r<   r
   r   r�   )r<   r
   r�   r‘   r   r’   )r    r   r   r¡   ).rm   Ú
__future__r   Úcollections.abcr   r   ÚdataclassesrB   rD   rC   r[   Ú_pytest.configr   r   Ú_pytest.config.argparsingr   Ú_pytest.mark.structuresr	   Ú_pytest.nodesr
   Ú_pytest.outcomesr   r   r   Ú_pytest.raisesr   Ú_pytest.reportsr   r   Ú_pytest.runnerr   Ú_pytest.stashr   r(   r;   rf   Ú	dataclassri   rx   rz   r‚   rˆ   r‹   r�   rŸ   r¨   r2   r)   r'   ú<module>r¶      s  ðà 3Ð 3à "Ð "Ð "Ð "Ð "Ð "à %Ð %Ð %Ð %Ð %Ð %Ø #Ð #Ð #Ð #Ð #Ð #Ø Ð Ð Ð Ø 	€	€	€	Ø €€€Ø 
€
€
€
Ø Ð Ð Ð à !Ð !Ð !Ð !Ð !Ð !Ø #Ð #Ð #Ð #Ð #Ð #Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ø (Ð (Ð (Ð (Ð (Ð (Ø Ð Ð Ð Ð Ð Ø !Ð !Ð !Ð !Ð !Ð !Ø !Ð !Ð !Ð !Ð !Ð !Ø "Ð "Ð "Ð "Ð "Ð "Ø )Ð )Ð )Ð )Ð )Ð )Ø &Ð &Ð &Ð &Ð &Ð &Ø &Ð &Ð &Ð &Ð &Ð &Ø #Ð #Ð #Ð #Ð #Ð #Ø "Ð "Ð "Ð "Ð "Ð "ðð ð ð ð*$ð $ð $ð $ðNFð Fð Fð FðR €Ô˜dÐ#Ñ#Ô#ð'ð 'ð 'ð 'ð 'ñ 'ô 'ñ $Ô#ð'ðð ð ð ð8 €Ô˜dÐ#Ñ#Ô#ðð ð ð ð ñ ô ñ $Ô#ðð ð ð ð ð< %ˆh�u˜t‘|Ô$Ñ&Ô&€ð 
€�4ÐÑÔð,ð ,ð ,ñ Ôð,ð 
€�$ÐÑÔðKð Kð Kñ ÔðKð" 
€�$ÐÑÔð#ð #ð #ñ Ôð#ðLð ð ð ð ð r)   