Ë
    æØjjl‘  ã            	      ó¢  — d Z ddlm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	Z	ddl
Z
ddl
m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 er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d    Z0dVd!„Z1dWd"„Z2dWd#„Z3dXd$„Z4 e"d%¬&«      dYd'„«       Z5 G d(„ d)e
jl                  «      Z7 G d*„ d+e
jl                  «      Z8 G d,„ d-e8«      Z9 G d.„ d/e«      Z: G d0„ d1ejv                  ee   «      Z<d2d3d4d5œZ= G d6„ d7e<e>   «      Z? G d8„ d9e<e   «      Z@ G d:„ d;e@eA   «      ZB G d<„ d=e@e>   «      ZC G d>„ d?e<e   «      ZD G d@„ dAeDeA   «      ZE G dB„ dCeDe>   «      ZFejŽ                  dDk\  sere G dE„ dFeee   «      «       ZHn" G dG„ dF ej’                  dFdHdIg«      ee   «      ZH G dJ„ dKee   «      ZJdZdL„ZK G dM„ dN«      ZL G dO„ dPee   «      ZMe(d[dQ„«       ZNe(d[dR„«       ZOe(d\dS„«       ZPe(d[dT„«       ZQe(d\dU„«       ZRy)]z+Per-test stdout/stderr capturing mechanism.é    )ÚannotationsN)Ú	Generator)ÚIterable)ÚIterator©ÚUnsupportedOperation)ÚTemporaryFile)ÚTracebackType)ÚAny)ÚAnyStr)ÚBinaryIO)Úcast)ÚFinal)Úfinal)ÚGeneric)ÚLiteral)Ú
NamedTuple)ÚTextIO)ÚTYPE_CHECKING)ÚSelf)ÚConfig)Úhookimpl)ÚParser)Úcheck_ispytest)Úfixture)Ú
SubRequest)Ú	Collector)ÚFile)ÚItem)ÚCollectReport©ÚfdÚsysÚnoútee-sysc                ó„   — | j                  d«      }|j                  ddddg d¢d¬«       |j                  d	d
ddd¬«       y )NÚgeneralz	--captureÚstorer"   Úmethodr!   z3Per-test capturing method: one of fd|sys|no|tee-sys)ÚactionÚdefaultÚmetavarÚchoicesÚhelpz-sÚstore_constr$   ÚcapturezShortcut for --capture=no)r*   ÚconstÚdestr.   )ÚgetgroupÚ	addoptionÚ
_addoption)ÚparserÚgroups     úQ/opt/eval-harness/bench_task/venv/lib/python3.12/site-packages/_pytest/capture.pyÚpytest_addoptionr9   1   sW   € Ø�O‰O˜IÓ&€EØ	‡O�OØØØØÚ.ØBð ô ð 
×ÑØØØØØ(ð õ ó    c                 ól   — t         j                  j                  d«      r	 ddl} yy# t        $ r Y yw xY w)a  Ensure colorama is imported so that it attaches to the correct stdio
    handles on Windows.

    colorama uses the terminal on import time. So if something does the
    first import of colorama while I/O capture is active, colorama will
    fail in various ways.
    Úwin32r   N)r#   ÚplatformÚ
startswithÚcoloramaÚImportError)r?   s    r8   Ú_colorama_workaroundrA   D   s7   € ô ‡|�|×Ñ˜wÔ'ð	Üð (øô ò 	Ùð	ús   ¡' §	3²3c                 ó,   — 	 ddl } y# t        $ r Y yw xY w)aê  Ensure readline is imported early so it attaches to the correct stdio handles.

    This isn't a problem with the default GNU readline implementation, but in
    some configurations, Python uses libedit instead (on macOS, and for prebuilt
    binaries such as used by uv).

    In theory this is only needed if readline.backend == "libedit", but the
    workaround consists of importing readline here, so we already worked around
    the issue by the time we could check if we need to.
    r   N)Úreadliner@   ©rC   s    r8   Ú_readline_workaroundrE   S   s   € ðÜøÜò Ùðús   ‚ ‡	’c                óð  ‡ — t         j                  j                  d«      rt        t         d«      ryt        ‰ d«      syt        ‰ j                  d«      r‰ j                  j
                  n‰ j                  }t        |t        j                  «      syˆ fd„} |t         j                  d«      t         _	         |t         j                  d«      t         _
         |t         j                  d«      t         _        y)	aù  Workaround for Windows Unicode console handling.

    Python 3.6 implemented Unicode console handling for Windows. This works
    by reading/writing to the raw console handle using
    ``{Read,Write}ConsoleW``.

    The problem is that we are going to ``dup2`` over the stdio file
    descriptors when doing ``FDCapture`` and this will ``CloseHandle`` the
    handles used by Python to write to the console. Though there is still some
    weirdness and the console handle seems to only be closed randomly and not
    on the first call to ``CloseHandle``, or maybe it gets reopened with the
    same handle value when we suspend capturing.

    The workaround in this case will reopen stdio with a different fd which
    also means a different handle by replicating the logic in
    "Py_lifecycle.c:initstdio/create_stdio".

    :param stream:
        In practice ``sys.stdout`` or ``sys.stderr``, but given
        here as parameter for unittesting purposes.

    See https://github.com/pytest-dev/py/issues/103.
    r<   Úpypy_version_infoNÚbufferÚrawc                ó$  •— t        ‰j                  d«      s|d   dk(  rd}nd}t        j                  t	        t        j                  | j                  «       «      ||«      | j                  | j                  | j                  | j                  «      S )NrI   r   Úwéÿÿÿÿ)ÚhasattrrH   ÚioÚTextIOWrapperÚopenÚosÚdupÚfilenoÚencodingÚerrorsÚnewlinesÚline_buffering)ÚfÚmodeÚ	bufferingÚstreams      €r8   Ú_reopen_stdioz3_windowsconsoleio_workaround.<locals>._reopen_stdioˆ   sq   ø€ Ü�v—}‘} eÔ,°°a±¸C²Ø‰IàˆIä×ÑÜ”—‘˜Ÿ™›
Ó# T¨9Ó5Ø�J‰JØ�H‰HØ�J‰JØ×Ñó
ð 	
r:   ÚrbÚwb)r#   r=   r>   rM   rH   rI   Ú
isinstancerN   Ú_WindowsConsoleIOÚstdinÚstdoutÚstderr)r[   Ú
raw_stdoutr\   s   `  r8   Ú_windowsconsoleio_workaroundre   d   s¥   ø€ ô0 �<‰<×"Ñ" 7Ô+¬w´sÐ<OÔ/PØô �6˜8Ô$Øä&-¨f¯m©m¸UÔ&C�—‘×"Ò"ÈÏÉ€Jä�j¤"×"6Ñ"6Ô7Øô
ñ œcŸi™i¨Ó.„C„IÙœsŸz™z¨4Ó0„C„JÙœsŸz™z¨4Ó0„C…Jr:   T©Úwrapperc              #  ól  K  — | j                   }|j                  dk(  rt        t        j                  «       t        «        t        «        | j                  }t        |j                  «      }|j                  |d«       | j                  |j                  «       |j                  «        	 	 d –— |j                  «        y # |j                  «        w xY w# t        $ rS |j                  «       \  }}t        j                  j!                  |«       t        j"                  j!                  |«       ‚ w xY w­w)Nr"   Úcapturemanager)Úknown_args_namespacer0   re   r#   rb   rA   rE   ÚpluginmanagerÚCaptureManagerÚregisterÚadd_cleanupÚstop_global_capturingÚstart_global_capturingÚsuspend_global_captureÚBaseExceptionÚread_global_captureÚwriterc   )Úearly_configÚnsrk   ÚcapmanÚoutÚerrs         r8   Úpytest_load_initial_conftestsrz   ›   sï   è ø€ à	×	*Ñ	*€BØ	‡z�z�TÒÜ$¤S§Z¡ZÔ0ÜÔÜÔØ ×.Ñ.€MÜ˜BŸJ™JÓ'€FØ×Ñ˜6Ð#3Ô4ð ×Ñ˜V×9Ñ9Ô:ð ×!Ñ!Ô#ð	ð	,Ûà×)Ñ)Õ+øˆF×)Ñ)Õ+ûÜò Ø×-Ñ-Ó/‰ˆˆSÜ�
‰
×Ñ˜ÔÜ�
‰
×Ñ˜ÔØð	üs1   ‚B'D4Â+C  Â/C Â?D4Ã CÃC ÃAD1Ä1D4c                  ó4   — e Zd ZdZedd„«       Zedd„«       Zy)ÚEncodedFile© c                ó,   — t        | j                  «      S ©N)ÚreprrH   ©Úselfs    r8   ÚnamezEncodedFile.name½   s   € ô �D—K‘KÓ Ð r:   c                óš   — t        | j                  d«      sJ ‚t        t        | j                  j                  j                  dd«      «      S )NrY   ÚbÚ )rM   rH   r   ÚstrrY   Úreplacer�   s    r8   rY   zEncodedFile.modeÃ   s<   € ô �t—{‘{ FÔ+Ð+Ð+Ü”C˜Ÿ™×)Ñ)×1Ñ1°#°rÓ:Ó;Ð;r:   N©Úreturnr‡   )Ú__name__Ú
__module__Ú__qualname__Ú	__slots__Úpropertyrƒ   rY   r}   r:   r8   r|   r|   º   s-   „ Ø€Iàò!ó ð!ð
 ò<ó ñ<r:   r|   c                  ó(   ‡ — e Zd Zdˆ fd„Zdd„Zˆ xZS )Ú	CaptureIOc                óP   •— t         ‰| �  t        j                  «       ddd¬«       y )NúUTF-8r†   T)rT   ÚnewlineÚwrite_through)ÚsuperÚ__init__rN   ÚBytesIO)r‚   Ú	__class__s    €r8   r—   zCaptureIO.__init__Ì   s    ø€ Ü‰ÑœŸ™›°ÀÐSWÐÕXr:   c                ó    — t        | j                  t        j                  «      sJ ‚| j                  j	                  «       j                  d«      S )Nr“   )r_   rH   rN   r˜   ÚgetvalueÚdecoder�   s    r8   r›   zCaptureIO.getvalueÏ   s8   € Ü˜$Ÿ+™+¤r§z¡zÔ2Ð2Ð2Ø�{‰{×#Ñ#Ó%×,Ñ,¨WÓ5Ð5r:   ©rŠ   ÚNoner‰   )r‹   rŒ   r�   r—   r›   Ú__classcell__©r™   s   @r8   r‘   r‘   Ë   s   ø„ õY÷6r:   r‘   c                  ó,   ‡ — e Zd Zdˆ fd„Zdˆ fd„Zˆ xZS )ÚTeeCaptureIOc                ó0   •— || _         t        ‰| �	  «        y r   )Ú_otherr–   r—   )r‚   Úotherr™   s     €r8   r—   zTeeCaptureIO.__init__Õ   s   ø€ ØˆŒÜ‰ÑÕr:   c                óX   •— t         ‰| �  |«       | j                  j                  |«      S r   )r–   rt   r¤   )r‚   Úsr™   s     €r8   rt   zTeeCaptureIO.writeÙ   s$   ø€ Ü‰‰�aÔØ�{‰{× Ñ  Ó#Ð#r:   )r¥   r   rŠ   rž   )r§   r‡   rŠ   Úint)r‹   rŒ   r�   r—   rt   rŸ   r    s   @r8   r¢   r¢   Ô   s   ø„ õ÷$ñ $r:   r¢   c                  óÜ   — e Zd Zedd„«       Zddd„ZeZdd„Zddd„Zdd„Z	dd„Z
dd„Zdd„Zdd	„Zdd
„Zddd„Zdd„Zdd„Zd d!d„Zd"d„Zd#d„Zdd„Zd$d„Z	 	 	 	 	 	 	 	 d%d„Zed&d„«       Zy)'ÚDontReadFromInputc                óZ   — t         j                  €J ‚t         j                  j                  S r   )r#   Ú	__stdin__rT   r�   s    r8   rT   zDontReadFromInput.encodingß   s"   € ä�}‰}Ð(Ð(Ð(Ü�}‰}×%Ñ%Ð%r:   c                ó   — t        d«      ‚©NzJpytest: reading from stdin while output is captured!  Consider using `-s`.©ÚOSError©r‚   Úsizes     r8   ÚreadzDontReadFromInput.readä   ó   € ÜØXó
ð 	
r:   c                ó"   — | j                  «       S r   rD   r�   s    r8   Ú__next__zDontReadFromInput.__next__ë   s   € Ø�}‰}‹Ðr:   c                ó   — t        d«      ‚r®   r¯   )r‚   Úhints     r8   Ú	readlineszDontReadFromInput.readlinesî   r´   r:   c                ó   — | S r   r}   r�   s    r8   Ú__iter__zDontReadFromInput.__iter__ó   ó   € Øˆr:   c                ó   — t        d«      ‚)Nz/redirected stdin is pseudofile, has no fileno()r   r�   s    r8   rS   zDontReadFromInput.filenoö   s   € Ü"Ð#TÓUÐUr:   c                ó   — t        d«      ‚)Nz.redirected stdin is pseudofile, has no flush()r   r�   s    r8   ÚflushzDontReadFromInput.flushù   s   € Ü"Ð#SÓTÐTr:   c                 ó   — y©NFr}   r�   s    r8   ÚisattyzDontReadFromInput.isattyü   ó   € Ør:   c                 ó   — y r   r}   r�   s    r8   ÚclosezDontReadFromInput.closeÿ   ó   € Ør:   c                 ó   — yrÁ   r}   r�   s    r8   ÚreadablezDontReadFromInput.readable  rÃ   r:   c                ó   — t        d«      ‚)Nz0redirected stdin is pseudofile, has no seek(int)r   )r‚   ÚoffsetÚwhences      r8   ÚseekzDontReadFromInput.seek  s   € Ü"Ð#UÓVÐVr:   c                 ó   — yrÁ   r}   r�   s    r8   ÚseekablezDontReadFromInput.seekable  rÃ   r:   c                ó   — t        d«      ‚)Nz-redirected stdin is pseudofile, has no tell()r   r�   s    r8   ÚtellzDontReadFromInput.tell  s   € Ü"Ð#RÓSÐSr:   Nc                ó   — t        d«      ‚)Nzcannot truncate stdinr   r±   s     r8   ÚtruncatezDontReadFromInput.truncate  ó   € Ü"Ð#:Ó;Ð;r:   c                ó   — t        d«      ‚)Nzcannot write to stdinr   ©r‚   Údatas     r8   rt   zDontReadFromInput.write  rÓ   r:   c                ó   — t        d«      ‚)NzCannot write to stdinr   )r‚   Úliness     r8   Ú
writelineszDontReadFromInput.writelines  rÓ   r:   c                 ó   — yrÁ   r}   r�   s    r8   ÚwritablezDontReadFromInput.writable  rÃ   r:   c                ó   — | S r   r}   r�   s    r8   Ú	__enter__zDontReadFromInput.__enter__  r¼   r:   c                 ó   — y r   r}   )r‚   ÚtypeÚvalueÚ	tracebacks       r8   Ú__exit__zDontReadFromInput.__exit__  s   € ð 	r:   c                ó   — | S r   r}   r�   s    r8   rH   zDontReadFromInput.buffer%  s	   € ð ˆr:   r‰   )rL   )r²   r¨   rŠ   r‡   )r¸   ú
int | NonerŠ   z	list[str])rŠ   zIterator[str])rŠ   r¨   r�   ©rŠ   Úbool)r   )rÊ   r¨   rË   r¨   rŠ   r¨   r   )r²   rä   rŠ   r¨   )rÖ   r‡   rŠ   r¨   )rØ   zIterable[str]rŠ   rž   )rŠ   r   )rß   ztype[BaseException] | Nonerà   zBaseException | Nonerá   zTracebackType | NonerŠ   rž   )rŠ   r   )r‹   rŒ   r�   r�   rT   r³   rC   r¶   r¹   r»   rS   r¿   rÂ   rÅ   rÈ   rÌ   rÎ   rÐ   rÒ   rt   rÙ   rÛ   rÝ   râ   rH   r}   r:   r8   rª   rª   Þ   s³   „ Øò&ó ð&ô
ð
 €Hóô
ó
óVóUóóóôWóóTô<ó<ó<óóðà(ðð $ðð (ð	ð
 
óð òó ñr:   rª   c                  ó"  — e Zd ZU ded<   ej
                  dd„«       Zej
                  dd„«       Zej
                  dd„«       Zej
                  dd„«       Z	ej
                  dd„«       Z
ej
                  dd„«       Zej
                  dd	„«       Zy
)ÚCaptureBaser   ÚEMPTY_BUFFERc                ó   — t        «       ‚r   ©ÚNotImplementedError©r‚   r"   s     r8   r—   zCaptureBase.__init__1  ó   € ä!Ó#Ð#r:   c                ó   — t        «       ‚r   rë   r�   s    r8   ÚstartzCaptureBase.start5  rî   r:   c                ó   — t        «       ‚r   rë   r�   s    r8   ÚdonezCaptureBase.done9  rî   r:   c                ó   — t        «       ‚r   rë   r�   s    r8   ÚsuspendzCaptureBase.suspend=  rî   r:   c                ó   — t        «       ‚r   rë   r�   s    r8   ÚresumezCaptureBase.resumeA  rî   r:   c                ó   — t        «       ‚r   rë   rÕ   s     r8   ÚwriteorgzCaptureBase.writeorgE  rî   r:   c                ó   — t        «       ‚r   rë   r�   s    r8   ÚsnapzCaptureBase.snapI  rî   r:   N©r"   r¨   rŠ   rž   r�   )rÖ   r   rŠ   rž   )rŠ   r   )r‹   rŒ   r�   Ú__annotations__ÚabcÚabstractmethodr—   rð   rò   rô   rö   rø   rú   r}   r:   r8   rè   rè   .  s¼   … ØÓà×Ñò$ó ð$ð 	×Ñò$ó ð$ð 	×Ñò$ó ð$ð 	×Ñò$ó ð$ð 	×Ñò$ó ð$ð 	×Ñò$ó ð$ð 	×Ñò$ó ñ$r:   rè   ra   rb   rc   )r   é   é   c                  óH   — e Zd ZdZd
d„Zdd„Zdd„Zdd„Zdd„Zdd„Z	dd„Z
y	)Ú	NoCapturer†   c                 ó   — y r   r}   rí   s     r8   r—   zNoCapture.__init__T  rÆ   r:   c                 ó   — y r   r}   r�   s    r8   rð   zNoCapture.startW  rÆ   r:   c                 ó   — y r   r}   r�   s    r8   rò   zNoCapture.doneZ  rÆ   r:   c                 ó   — y r   r}   r�   s    r8   rô   zNoCapture.suspend]  rÆ   r:   c                 ó   — y r   r}   r�   s    r8   rö   zNoCapture.resume`  rÆ   r:   c                 ó   — y©Nr†   r}   r�   s    r8   rú   zNoCapture.snapc  s   € Ør:   c                 ó   — y r   r}   rÕ   s     r8   rø   zNoCapture.writeorgf  rÆ   r:   Nrû   r�   r‰   ©rÖ   r‡   rŠ   rž   )r‹   rŒ   r�   ré   r—   rð   rò   rô   rö   rú   rø   r}   r:   r8   r  r  Q  s*   „ Ø€Lóóóóóóôr:   r  c                  ód   — e Zd Z	 dddœ	 	 	 	 	 	 	 dd„Zdd„Zdd„Zdd„Zdd„Zdd	„Zdd
„Z	dd„Z
y)ÚSysCaptureBaseNF©Úteec               óÐ   — t         |   }t        t        |«      | _        || _        |€1|dk(  rt        «       }n!|s
t        «       nt        | j                  «      }|| _        d| _	        y )Nra   Úinitialized)
ÚpatchsysdictÚgetattrr#   Ú_oldrƒ   rª   r‘   r¢   ÚtmpfileÚ_state)r‚   r"   r  r  rƒ   s        r8   r—   zSysCaptureBase.__init__k  sY   € ô ˜BÑˆÜ#¤C¨Ó.ˆŒ	ØˆŒ	Øˆ?Ø�wŠÜ+Ó-‘á-0œ)œ+´lÀ4Ç9Á9Ó6M�ØˆŒØ#ˆ�r:   c                ó²   — dj                  || j                  t        | d«      xr t        | j                  «      xs d| j
                  | j                  «      S ©Nz(<{} {} _old={} _state={!r} tmpfile={!r}>r  z<UNSET>)Úformatrƒ   rM   r€   r  r  r  )r‚   Ú
class_names     r8   r€   zSysCaptureBase.repry  sI   € Ø9×@Ñ@ØØ�I‰IÜ�T˜6Ó"Ò6¤t¨D¯I©I£ÒD¸9Ø�K‰KØ�L‰Ló
ð 	
r:   c                óÚ   — dj                  | j                  j                  | j                  t	        | d«      xr t        | j                  «      xs d| j                  | j                  «      S r  )	r  r™   r‹   rƒ   rM   r€   r  r  r  r�   s    r8   Ú__repr__zSysCaptureBase.__repr__‚  sS   € Ø9×@Ñ@Ø�N‰N×#Ñ#Ø�I‰IÜ�T˜6Ó"Ò6¤t¨D¯I©I£ÒD¸9Ø�K‰KØ�L‰Ló
ð 	
r:   c                ó‚   — | j                   |v s1J dj                  || j                   dj                  |«      «      «       ‚y ©Nz+cannot {} in state {!r}: expected one of {}z, ©r  r  Újoin©r‚   ÚopÚstatess      r8   Ú_assert_statezSysCaptureBase._assert_state‹  ó=   € Ø�{‰{˜fÑ$ð 	
Ø9×@Ñ@Ø�D—K‘K §¡¨6Ó!2óó	
Ñ$r:   c                ó€   — | j                  dd«       t        t        | j                  | j                  «       d| _        y )Nrð   ©r  Ústarted)r$  Úsetattrr#   rƒ   r  r  r�   s    r8   rð   zSysCaptureBase.start’  s.   € Ø×Ñ˜7Ð$4Ô5Ü”�T—Y‘Y §¡Ô-Øˆ�r:   c                óØ   — | j                  dd«       | j                  dk(  ry t        t        | j                  | j
                  «       | `| j                  j                  «        d| _        y )Nrò   ©r  r(  Ú	suspendedrò   )r$  r  r)  r#   rƒ   r  r  rÅ   r�   s    r8   rò   zSysCaptureBase.done—  sR   € Ø×Ñ˜6Ð#RÔSØ�;‰;˜&Ò ØÜ”�T—Y‘Y §	¡	Ô*ØˆIØ�‰×ÑÔØˆ�r:   c                ó€   — | j                  dd«       t        t        | j                  | j                  «       d| _        y ©Nrô   ©r(  r,  r,  )r$  r)  r#   rƒ   r  r  r�   s    r8   rô   zSysCaptureBase.suspend   s.   € Ø×Ñ˜9Ð&>Ô?Ü”�T—Y‘Y §	¡	Ô*Ø!ˆ�r:   c                ó    — | j                  dd«       | j                  dk(  ry t        t        | j                  | j
                  «       d| _        y ©Nrö   r/  r(  )r$  r  r)  r#   rƒ   r  r�   s    r8   rö   zSysCaptureBase.resume¥  s=   € Ø×Ñ˜8Ð%=Ô>Ø�;‰;˜)Ò#ØÜ”�T—Y‘Y §¡Ô-Øˆ�r:   r   )r"   r¨   r  zTextIO | Noner  ræ   rŠ   rž   )r  r‡   rŠ   r‡   r‰   ©r"  r‡   r#  ztuple[str, ...]rŠ   rž   r�   )r‹   rŒ   r�   r—   r€   r  r$  rð   rò   rô   rö   r}   r:   r8   r  r  j  sU   „ à04ð$ØEJñ$Øð$Ø -ð$Ø>Bð$à	ó$ó
ó
ó
ó ó
ó"ô
 r:   r  c                  ó    — e Zd ZdZdd„Zdd„Zy)ÚSysCaptureBinaryr:   c                ó  — | j                  dd«       | j                  j                  d«       | j                  j                  j	                  «       }| j                  j                  d«       | j                  j                  «        |S ©Nrú   r/  r   ©r$  r  rÌ   rH   r³   rÒ   ©r‚   Úress     r8   rú   zSysCaptureBinary.snap°  ód   € Ø×Ñ˜6Ð#;Ô<Ø�‰×Ñ˜!ÔØ�l‰l×!Ñ!×&Ñ&Ó(ˆØ�‰×Ñ˜!ÔØ�‰×ÑÔØˆ
r:   c                óî   — | j                  dd«       | j                  j                  «        | j                  j                  j	                  |«       | j                  j                  j                  «        y ©Nrø   r/  )r$  r  r¿   rH   rt   rÕ   s     r8   rø   zSysCaptureBinary.writeorg¸  sO   € Ø×Ñ˜:Ð'?Ô@Ø�	‰	�‰ÔØ�	‰	×Ñ×Ñ˜tÔ$Ø�	‰	×Ñ×ÑÕ r:   N©rŠ   Úbytes©rÖ   r>  rŠ   rž   ©r‹   rŒ   r�   ré   rú   rø   r}   r:   r8   r4  r4  ­  s   „ Ø€Lóô!r:   r4  c                  ó    — e Zd ZdZdd„Zdd„Zy)Ú
SysCapturer†   c                ó   — | j                  dd«       t        | j                  t        «      sJ ‚| j                  j	                  «       }| j                  j                  d«       | j                  j                  «        |S r6  )r$  r_   r  r‘   r›   rÌ   rÒ   r8  s     r8   rú   zSysCapture.snapÂ  s`   € Ø×Ñ˜6Ð#;Ô<Ü˜$Ÿ,™,¬	Ô2Ð2Ð2Ø�l‰l×#Ñ#Ó%ˆØ�‰×Ñ˜!ÔØ�‰×ÑÔØˆ
r:   c                ó’   — | j                  dd«       | j                  j                  |«       | j                  j                  «        y r<  )r$  r  rt   r¿   rÕ   s     r8   rø   zSysCapture.writeorgÊ  s1   € Ø×Ñ˜:Ð'?Ô@Ø�	‰	�‰˜ÔØ�	‰	�‰Õr:   Nr‰   r  r@  r}   r:   r8   rB  rB  ¿  s   „ Ø€Lóôr:   rB  c                  óD   — e Zd Zd	d„Zd
d„Zdd„Zdd„Zdd„Zdd„Zdd„Z	y)ÚFDCaptureBasec                óŠ  — || _         	 t        j                  |«       d | _        t        j                  |«      | _
        |dk(  r8t        t        j                  d¬«      | _        t        |«      | _        d	| _        y t        t        d¬«      dddd¬«      | _        |t         v r#t        || j                  «      | _        d	| _        y t#        |«      | _        d	| _        y # t        $ r[ t        j
                  t        j                  t        j                  «      | _        t        j                  | j                  |«       Y �Œw xY w)
Nr   úutf-8)rT   )rZ   rˆ   r†   T)rT   rU   r”   r•   r  )ÚtargetfdrQ   ÚfstatÚtargetfd_invalidr°   rP   ÚdevnullÚO_RDWRÚdup2rR   Útargetfd_saver  rB  Ú
syscapturer|   r	   r  r  r  )r‚   rI  s     r8   r—   zFDCaptureBase.__init__Ñ  s  € Ø ˆŒð	)Ü�H‰H�XÔð  %)ˆDÔ!ÜŸV™V HÓ-ˆÔà�qŠ=Ü¤§
¡
°WÔ=ˆDŒLÜ0:¸8Ó0DˆDŒOð $ˆ�ô 'Ü¨Ô*Ø Ø ØØ"ôˆDŒLð œ<Ñ'Ü",¨X°t·|±|Ó"D�”ð $ˆ�ô #,¨HÓ"5�”à#ˆ�øôE ò 	5ô 13·±¼¿
¹
ÄBÇIÁIÓ0NˆDÔ!Ü�G‰G�D×)Ñ)¨8×4ð	5ús   ‰C ÃA EÅEc                óž   — d| j                   j                  › d| j                  › d| j                  › d| j                  ›d| j
                  ›d�S )Nú<ú z oldfd=ú _state=z	 tmpfile=ú>)r™   r‹   rI  rO  r  r  r�   s    r8   r  zFDCaptureBase.__repr__ú  sR   € à�—‘×'Ñ'Ð(¨¨$¯-©-¨¸À×@RÑ@RÐ?Sð TØ—k‘k�_ I¨d¯l©lÐ-=¸Qð@ð	
r:   c                ó‚   — | j                   |v s1J dj                  || j                   dj                  |«      «      «       ‚y r  r  r!  s      r8   r$  zFDCaptureBase._assert_state   r%  r:   c                óÚ   — | j                  dd«       t        j                  | j                  j	                  «       | j
                  «       | j                  j                  «        d| _        y)z4Start capturing on targetfd using memorized tmpfile.rð   r'  r(  N)	r$  rQ   rN  r  rS   rI  rP  rð   r  r�   s    r8   rð   zFDCaptureBase.start  sI   € à×Ñ˜7Ð$4Ô5Ü
�‰�—‘×#Ñ#Ó% t§}¡}Ô5Ø�‰×ÑÔØˆ�r:   c                ó  — | j                  dd«       | j                  dk(  ryt        j                  | j                  | j
                  «       t        j                  | j                  «       | j                  �W| j                  | j
                  k7  rt        j                  | j
                  «       t        j                  | j                  «       | j                  j                  «        | j                  j                  «        d| _        y)z_Stop capturing, restore streams, return original capture file,
        seeked to position zero.rò   r+  N)r$  r  rQ   rN  rO  rI  rÅ   rK  rP  rò   r  r�   s    r8   rò   zFDCaptureBase.done  sµ   € ð 	×Ñ˜6Ð#RÔSØ�;‰;˜&Ò ØÜ
�‰�×"Ñ" D§M¡MÔ2Ü
�‰�×#Ñ#Ô$Ø× Ñ Ð,Ø×$Ñ$¨¯©Ò5Ü—‘˜Ÿ™Ô'Ü�H‰H�T×*Ñ*Ô+Ø�‰×ÑÔØ�‰×ÑÔØˆ�r:   c                óÞ   — | j                  dd«       | j                  dk(  ry | j                  j                  «        t	        j
                  | j                  | j                  «       d| _        y r.  )r$  r  rP  rô   rQ   rN  rO  rI  r�   s    r8   rô   zFDCaptureBase.suspend  sQ   € Ø×Ñ˜9Ð&>Ô?Ø�;‰;˜+Ò%ØØ�‰×ÑÔ!Ü
�‰�×"Ñ" D§M¡MÔ2Ø!ˆ�r:   c                óú   — | j                  dd«       | j                  dk(  ry | j                  j                  «        t	        j
                  | j                  j                  «       | j                  «       d| _        y r1  )	r$  r  rP  rö   rQ   rN  r  rS   rI  r�   s    r8   rö   zFDCaptureBase.resume&  sX   € Ø×Ñ˜8Ð%=Ô>Ø�;‰;˜)Ò#ØØ�‰×ÑÔ Ü
�‰�—‘×#Ñ#Ó% t§}¡}Ô5Øˆ�r:   N)rI  r¨   rŠ   rž   r‰   r2  r�   )
r‹   rŒ   r�   r—   r  r$  rð   rò   rô   rö   r}   r:   r8   rF  rF  Ð  s&   „ ó'$óR
ó
ó óó "ô r:   rF  c                  ó$   — e Zd ZdZdZdd„Zdd„Zy)ÚFDCaptureBinaryzWCapture IO to/from a given OS-level file descriptor.

    snap() produces `bytes`.
    r:   c                ó  — | j                  dd«       | j                  j                  d«       | j                  j                  j	                  «       }| j                  j                  d«       | j                  j                  «        |S r6  r7  r8  s     r8   rú   zFDCaptureBinary.snap7  r:  r:   c                óh   — | j                  dd«       t        j                  | j                  |«       y)ú"Write to original file descriptor.rø   r/  N)r$  rQ   rt   rO  rÕ   s     r8   rø   zFDCaptureBinary.writeorg?  s'   € à×Ñ˜:Ð'?Ô@Ü
�‰�×#Ñ# TÕ*r:   Nr=  r?  ©r‹   rŒ   r�   Ú__doc__ré   rú   rø   r}   r:   r8   r\  r\  /  s   „ ñð
 €Lóô+r:   r\  c                  ó$   — e Zd ZdZdZdd„Zdd„Zy)Ú	FDCapturezTCapture IO to/from a given OS-level file descriptor.

    snap() produces text.
    r†   c                óþ   — | j                  dd«       | j                  j                  d«       | j                  j                  «       }| j                  j                  d«       | j                  j	                  «        |S r6  )r$  r  rÌ   r³   rÒ   r8  s     r8   rú   zFDCapture.snapM  s^   € Ø×Ñ˜6Ð#;Ô<Ø�‰×Ñ˜!ÔØ�l‰l×ÑÓ!ˆØ�‰×Ñ˜!ÔØ�‰×ÑÔØˆ
r:   c                ó†   — | j                  dd«       t        j                  | j                  |j	                  d«      «       y)r_  rø   r/  rH  N)r$  rQ   rt   rO  ÚencoderÕ   s     r8   rø   zFDCapture.writeorgU  s0   € à×Ñ˜:Ð'?Ô@ä
�‰�×#Ñ# T§[¡[°Ó%9Õ:r:   Nr‰   r  r`  r}   r:   r8   rc  rc  E  s   „ ñð
 €Lóô;r:   rc  )é   é   c                  ó&   — e Zd ZU dZded<   ded<   y)ÚCaptureResultúOThe result of :method:`caplog.readouterr() <pytest.CaptureFixture.readouterr>`.r   rx   ry   N)r‹   rŒ   r�   ra  rü   r}   r:   r8   rj  rj  b  s   … á]à‹ØŒr:   rj  c                  ó   — e Zd ZdZdZy)rj  rk  r}   N)r‹   rŒ   r�   ra  rŽ   r}   r:   r8   rj  rj  k  s   „ ñ 	^à‰	r:   rx   ry   c                  ón   — e Zd ZdZdZ	 	 	 	 	 	 	 	 dd„Zdd„Zdd„Zdd„Zddd„Z	dd„Z
dd	„Zdd
„Zdd„Zy)ÚMultiCaptureNFc                ó.   — || _         || _        || _        y r   ©Úin_rx   ry   )r‚   rq  rx   ry   s       r8   r—   zMultiCapture.__init__x  s   € ð 03ˆŒØ/2ˆŒØ/2ˆ�r:   c                óŠ   — d| j                   ›d| j                  ›d| j                  ›d| j                  ›d| j                  ›d�S )Nz<MultiCapture out=z err=z in_=rT  z _in_suspended=rU  )rx   ry   rq  r  Ú_in_suspendedr�   s    r8   r  zMultiCapture.__repr__‚  sJ   € à  §¡ ¨E°$·(±(°¸UÀ4Ç8Á8À,ð OØ—k‘k�_ O°D×4FÑ4FÐ3IÈðLð	
r:   c                óø   — d| _         | j                  r| j                  j                  «        | j                  r| j                  j                  «        | j                  r| j                  j                  «        y y )Nr(  )r  rq  rð   rx   ry   r�   s    r8   Ústart_capturingzMultiCapture.start_capturingˆ  sM   € ØˆŒØ�8Š8Ø�H‰H�N‰NÔØ�8Š8Ø�H‰H�N‰NÔØ�8Š8Ø�H‰H�N‰NÕð r:   c                óÜ   — | j                  «       \  }}|r)| j                  €J ‚| j                  j                  |«       |r)| j                  €J ‚| j                  j                  |«       ||fS )z?Pop current snapshot out/err capture and flush to orig streams.)Ú
readouterrrx   rø   ry   ©r‚   rx   ry   s      r8   Úpop_outerr_to_origzMultiCapture.pop_outerr_to_orig‘  se   € à—?‘?Ó$‰ˆˆSÙØ—8‘8Ð'Ð'Ð'Ø�H‰H×Ñ˜cÔ"ÙØ—8‘8Ð'Ð'Ð'Ø�H‰H×Ñ˜cÔ"Ø�Cˆxˆr:   c                ó  — d| _         | j                  r| j                  j                  «        | j                  r| j                  j                  «        |r/| j                  r"| j                  j                  «        d| _        y y y )Nr,  T)r  rx   rô   ry   rq  rs  ©r‚   rq  s     r8   Úsuspend_capturingzMultiCapture.suspend_capturingœ  s_   € Ø!ˆŒØ�8Š8Ø�H‰H×ÑÔØ�8Š8Ø�H‰H×ÑÔÙ�4—8’8Ø�H‰H×ÑÔØ!%ˆDÕð ˆ3r:   c                ó"  — d| _         | j                  r| j                  j                  «        | j                  r| j                  j                  «        | j                  r0| j
                  €J ‚| j
                  j                  «        d| _        y y )Nr(  F)r  rx   rö   ry   rs  rq  r�   s    r8   Úresume_capturingzMultiCapture.resume_capturing¦  sg   € ØˆŒØ�8Š8Ø�H‰H�O‰OÔØ�8Š8Ø�H‰H�O‰OÔØ×ÒØ—8‘8Ð'Ð'Ð'Ø�H‰H�O‰OÔØ!&ˆDÕð r:   c                ó,  — | j                   dk(  rt        d«      ‚d| _         | j                  r| j                  j                  «        | j                  r| j                  j                  «        | j
                  r| j
                  j                  «        yy)z+Stop capturing and reset capturing streams.Ústoppedzwas already stoppedN)r  Ú
ValueErrorrx   rò   ry   rq  r�   s    r8   Ústop_capturingzMultiCapture.stop_capturing±  sb   € à�;‰;˜)Ò#ÜÐ2Ó3Ð3ØˆŒØ�8Š8Ø�H‰H�M‰MŒOØ�8Š8Ø�H‰H�M‰MŒOØ�8Š8Ø�H‰H�M‰M�Oð r:   c                ó    — | j                   dk(  S )z7Whether actively capturing -- not suspended or stopped.r(  )r  r�   s    r8   Ú
is_startedzMultiCapture.is_started½  s   € à�{‰{˜iÑ'Ð'r:   c                óº   — | j                   r| j                   j                  «       nd}| j                  r| j                  j                  «       nd}t        ||«      S r	  )rx   rú   ry   rj  rx  s      r8   rw  zMultiCapture.readouterrÁ  s=   € Ø!%§¢ˆd�h‰h�m‰mŒo¨rˆØ!%§¢ˆd�h‰h�m‰mŒo¨rˆä˜S #Ó&Ð&r:   )rq  úCaptureBase[AnyStr] | Nonerx   r†  ry   r†  rŠ   rž   r‰   r�   )rŠ   ztuple[AnyStr, AnyStr]©F©rq  ræ   rŠ   rž   rå   ©rŠ   zCaptureResult[AnyStr])r‹   rŒ   r�   r  rs  r—   r  ru  ry  r|  r~  r‚  r„  rw  r}   r:   r8   rn  rn  t  s_   „ Ø€FØ€Mð3à'ð3ð (ð3ð (ð	3ð
 
ó3ó
óó	ô&ó	'ó
ó(ô'r:   rn  c                óN  — | dk(  r)t        t        d«      t        d«      t        d«      ¬«      S | dk(  r)t        t        d«      t        d«      t        d«      ¬«      S | dk(  rt        d d d ¬«      S | dk(  r$t        d t        dd	¬
«      t        dd	¬
«      ¬«      S t        d| ›�«      ‚)Nr"   r   rÿ   r   rp  r#   r$   r%   Tr  zunknown capturing method: )rn  rc  rB  r�  )r)   s    r8   Ú_get_multicapturer‹  È  sœ   € Ø�‚~Ü¤	¨!£´)¸A³,ÄIÈaÃLÔQÐQØ	�5ŠÜ¤
¨1£´:¸a³=ÄjÐQRÃmÔTÐTØ	�4ŠÜ ¨$°DÔ9Ð9Ø	�9Ò	ÜØœ* Q¨DÔ1´zÀ!ÈÔ7Nô
ð 	
ô Ð1°&°Ð<Ó
=Ð=r:   c                  ó°  — e Zd ZdZdd„Zd d„Zd!d„Zd"d„Zd#d„Zd#d„Z	d#d„Z
d$d%d	„Zd$d%d
„Zd#d„Zd&d„Zd'd„Zd#d„Zd#d„Zd#d„Zd#d„Zd#d„Zej,                  d(d„«       Zej,                  d)d„«       Z ed¬«      	 	 	 	 d*d„«       Z ed¬«      d+d„«       Z ed¬«      d+d„«       Z ed¬«      d+d„«       Z ed¬«      d#d„«       Z ed¬«      d#d„«       Zy),rl   a¹  The capture plugin.

    Manages that the appropriate capture method is enabled/disabled during
    collection and each test phase (setup, call, teardown). After each of
    those points, the captured output is obtained and attached to the
    collection/runtest report.

    There are two levels of capture:

    * global: enabled by default and can be suppressed by the ``-s``
      option. This is always enabled/disabled during collection and each test
      phase.

    * fixture: when a test function or one of its fixture depend on the
      ``capsys`` or ``capfd`` fixtures. In this case special handling is
      needed to ensure the fixtures take precedence over the global capture.
    c                ó.   — || _         d | _        d | _        y r   ©Ú_methodÚ_global_capturingÚ_capture_fixture)r‚   r)   s     r8   r—   zCaptureManager.__init__ì  s   € Ø$ˆŒØ;?ˆÔØ<@ˆÕr:   c                óV   — d| j                   ›d| j                  ›d| j                  ›d�S )Nz<CaptureManager _method=z _global_capturing=z _capture_fixture=rU  rŽ  r�   s    r8   r  zCaptureManager.__repr__ñ  s:   € à& t§|¡|Ð&6Ð6IÈ$×J`ÑJ`ÐIcð d Ø $× 5Ñ 5Ð8¸ð;ð	
r:   c                ó„   — | j                  «       ry| j                  r#d| j                  j                  j                  › �S y)NÚglobalzfixture F)Úis_globally_capturingr‘  ÚrequestÚfixturenamer�   s    r8   Úis_capturingzCaptureManager.is_capturing÷  s=   € Ø×%Ñ%Ô'ØØ× Ò Ø˜d×3Ñ3×;Ñ;×GÑGÐHÐIÐIØr:   c                ó    — | j                   dk7  S )Nr$   )r�  r�   s    r8   r•  z$CaptureManager.is_globally_capturing   s   € Ø�|‰|˜tÑ#Ð#r:   c                óˆ   — | j                   �J ‚t        | j                  «      | _         | j                   j                  «        y r   )r�  r‹  r�  ru  r�   s    r8   rp   z%CaptureManager.start_global_capturing  s7   € Ø×%Ñ%Ð-Ð-Ð-Ü!2°4·<±<Ó!@ˆÔØ×Ñ×.Ñ.Õ0r:   c                ó”   — | j                   �<| j                   j                  «        | j                   j                  «        d | _         y y r   )r�  ry  r‚  r�   s    r8   ro   z$CaptureManager.stop_global_capturing  s?   € Ø×!Ñ!Ð-Ø×"Ñ"×5Ñ5Ô7Ø×"Ñ"×1Ñ1Ô3Ø%)ˆDÕ"ð .r:   c                óR   — | j                   �| j                   j                  «        y y r   )r�  r~  r�   s    r8   Úresume_global_capturez$CaptureManager.resume_global_capture  s'   € ð ×!Ñ!Ð-Ø×"Ñ"×3Ñ3Õ5ð .r:   c                óV   — | j                   �| j                   j                  |¬«       y y )N©rq  )r�  r|  r{  s     r8   rq   z%CaptureManager.suspend_global_capture  s*   € Ø×!Ñ!Ð-Ø×"Ñ"×4Ñ4¸Ð4Õ=ð .r:   c                óF   — | j                  «        | j                  |«       y r   )Úsuspend_fixturerq   r{  s     r8   rô   zCaptureManager.suspend  s   € à×ÑÔØ×#Ñ# CÕ(r:   c                óD   — | j                  «        | j                  «        y r   )r�  Úresume_fixturer�   s    r8   rö   zCaptureManager.resume  s   € Ø×"Ñ"Ô$Ø×ÑÕr:   c                óR   — | j                   €J ‚| j                   j                  «       S r   )r�  rw  r�   s    r8   rs   z"CaptureManager.read_global_capture!  s)   € Ø×%Ñ%Ð1Ð1Ð1Ø×%Ñ%×0Ñ0Ó2Ð2r:   c                óÚ   — | j                   rX| j                   j                  j                  }|j                  j                  }|j                  j                  d|› d|› d�«       || _         y )Nzcannot use z and z at the same time)r‘  r–  r—  Ú
raiseerror)r‚   Úcapture_fixtureÚcurrent_fixtureÚrequested_fixtures       r8   Úset_fixturezCaptureManager.set_fixture'  sh   € Ø× Ò Ø"×3Ñ3×;Ñ;×GÑGˆOØ /× 7Ñ 7× CÑ CÐØ×#Ñ#×.Ñ.ØÐ/Ð0°°oÐ5FÐFWÐXôð !0ˆÕr:   c                ó   — d | _         y r   )r‘  r�   s    r8   Úunset_fixturezCaptureManager.unset_fixture0  s
   € Ø $ˆÕr:   c                óR   — | j                   r| j                   j                  «        yy)z|If the current item is using ``capsys`` or ``capfd``, activate
        them so they take precedence over the global capture.N)r‘  Ú_startr�   s    r8   Úactivate_fixturezCaptureManager.activate_fixture3  s$   € ð × Ò Ø×!Ñ!×(Ñ(Õ*ð !r:   c                óR   — | j                   r| j                   j                  «        yy)zDDeactivate the ``capsys`` or ``capfd`` fixture of this item, if any.N)r‘  rÅ   r�   s    r8   Údeactivate_fixturez!CaptureManager.deactivate_fixture9  s"   € à× Ò Ø×!Ñ!×'Ñ'Õ)ð !r:   c                óR   — | j                   r| j                   j                  «        y y r   )r‘  Ú_suspendr�   s    r8   r¡  zCaptureManager.suspend_fixture>  s"   € Ø× Ò Ø×!Ñ!×*Ñ*Õ,ð !r:   c                óR   — | j                   r| j                   j                  «        y y r   )r‘  Ú_resumer�   s    r8   r£  zCaptureManager.resume_fixtureB  s"   € Ø× Ò Ø×!Ñ!×)Ñ)Õ+ð !r:   c              #  óœ  K  — | j                   xr | j                   j                  «       }|r| j                  «        | j                  xr | j                  j	                  «       }|r| j                  «        	 d–— |r| j                  «        |r| j                  «        yy# |r| j                  «        |r| j                  «        w w xY w­w)zLContext manager to temporarily disable global and current fixture capturing.N)r‘  Ú_is_startedr¡  r�  r„  rq   r�  r£  )r‚   Ú
do_fixtureÚ	do_globals      r8   Úglobal_and_fixture_disabledz*CaptureManager.global_and_fixture_disabledH  sµ   è ø€ ð ×*Ñ*ÒR¨t×/DÑ/D×/PÑ/PÓ/Rˆ
ÙØ× Ñ Ô"Ø×*Ñ*ÒR¨t×/EÑ/E×/PÑ/PÓ/Rˆ	ÙØ×'Ñ'Ô)ð	&ÛáØ×*Ñ*Ô,ÙØ×#Ñ#Õ%ð øñ Ø×*Ñ*Ô,ÙØ×#Ñ#Õ%ð üs   ‚A5CÁ8B" Á<&CÂ"'C	Ã	Cc              #  óÌ  K  — | j                  «        | j                  «        	 d –— | j                  «        | j                  d¬«       | j	                  «       \  }}|j                  |d|«       |j                  |d|«       y # | j                  «        | j                  d¬«       | j	                  «       \  }}|j                  |d|«       |j                  |d|«       w xY w­w)NFrŸ  rb   rc   )r�  r¯  r±  rq   rs   Úadd_report_section)r‚   ÚwhenÚitemrx   ry   s        r8   Úitem_capturezCaptureManager.item_captureY  sÏ   è ø€ à×"Ñ"Ô$Ø×ÑÔð	9Ûà×#Ñ#Ô%Ø×'Ñ'¨EÐ'Ô2à×/Ñ/Ó1‰HˆC�Ø×#Ñ# D¨(°CÔ8Ø×#Ñ# D¨(°CÕ8øð ×#Ñ#Ô%Ø×'Ñ'¨EÐ'Ô2à×/Ñ/Ó1‰HˆC�Ø×#Ñ# D¨(°CÔ8Ø×#Ñ# D¨(°CÕ8üs   ‚!C$¤B ¨AC$ÂAC!Ã!C$Trf   c              #  óP  K  — t        |t        «      rx| j                  «        	 d –—}| j                  «        | j	                  «       \  }}|r|j
                  j                  d|f«       |r|j
                  j                  d|f«       |S d –—}|S # | j                  «        w xY w­w)NzCaptured stdoutzCaptured stderr)r_   r   r�  rq   rs   ÚsectionsÚappend)r‚   Ú	collectorÚreprx   ry   s        r8   Úpytest_make_collect_reportz)CaptureManager.pytest_make_collect_reporti  sž   è ø€ ô �i¤Ô&Ø×&Ñ&Ô(ð.Ú�à×+Ñ+Ô-Ø×/Ñ/Ó1‰HˆC�ÙØ—‘×#Ñ#Ð%6¸Ð$<Ô=ÙØ—‘×#Ñ#Ð%6¸Ð$<Ô=ð ˆ
ò ˆCØˆ
øð ×+Ñ+Õ-üs   ‚!B&¤B ¨A)B&ÂB#Â#B&c              #  ób   K  — | j                  d|«      5  d –—cd d d «       S # 1 sw Y   y xY w­w)NÚsetup©r¿  ©r‚   r¾  s     r8   Úpytest_runtest_setupz#CaptureManager.pytest_runtest_setup|  s-   è ø€ à×Ñ˜w¨Ó-ñ 	Ú÷	÷ 	ò 	üó   ‚/•#™
/£,¨/c              #  ób   K  — | j                  d|«      5  d –—cd d d «       S # 1 sw Y   y xY w­w)NÚcallrÈ  rÉ  s     r8   Úpytest_runtest_callz"CaptureManager.pytest_runtest_call�  s-   è ø€ à×Ñ˜v tÓ,ñ 	Ú÷	÷ 	ò 	ürË  c              #  ób   K  — | j                  d|«      5  d –—cd d d «       S # 1 sw Y   y xY w­w)NÚteardownrÈ  rÉ  s     r8   Úpytest_runtest_teardownz&CaptureManager.pytest_runtest_teardown†  s-   è ø€ à×Ñ˜z¨4Ó0ñ 	Ú÷	÷ 	ò 	ürË  )Útryfirstc                ó$   — | j                  «        y r   ©ro   r�   s    r8   Úpytest_keyboard_interruptz(CaptureManager.pytest_keyboard_interrupt‹  ó   € à×"Ñ"Õ$r:   c                ó$   — | j                  «        y r   rÔ  r�   s    r8   Úpytest_internalerrorz#CaptureManager.pytest_internalerror�  rÖ  r:   N)r)   Ú_CaptureMethodrŠ   rž   r‰   )rŠ   z
str | boolrå   r�   r‡  rˆ  )rŠ   zCaptureResult[str])r§  zCaptureFixture[Any]rŠ   rž   ©rŠ   úGenerator[None])r½  r‡   r¾  r   rŠ   rÛ  )rÃ  r   rŠ   z-Generator[None, CollectReport, CollectReport])r¾  r   rŠ   rÛ  ) r‹   rŒ   r�   ra  r—   r  r˜  r•  rp   ro   r�  rq   rô   rö   rs   rª  r¬  r¯  r±  r¡  r£  Ú
contextlibÚcontextmanagerrº  r¿  r   rÅ  rÊ  rÎ  rÑ  rÕ  rØ  r}   r:   r8   rl   rl   Ù  s7  „ ñó$Aó

óó$ó1ó
*ó6ô>ô)ó
ó3ó0ó%ó+ó*ó
-ó,ð ×Ñò&ó ð&ð  ×Ñò9ó ð9ñ �dÔðØ"ðà	6òó ðñ$ �dÔòó ðñ �dÔòó ðñ �dÔòó ðñ �tÔò%ó ð%ñ �tÔò%ó ñ%r:   rl   c                  óˆ   — e Zd ZdZdddœ	 	 	 	 	 	 	 	 	 dd„Zdd„Zdd„Zdd„Zdd	„Zdd
„Z	dd„Z
ej                  dd„«       Zy)ÚCaptureFixturez|Object returned by the :fixture:`capsys`, :fixture:`capsysbinary`,
    :fixture:`capfd` and :fixture:`capfdbinary` fixtures.NF©ÚconfigÚ	_ispytestc               óÆ   — t        |«       || _        || _        |r|ni | _        d | _        | j                  j
                  | _        | j                  j
                  | _        y r   )r   Úcaptureclassr–  Ú_configÚ_captureré   Ú_captured_outÚ_captured_err)r‚   rä  r–  rá  râ  s        r8   r—   zCaptureFixture.__init__˜  sU   € ô 	�yÔ!Ø7CˆÔØˆŒÙ!'‘v¨RˆŒØ59ˆŒØ%)×%6Ñ%6×%CÑ%CˆÔØ%)×%6Ñ%6×%CÑ%CˆÕr:   c           	     óà   — | j                   €bt        d  | j                  di | j                  ¤Ž | j                  di | j                  ¤Ž¬«      | _         | j                   j	                  «        y y )Nrp  )rÿ   )r   )ræ  rn  rä  rå  ru  r�   s    r8   r®  zCaptureFixture._start¨  s`   € Ø�=‰=Ð Ü(ØØ%�D×%Ñ%Ñ8¨4¯<©<Ñ8Ø%�D×%Ñ%Ñ8¨4¯<©<Ñ8ôˆDŒMð
 �M‰M×)Ñ)Õ+ð !r:   c                ó`  — | j                   �¢| j                  j                  d«      r| j                   j                  «       \  }}n| j                   j	                  «       \  }}| xj
                  |z  c_        | xj                  |z  c_        | j                   j                  «        d | _         y y )Nr  )ræ  rå  Úgetrw  ry  rç  rè  r‚  rx  s      r8   rÅ   zCaptureFixture.close±  sŠ   € Ø�=‰=Ð$Ø�|‰|×Ñ Ô&ð
  Ÿ=™=×3Ñ3Ó5‘�‘SàŸ=™=×;Ñ;Ó=‘��SØ×Ò #Ñ%ÕØ×Ò #Ñ%ÕØ�M‰M×(Ñ(Ô*Ø ˆD�Mð %r:   c                ó  — | j                   | j                  }}| j                  �'| j                  j                  «       \  }}||z  }||z  }| j                  j
                  | _         | j                  j
                  | _        t        ||«      S )z×Read and return the captured output so far, resetting the internal
        buffer.

        :returns:
            The captured content as a namedtuple with ``out`` and ``err``
            string attributes.
        )rç  rè  ræ  rw  rä  ré   rj  )r‚   Úcaptured_outÚcaptured_errrx   ry   s        r8   rw  zCaptureFixture.readouterrÀ  s‚   € ð &*×%7Ñ%7¸×9KÑ9K�lˆØ�=‰=Ð$Ø—}‘}×/Ñ/Ó1‰HˆC�Ø˜CÑˆLØ˜CÑˆLØ!×.Ñ.×;Ñ;ˆÔØ!×.Ñ.×;Ñ;ˆÔÜ˜\¨<Ó8Ð8r:   c                óR   — | j                   �| j                   j                  «        yy)z1Suspend this fixture's own capturing temporarily.N)ræ  r|  r�   s    r8   r³  zCaptureFixture._suspendÑ  s!   € à�=‰=Ð$Ø�M‰M×+Ñ+Õ-ð %r:   c                óR   — | j                   �| j                   j                  «        yy)z0Resume this fixture's own capturing temporarily.N)ræ  r~  r�   s    r8   rµ  zCaptureFixture._resumeÖ  s!   € à�=‰=Ð$Ø�M‰M×*Ñ*Õ,ð %r:   c                óP   — | j                   �| j                   j                  «       S y)z5Whether actively capturing -- not disabled or closed.F)ræ  r„  r�   s    r8   r·  zCaptureFixture._is_startedÛ  s"   € à�=‰=Ð$Ø—=‘=×+Ñ+Ó-Ð-Ør:   c              #  ó¼   K  — | j                   j                  j                  j                  d«      }|j	                  «       5  d–— ddd«       y# 1 sw Y   yxY w­w)z>Temporarily disable capturing while inside the ``with`` block.ri   N)r–  rá  rk   Ú	getpluginrº  )r‚   Ú
capmanagers     r8   ÚdisabledzCaptureFixture.disabledá  sP   è ø€ ð &*§\¡\×%8Ñ%8×%FÑ%F×%PÑ%PØó&
ˆ
ð ×3Ñ3Ó5ñ 	Û÷	÷ 	ñ 	üs   ‚A AÁAÁ	AÁAÁA)
rä  ztype[CaptureBase[AnyStr]]r–  r   rá  zdict[str, Any] | Nonerâ  ræ   rŠ   rž   r�   r‰  rå   rÚ  )r‹   rŒ   r�   ra  r—   r®  rÅ   rw  r³  rµ  r·  rÜ  rÝ  rõ  r}   r:   r8   rß  rß  ”  s‚   „ ñ=ð )-ØñDà/ðDð ðDð
 &ðDð ðDð 
óDó ,ó!ó9ó".ó
-ó
ð ×Ñòó ñr:   rß  c              #  ó  K  — | j                   j                  j                  d«      }t        t        | d¬«      }|j                  |«       |j                  «        |–— |j                  «        |j                  «        y­w)a  Enable text capturing of writes to ``sys.stdout`` and ``sys.stderr``.

    The captured output is made available via ``capsys.readouterr()`` method
    calls, which return a ``(out, err)`` namedtuple.
    ``out`` and ``err`` will be ``text`` objects.

    Returns an instance of :class:`CaptureFixture[str] <pytest.CaptureFixture>`.

    Example:

    .. code-block:: python

        def test_output(capsys):
            print("hello")
            captured = capsys.readouterr()
            assert captured.out == "hello\n"
    ri   T©râ  N)	rá  rk   ró  rß  rB  rª  r®  rÅ   r¬  ©r–  rw   r§  s      r8   Úcapsysrù  î  si   è ø€ ð& %Ÿ^™^×9Ñ9×CÑCÐDTÓU€FÜ$¤Z°ÀDÔI€OØ
×Ñ�Ô'Ø×ÑÔØ
ÒØ×ÑÔØ
×ÑÕùó   ‚A>B c              #  ó  K  — | j                   j                  j                  d«      }t        t        | t        d¬«      d¬«      }|j                  |«       |j                  «        |–— |j                  «        |j                  «        y­w)a×  Enable simultaneous text capturing and pass-through of writes
    to ``sys.stdout`` and ``sys.stderr`` as defined by ``--capture=``.


    The captured output is made available via ``capteesys.readouterr()`` method
    calls, which return a ``(out, err)`` namedtuple.
    ``out`` and ``err`` will be ``text`` objects.

    The output is also passed-through, allowing it to be "live-printed",
    reported, or both as defined by ``--capture=``.

    Returns an instance of :class:`CaptureFixture[str] <pytest.CaptureFixture>`.

    Example:

    .. code-block:: python

        def test_output(capteesys):
            print("hello")
            captured = capteesys.readouterr()
            assert captured.out == "hello\n"
    ri   Tr  rà  N)
rá  rk   ró  rß  rB  Údictrª  r®  rÅ   r¬  rø  s      r8   Ú	capteesysrý  
  st   è ø€ ð0 %Ÿ^™^×9Ñ9×CÑCÐDTÓU€FÜ$Ü�G¤D¨T¤N¸dô€Oð ×Ñ�Ô'Ø×ÑÔØ
ÒØ×ÑÔØ
×ÑÕùs   ‚B	Bc              #  ó  K  — | j                   j                  j                  d«      }t        t        | d¬«      }|j                  |«       |j                  «        |–— |j                  «        |j                  «        y­w)a'  Enable bytes capturing of writes to ``sys.stdout`` and ``sys.stderr``.

    The captured output is made available via ``capsysbinary.readouterr()``
    method calls, which return a ``(out, err)`` namedtuple.
    ``out`` and ``err`` will be ``bytes`` objects.

    Returns an instance of :class:`CaptureFixture[bytes] <pytest.CaptureFixture>`.

    Example:

    .. code-block:: python

        def test_output(capsysbinary):
            print("hello")
            captured = capsysbinary.readouterr()
            assert captured.out == b"hello\n"
    ri   Tr÷  N)	rá  rk   ró  rß  r4  rª  r®  rÅ   r¬  rø  s      r8   Úcapsysbinaryrÿ  -  sj   è ø€ ð& %Ÿ^™^×9Ñ9×CÑCÐDTÓU€FÜ$Ô%5°wÈ$ÔO€OØ
×Ñ�Ô'Ø×ÑÔØ
ÒØ×ÑÔØ
×ÑÕùrú  c              #  ó  K  — | j                   j                  j                  d«      }t        t        | d¬«      }|j                  |«       |j                  «        |–— |j                  «        |j                  «        y­w)a  Enable text capturing of writes to file descriptors ``1`` and ``2``.

    The captured output is made available via ``capfd.readouterr()`` method
    calls, which return a ``(out, err)`` namedtuple.
    ``out`` and ``err`` will be ``text`` objects.

    Returns an instance of :class:`CaptureFixture[str] <pytest.CaptureFixture>`.

    Example:

    .. code-block:: python

        def test_system_echo(capfd):
            os.system('echo "hello"')
            captured = capfd.readouterr()
            assert captured.out == "hello\n"
    ri   Tr÷  N)	rá  rk   ró  rß  rc  rª  r®  rÅ   r¬  rø  s      r8   Úcapfdr  I  si   è ø€ ð& %Ÿ^™^×9Ñ9×CÑCÐDTÓU€FÜ$¤Y°À4ÔH€OØ
×Ñ�Ô'Ø×ÑÔØ
ÒØ×ÑÔØ
×ÑÕùrú  c              #  ó  K  — | j                   j                  j                  d«      }t        t        | d¬«      }|j                  |«       |j                  «        |–— |j                  «        |j                  «        y­w)a-  Enable bytes capturing of writes to file descriptors ``1`` and ``2``.

    The captured output is made available via ``capfd.readouterr()`` method
    calls, which return a ``(out, err)`` namedtuple.
    ``out`` and ``err`` will be ``byte`` objects.

    Returns an instance of :class:`CaptureFixture[bytes] <pytest.CaptureFixture>`.

    Example:

    .. code-block:: python

        def test_system_echo(capfdbinary):
            os.system('echo "hello"')
            captured = capfdbinary.readouterr()
            assert captured.out == b"hello\n"

    ri   Tr÷  N)	rá  rk   ró  rß  r\  rª  r®  rÅ   r¬  rø  s      r8   Úcapfdbinaryr  e  si   è ø€ ð( %Ÿ^™^×9Ñ9×CÑCÐDTÓU€FÜ$¤_°gÈÔN€OØ
×Ñ�Ô'Ø×ÑÔØ
ÒØ×ÑÔØ
×ÑÕùrú  )r6   r   rŠ   rž   r�   )r[   r   rŠ   rž   )ru   r   rŠ   rÛ  )r)   rÙ  rŠ   zMultiCapture[str])r–  r   rŠ   zGenerator[CaptureFixture[str]])r–  r   rŠ   z Generator[CaptureFixture[bytes]])Sra  Ú
__future__r   rý   ÚcollectionsÚcollections.abcr   r   r   rÜ  rN   r   rQ   r#   Útempfiler	   Útypesr
   Útypingr   r   r   r   r   r   r   r   r   r   r   Útyping_extensionsr   Ú_pytest.configr   r   Ú_pytest.config.argparsingr   Ú_pytest.deprecatedr   Ú_pytest.fixturesr   r   Ú_pytest.nodesr   r   r   Ú_pytest.reportsr    rÙ  r9   rA   rE   re   rz   rO   r|   r‘   r¢   rª   ÚABCrè   r  r‡   r  r  r>  r4  rB  rF  r\  rc  Úversion_inforj  Ú
namedtuplern  r‹  rl   rß  rù  rý  rÿ  r  r  r}   r:   r8   ú<module>r     s‡  ðá 1å "ã 
Û Ý %Ý $Ý $Û Û 	Ý #Û 	Û 
Ý "Ý Ý Ý Ý Ý Ý Ý Ý Ý Ý Ý Ý  ñ Ý&å !Ý #Ý ,Ý -Ý $Ý 'Ý #Ý Ý Ý )ð Ð5Ñ6€óó&óó"41ñn 
�$Ôòó ðô<<�"×"Ñ"ô <ô"6�× Ñ ô 6ô$�9ô $ôJ˜ô Jô`$�#—'‘'˜7 6™?ô $ð@ ˜x¨HÑ5€ô�˜CÑ ô ô2@ �[ Ñ(ô @ ôF!�~ eÑ,ô !ô$� Ñ$ô ô"\ �K Ñ'ô \ ô~+�m EÑ*ô +ô,;�˜cÑ"ô ;ð6 ×Ñ�wÒ¡-à
ô˜
 G¨F¡Oó ó ñôØˆ×Ñ˜°¸°Ó?Ø�‰ôôQ'�7˜6‘?ô Q'óh>÷"x%ñ x%ôvT�W˜V‘_ô Tðt 	òó 	ðð6 	òó 	ððD 	òó 	ðð6 	òó 	ðð6 	òó 	ñr:   