ó
    EñiÝ�  ã            	      óÈ  • S r SSKJr  SSKrSSKrSSKJr  SSKJr  SSKJr  SSK	r	SSK
r
SSK
Jr  SSKrSSKrSSKJr  SS	KJr  SS
KJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  SSKJr  \(       a  SSKJr  SSK J!r!  SSK J"r"  SSK#J$r$  SSK%J&r&  SSK'J(r(  SSK'J)r)  SSK*J+r+  SSK*J,r,  SSK*J-r-  SSK.J/r/  \S    r0SVS! jr1SWS" jr2SWS# jr3SXS$ jr4\"" S%S&9SYS' j5       r5 " S( S)\
Rl                  5      r7 " S* S+\
Rl                  5      r8 " S, S-\85      r9 " S. S/\5      r: " S0 S1\Rv                  \\   5      r<S2S3S4S5.r= " S6 S7\<\>   5      r? " S8 S9\<\   5      r@ " S: S;\@\A   5      rB " S< S=\@\>   5      rC " S> S?\<\   5      rD " S@ SA\D\A   5      rE " SB SC\D\>   5      rF\RŽ                  SD:¼  d  \(       a  \ " SE SF\\\   5      5       rHO" " SG SF\R’                  " SFSHSI/5      \\   5      rH " SJ SK\\   5      rJSZSL jrK " SM SN5      rL " SO SP\\   5      rM\(S[SQ j5       rN\(S[SR j5       rO\(S\SS j5       rP\(S[ST j5       rQ\(S\SU j5       rRg)]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           	     óx   • U R                  S5      nUR                  SSSS/ SQSS9  UR                  S	S
SSSS9  g )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     ÚL/home/mande/repo/quber/.venv/lib/python3.13/site-packages/_pytest/capture.pyÚpytest_addoptionr9   1   sW   € Ø�O‰O˜IÓ&€EØ	‡O�OØØØØÚ.ØBð ñ ð 
×ÑØØØØØ(ð ò ó    c                 óx   • [         R                  R                  S5      (       a   SSKn gg! [         a     gf = f)zø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   s:   € ô ‡|�|×Ñ˜w×'Ñ'ð	Üð (øô ó 	Ùð	ús   ¦, ¬
9¸9c                 ó.   •  SSK n g! [         a     gf = f)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                ó$  ^ • [         R                  R                  S5      (       a  [        [         S5      (       a  g[        T S5      (       d  g[        T R                  S5      (       a  T R                  R
                  OT R                  n[        U[        R                  5      (       d  gU 4S jnU" [         R                  S5      [         l	        U" [         R                  S5      [         l
        U" [         R                  S5      [         l        g)	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                ó2  >• [        TR                  S5      (       d  US   S:X  a  SnOSn[        R                  " [	        [
        R                  " U R                  5       5      X5      U R                  U R                  U R                  U R                  5      $ )NrI   r   Úwéÿÿÿÿ)ÚhasattrrH   ÚioÚTextIOWrapperÚopenÚosÚdupÚfilenoÚencodingÚerrorsÚnewlinesÚline_buffering)ÚfÚmodeÚ	bufferingÚstreams      €r8   Ú_reopen_stdioÚ3_windowsconsoleio_workaround.<locals>._reopen_stdioˆ   sr   ø€ Ü�v—}‘} e×,Ñ,°°a±¸C³Ø‰IàˆIä×ÒÜ”—’˜Ÿ™›
Ó# TÓ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_workaroundrf   d   s´   ø€ ô0 �<‰<×"Ñ" 7×+Ñ+¬w´sÐ<O×/PÑ/PØô �6˜8×$Ñ$Øä&-¨f¯m©m¸U×&CÑ&C�—‘×"Ò"ÈÏÉ€Jä�j¤"×"6Ñ"6×7Ñ7Øõ
ñ œcŸi™i¨Ó.„C„IÙœsŸz™z¨4Ó0„C„JÙœsŸz™z¨4Ó0„C…Jr:   T©Úwrapperc              #  ón  #   • U R                   nUR                  S:X  a  [        [        R                  5        [        5         [        5         U R                  n[        UR                  5      nUR                  US5        U R                  UR                  5        UR                  5           S v •  UR                  5         g ! UR                  5         f = f! [         aR    UR                  5       u  pE[        R                  R!                  U5        [        R"                  R!                  U5        e f = f7f)Nr"   Úcapturemanager)Úknown_args_namespacer0   rf   r#   rc   rA   rE   ÚpluginmanagerÚCaptureManagerÚregisterÚadd_cleanupÚstop_global_capturingÚstart_global_capturingÚsuspend_global_captureÚBaseExceptionÚread_global_captureÚwriterd   )Úearly_configÚnsrl   ÚcapmanÚoutÚerrs         r8   Úpytest_load_initial_conftestsr{   ›   sì   é € à	×	*Ñ	*€BØ	‡z�z�TÓÜ$¤S§Z¡ZÔ0ÜÔÜÔØ ×.Ñ.€MÜ˜BŸJ™JÓ'€FØ×Ñ˜6Ð#3Ô4ð ×Ñ˜V×9Ñ9Ô:ð ×!Ñ!Ô#ð	ð	,Ûà×)Ñ)Õ+øˆF×)Ñ)Õ+ûÜó Ø×-Ñ-Ó/‰ˆÜ�
‰
×Ñ˜ÔÜ�
‰
×Ñ˜ÔØð	üs1   ‚B(D5Â,C Â0C Ã D5ÃCÃC ÃAD2Ä2D5c                  ó@   • \ rS rSrSr\SS j5       r\SS j5       rSrg)ÚEncodedFileéº   © c                ó,   • [        U R                  5      $ ©N)ÚreprrH   ©Úselfs    r8   ÚnameÚEncodedFile.name½   s   € ô �D—K‘KÓ Ð r:   c                ó¤   • [        U R                  S5      (       d   e[        [        U R                  R                  R                  SS5      5      $ )NrY   ÚbÚ )rM   rH   r   ÚstrrY   Úreplacerƒ   s    r8   rY   ÚEncodedFile.modeÃ   s?   € ô �t—{‘{ F×+Ñ+Ð+Ð+Ü”C˜Ÿ™×)Ñ)×1Ñ1°#°rÓ:Ó;Ð;r:   N©ÚreturnrŠ   )	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú	__slots__Úpropertyr…   rY   Ú__static_attributes__r   r:   r8   r}   r}   º   s-   † Ø€Iàó!ó ð!ð
 ó<ó ó<r:   r}   c                  ó6   ^ • \ rS rSrSU 4S jjrSS jrSrU =r$ )Ú	CaptureIOéË   c                óL   >• [         TU ]  [        R                  " 5       SSSS9  g )NúUTF-8r‰   T)rT   ÚnewlineÚwrite_through)ÚsuperÚ__init__rN   ÚBytesIO)r„   Ú	__class__s    €r8   rž   ÚCaptureIO.__init__Ì   s    ø€ Ü‰ÑœŸš›°ÀÐSWÐÒXr:   c                óª   • [        U R                  [        R                  5      (       d   eU R                  R	                  5       R                  S5      $ )Nrš   )r`   rH   rN   rŸ   ÚgetvalueÚdecoderƒ   s    r8   r£   ÚCaptureIO.getvalueÏ   s;   € Ü˜$Ÿ+™+¤r§z¡z×2Ñ2Ð2Ð2Ø�{‰{×#Ñ#Ó%×,Ñ,¨WÓ5Ð5r:   r   ©rŽ   ÚNoner�   )r�   r�   r‘   r’   rž   r£   r•   Ú__classcell__©r    s   @r8   r—   r—   Ë   s   ø† ÷Y÷6ò 6r:   r—   c                  ó<   ^ • \ rS rSrSU 4S jjrSU 4S jjrSrU =r$ )ÚTeeCaptureIOéÔ   c                ó.   >• Xl         [        TU ]	  5         g r�   )Ú_otherr�   rž   )r„   Úotherr    s     €r8   rž   ÚTeeCaptureIO.__init__Õ   s   ø€ ØŒÜ‰ÑÕr:   c                óX   >• [         TU ]  U5        U R                  R                  U5      $ r�   )r�   ru   r®   )r„   Úsr    s     €r8   ru   ÚTeeCaptureIO.writeÙ   s$   ø€ Ü‰‰�aÔØ�{‰{× Ñ  Ó#Ð#r:   )r®   )r¯   r   rŽ   r§   )r²   rŠ   rŽ   Úint)r�   r�   r‘   r’   rž   ru   r•   r¨   r©   s   @r8   r«   r«   Ô   s   ø† ÷÷$õ $r:   r«   c                  ó  • \ rS rSr\SS j5       rSSS jjr\rSS jrSSS jjr	SS jr
SS jrSS jrSS	 jrSS
 jrSS jrS S!S jjrSS jrSS jrS"S#S jjrS$S jrS%S jrSS jrS&S jr        S'S jr\S(S j5       rSrg))ÚDontReadFromInputéÞ   c                ó\   • [         R                  c   e[         R                  R                  $ r�   )r#   Ú	__stdin__rT   rƒ   s    r8   rT   ÚDontReadFromInput.encodingß   s"   € ä�}‰}Ñ(Ð(Ð(Ü�}‰}×%Ñ%Ð%r:   c                ó   • [        S5      e©NzJpytest: reading from stdin while output is captured!  Consider using `-s`.©ÚOSError©r„   Úsizes     r8   ÚreadÚDontReadFromInput.readä   ó   € ÜØXó
ð 	
r:   c                ó"   • U R                  5       $ r�   rD   rƒ   s    r8   Ú__next__ÚDontReadFromInput.__next__ë   s   € Ø�}‰}‹Ðr:   c                ó   • [        S5      er¼   r½   )r„   Úhints     r8   Ú	readlinesÚDontReadFromInput.readlinesî   rÃ   r:   c                ó   • U $ r�   r   rƒ   s    r8   Ú__iter__ÚDontReadFromInput.__iter__ó   ó   € Øˆr:   c                ó   • [        S5      e)Nz/redirected stdin is pseudofile, has no fileno()r   rƒ   s    r8   rS   ÚDontReadFromInput.filenoö   s   € Ü"Ð#TÓUÐUr:   c                ó   • [        S5      e)Nz.redirected stdin is pseudofile, has no flush()r   rƒ   s    r8   ÚflushÚDontReadFromInput.flushù   s   € Ü"Ð#SÓTÐTr:   c                ó   • g©NFr   rƒ   s    r8   ÚisattyÚDontReadFromInput.isattyü   ó   € Ør:   c                ó   • g r�   r   rƒ   s    r8   ÚcloseÚDontReadFromInput.closeÿ   ó   € Ør:   c                ó   • grÕ   r   rƒ   s    r8   ÚreadableÚDontReadFromInput.readable  rØ   r:   c                ó   • [        S5      e)Nz0redirected stdin is pseudofile, has no seek(int)r   )r„   ÚoffsetÚwhences      r8   ÚseekÚDontReadFromInput.seek  s   € Ü"Ð#UÓVÐVr:   c                ó   • grÕ   r   rƒ   s    r8   ÚseekableÚDontReadFromInput.seekable  rØ   r:   c                ó   • [        S5      e)Nz-redirected stdin is pseudofile, has no tell()r   rƒ   s    r8   ÚtellÚDontReadFromInput.tell  s   € Ü"Ð#RÓSÐSr:   Nc                ó   • [        S5      e)Nzcannot truncate stdinr   r¿   s     r8   ÚtruncateÚDontReadFromInput.truncate  ó   € Ü"Ð#:Ó;Ð;r:   c                ó   • [        S5      e)Nzcannot write to stdinr   ©r„   Údatas     r8   ru   ÚDontReadFromInput.write  rî   r:   c                ó   • [        S5      e)NzCannot write to stdinr   )r„   Úliness     r8   Ú
writelinesÚDontReadFromInput.writelines  rî   r:   c                ó   • grÕ   r   rƒ   s    r8   ÚwritableÚDontReadFromInput.writable  rØ   r:   c                ó   • U $ r�   r   rƒ   s    r8   Ú	__enter__ÚDontReadFromInput.__enter__  rÎ   r:   c                ó   • g r�   r   )r„   ÚtypeÚvalueÚ	tracebacks       r8   Ú__exit__ÚDontReadFromInput.__exit__  s   € ð 	r:   c                ó   • U $ r�   r   rƒ   s    r8   rH   ÚDontReadFromInput.buffer%  s	   € ð ˆr:   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’   r”   rT   rÁ   rC   rÅ   rÉ   rÌ   rS   rÒ   rÖ   rÚ   rÞ   rã   ræ   ré   rì   ru   rõ   rø   rû   r  rH   r•   r   r:   r8   r¶   r¶   Þ   s³   † Øó&ó ð&ö
ð
 €Hôö
ô
ôVôUôôôöWôôTö<ô<ô<ôôðà(ðð $ðð (ð	ð
 
ôð óó ór:   r¶   c                  ó8  • \ rS rSr% S\S'   \R                  SS j5       r\R                  SS j5       r\R                  SS j5       r	\R                  SS j5       r
\R                  SS j5       r\R                  SS	 j5       r\R                  SS
 j5       rSrg)ÚCaptureBasei.  r   ÚEMPTY_BUFFERc                ó   • [        5       er�   ©ÚNotImplementedError©r„   r"   s     r8   rž   ÚCaptureBase.__init__1  ó   € ä!Ó#Ð#r:   c                ó   • [        5       er�   r  rƒ   s    r8   ÚstartÚCaptureBase.start5  r  r:   c                ó   • [        5       er�   r  rƒ   s    r8   ÚdoneÚCaptureBase.done9  r  r:   c                ó   • [        5       er�   r  rƒ   s    r8   ÚsuspendÚCaptureBase.suspend=  r  r:   c                ó   • [        5       er�   r  rƒ   s    r8   ÚresumeÚCaptureBase.resumeA  r  r:   c                ó   • [        5       er�   r  rð   s     r8   ÚwriteorgÚCaptureBase.writeorgE  r  r:   c                ó   • [        5       er�   r  rƒ   s    r8   ÚsnapÚCaptureBase.snapI  r  r:   r   N©r"   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   r:   r8   r	  r	  .  s¼   ‡ ØÓà×Ñó$ó ð$ð 	×Ñó$ó ð$ð 	×Ñó$ó ð$ð 	×Ñó$ó ð$ð 	×Ñó$ó ð$ð 	×Ñó$ó ð$ð 	×Ñó$ó ó$r:   r	  rb   rc   rd   )r   é   é   c                  ó^   • \ rS rSrSrSS jrSS jrSS jrSS jrSS jr	SS jr
SS	 jrS
rg)Ú	NoCaptureiQ  r‰   c                ó   • g r�   r   r  s     r8   rž   ÚNoCapture.__init__T  rÜ   r:   c                ó   • g r�   r   rƒ   s    r8   r  ÚNoCapture.startW  rÜ   r:   c                ó   • g r�   r   rƒ   s    r8   r  ÚNoCapture.doneZ  rÜ   r:   c                ó   • g r�   r   rƒ   s    r8   r  ÚNoCapture.suspend]  rÜ   r:   c                ó   • g r�   r   rƒ   s    r8   r  ÚNoCapture.resume`  rÜ   r:   c                ó   • g©Nr‰   r   rƒ   s    r8   r!  ÚNoCapture.snapc  s   € Ør:   c                ó   • g r�   r   rð   s     r8   r  ÚNoCapture.writeorgf  rÜ   r:   r   Nr#  r¦   r�   ©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                  ó€   • \ rS rSr SSS.       SS jjjrSS jrSS jrSS jrSS	 jrSS
 jr	SS jr
SS jrSrg)ÚSysCaptureBaseij  NF©Úteec               óÚ   • [         U   n[        [        U5      U l        X@l        Uc7  US:X  a  [        5       nO&U(       d
  [        5       O[        U R                  5      nX l        SU l	        g )Nrb   Úinitialized)
ÚpatchsysdictÚgetattrr#   Ú_oldr…   r¶   r—   r«   ÚtmpfileÚ_state)r„   r"   rD  r>  r…   s        r8   rž   ÚSysCaptureBase.__init__k  sU   € ô ˜BÑˆÜ#¤C¨Ó.ˆŒ	ØŒ	Ø‰?Ø�w‹Ü+Ó-‘æ-0œ)œ+´lÀ4Ç9Á9Ó6M�ØŒØ#ˆ�r:   c                óÆ   • SR                  UU R                  [        U S5      =(       a    [        U R                  5      =(       d    SU R
                  U R                  5      $ ©Nz(<{} {} _old={} _state={!r} tmpfile={!r}>rC  z<UNSET>)Úformatr…   rM   r‚   rC  rE  rD  )r„   Ú
class_names     r8   r‚   ÚSysCaptureBase.repry  sI   € Ø9×@Ñ@ØØ�I‰IÜ�T˜6Ó"×6¤t¨D¯I©I£×D¸9Ø�K‰KØ�L‰Ló
ð 	
r:   c                óî   • SR                  U R                  R                  U R                  [	        U S5      =(       a    [        U R                  5      =(       d    SU R                  U R                  5      $ rH  )	rI  r    r�   r…   rM   r‚   rC  rE  rD  rƒ   s    r8   Ú__repr__ÚSysCaptureBase.__repr__‚  sS   € Ø9×@Ñ@Ø�N‰N×#Ñ#Ø�I‰IÜ�T˜6Ó"×6¤t¨D¯I©I£×D¸9Ø�K‰KØ�L‰Ló
ð 	
r:   c                ó„   • U R                   U;   d0   SR                  XR                   SR                  U5      5      5       eg ©Nz+cannot {} in state {!r}: expected one of {}z, ©rE  rI  Újoin©r„   ÚopÚstatess      r8   Ú_assert_stateÚSysCaptureBase._assert_state‹  ó;   € Ø�{‰{˜fÓ$ð 	
Ø9×@Ñ@Ø—K‘K §¡¨6Ó!2óó	
Ñ$r:   c                ó€   • U R                  SS5        [        [        U R                  U R                  5        SU l        g )Nr  ©r@  Ústarted)rV  Úsetattrr#   r…   rD  rE  rƒ   s    r8   r  ÚSysCaptureBase.start’  s.   € Ø×Ñ˜7Ð$4Ô5Ü”�T—Y‘Y §¡Ô-Øˆ�r:   c                óÚ   • U R                  SS5        U R                  S:X  a  g [        [        U R                  U R
                  5        U ?U R                  R                  5         SU l        g )Nr  ©r@  r[  Ú	suspendedr  )rV  rE  r\  r#   r…   rC  rD  rÚ   rƒ   s    r8   r  ÚSysCaptureBase.done—  sR   € Ø×Ñ˜6Ð#RÔSØ�;‰;˜&Ó ØÜ”�T—Y‘Y §	¡	Ô*ØˆIØ�‰×ÑÔØˆ�r:   c                ó€   • U R                  SS5        [        [        U R                  U R                  5        SU l        g ©Nr  ©r[  r`  r`  )rV  r\  r#   r…   rC  rE  rƒ   s    r8   r  ÚSysCaptureBase.suspend   s.   € Ø×Ñ˜9Ð&>Ô?Ü”�T—Y‘Y §	¡	Ô*Ø!ˆ�r:   c                ó¢   • U R                  SS5        U R                  S:X  a  g [        [        U R                  U R
                  5        SU l        g ©Nr  rd  r[  )rV  rE  r\  r#   r…   rD  rƒ   s    r8   r  ÚSysCaptureBase.resume¥  s=   € Ø×Ñ˜8Ð%=Ô>Ø�;‰;˜)Ó#ØÜ”�T—Y‘Y §¡Ô-Øˆ�r:   )rC  rE  r…   rD  r�   )r"   r´   rD  zTextIO | Noner>  r  rŽ   r§   )rJ  rŠ   rŽ   rŠ   r�   ©rT  rŠ   rU  ztuple[str, ...]rŽ   r§   r¦   )r�   r�   r‘   r’   rž   r‚   rM  rV  r  r  r  r  r•   r   r:   r8   r<  r<  j  sU   † à04ð$ØEJñ$Øð$Ø -ð$Ø>Bð$à	ö$ô
ô
ô
ô ô
ô"÷
 r:   r<  c                  ó,   • \ rS rSrSrSS jrSS jrSrg)	ÚSysCaptureBinaryi­  r:   c                ó  • U R                  SS5        U R                  R                  S5        U R                  R                  R	                  5       nU R                  R                  S5        U R                  R                  5         U$ ©Nr!  rd  r   ©rV  rD  rã   rH   rÁ   rì   ©r„   Úress     r8   r!  ÚSysCaptureBinary.snap°  ód   € Ø×Ñ˜6Ð#;Ô<Ø�‰×Ñ˜!ÔØ�l‰l×!Ñ!×&Ñ&Ó(ˆØ�‰×Ñ˜!ÔØ�‰×ÑÔØˆ
r:   c                óî   • U R                  SS5        U R                  R                  5         U R                  R                  R	                  U5        U R                  R                  R                  5         g ©Nr  rd  )rV  rC  rÒ   rH   ru   rð   s     r8   r  ÚSysCaptureBinary.writeorg¸  sO   € Ø×Ñ˜:Ð'?Ô@Ø�	‰	�‰ÔØ�	‰	×Ñ×Ñ˜tÔ$Ø�	‰	×Ñ×ÑÕ r:   r   N©rŽ   Úbytes©rñ   rw  rŽ   r§   ©r�   r�   r‘   r’   r
  r!  r  r•   r   r:   r8   rk  rk  ­  s   † Ø€Lô÷!r:   rk  c                  ó,   • \ rS rSrSrSS jrSS jrSrg)	Ú
SysCapturei¿  r‰   c                ó
  • U R                  SS5        [        U R                  [        5      (       d   eU R                  R	                  5       nU R                  R                  S5        U R                  R                  5         U$ rm  )rV  r`   rD  r—   r£   rã   rì   ro  s     r8   r!  ÚSysCapture.snapÂ  sc   € Ø×Ñ˜6Ð#;Ô<Ü˜$Ÿ,™,¬	×2Ñ2Ð2Ð2Ø�l‰l×#Ñ#Ó%ˆØ�‰×Ñ˜!ÔØ�‰×ÑÔØˆ
r:   c                ó’   • U R                  SS5        U R                  R                  U5        U R                  R                  5         g rt  )rV  rC  ru   rÒ   rð   s     r8   r  ÚSysCapture.writeorgÊ  s1   € Ø×Ñ˜:Ð'?Ô@Ø�	‰	�‰˜ÔØ�	‰	�‰Õr:   r   Nr�   r:  ry  r   r:   r8   r{  r{  ¿  s   † Ø€Lô÷r:   r{  c                  óZ   • \ rS rSrSS jrSS jrSS jrSS jrSS jrSS jr	SS jr
S	rg
)ÚFDCaptureBaseiÐ  c                óh  • Xl          [        R                  " U5        S U l        [        R                  " U5      U l
        US:X  a.  [        [        R                  SS9U l        [        U5      U l        ON[        [        SS9SSSSS9U l        U[         ;   a  [        XR                  5      U l        O[#        U5      U l        S	U l        g ! [         a]    [        R
                  " [        R                  [        R                  5      U l        [        R                  " U R                  U5         GNf = f)
Nr   úutf-8)rT   )rZ   r‹   r‰   T)rT   rU   r›   rœ   r@  )ÚtargetfdrQ   ÚfstatÚtargetfd_invalidr¾   rP   ÚdevnullÚO_RDWRÚdup2rR   Útargetfd_saverD  r{  Ú
syscapturer}   r	   rA  r*  rE  )r„   r„  s     r8   rž   ÚFDCaptureBase.__init__Ñ  sè   € Ø Œð	)Ü�HŠH�XÔð  %)ˆDÔ!ÜŸVšV HÓ-ˆÔà�q‹=Ü¤§
¡
°WÑ=ˆDŒLÜ0:¸8Ó0DˆD�Oä&Ü¨Ñ*Ø Ø ØØ"ñˆDŒLð œ<Ó'Ü",¨X·|±|Ó"D�•ä"+¨HÓ"5�”à#ˆ�øôE ó 	5ô 13·²¼¿
¹
ÄBÇIÁIÓ0NˆDÔ!Ü�GŠG�D×)Ñ)¨8×4ð	5ús   ˆC
 Ã
A#D1Ä0D1c                ó¢   • SU R                   R                   SU R                   SU R                   SU R                  < SU R
                  < S3$ )NÚ<Ú z oldfd=ú _state=z	 tmpfile=Ú>)r    r�   r„  rŠ  rE  rD  rƒ   s    r8   rM  ÚFDCaptureBase.__repr__ú  sR   € à�—‘×'Ñ'Ð(¨¨$¯-©-¨¸À×@RÑ@RÐ?Sð TØ—k‘k‘_ I¨d¯l©lÑ-=¸Qð@ð	
r:   c                ó„   • U R                   U;   d0   SR                  XR                   SR                  U5      5      5       eg rP  rQ  rS  s      r8   rV  ÚFDCaptureBase._assert_state   rX  r:   c                óÜ   • U R                  SS5        [        R                  " U R                  R	                  5       U R
                  5        U R                  R                  5         SU l        g)z4Start capturing on targetfd using memorized tmpfile.r  rZ  r[  N)	rV  rQ   r‰  rD  rS   r„  r‹  r  rE  rƒ   s    r8   r  ÚFDCaptureBase.start  sI   € à×Ñ˜7Ð$4Ô5Ü
�Š�—‘×#Ñ#Ó% t§}¡}Ô5Ø�‰×ÑÔØˆ�r:   c                ó$  • U R                  SS5        U R                  S:X  a  g[        R                  " U R                  U R
                  5        [        R                  " U R                  5        U R                  bZ  U R                  U R
                  :w  a   [        R                  " U R
                  5        [        R                  " U R                  5        U R                  R                  5         U R                  R                  5         SU l        g)zWStop capturing, restore streams, return original capture file,
seeked to position zero.r  r_  N)rV  rE  rQ   r‰  rŠ  r„  rÚ   r†  r‹  r  rD  rƒ   s    r8   r  ÚFDCaptureBase.done  sµ   € ð 	×Ñ˜6Ð#RÔSØ�;‰;˜&Ó ØÜ
�Š�×"Ñ" D§M¡MÔ2Ü
�Š�×#Ñ#Ô$Ø× Ñ Ñ,Ø×$Ñ$¨¯©Ó5Ü—’˜Ÿ™Ô'Ü�HŠH�T×*Ñ*Ô+Ø�‰×ÑÔØ�‰×ÑÔØˆ�r:   c                óâ   • U R                  SS5        U R                  S:X  a  g U R                  R                  5         [        R
                  " U R                  U R                  5        SU l        g rc  )rV  rE  r‹  r  rQ   r‰  rŠ  r„  rƒ   s    r8   r  ÚFDCaptureBase.suspend  sQ   € Ø×Ñ˜9Ð&>Ô?Ø�;‰;˜+Ó%ØØ�‰×ÑÔ!Ü
�Š�×"Ñ" D§M¡MÔ2Ø!ˆ�r:   c                óþ   • U R                  SS5        U R                  S:X  a  g U R                  R                  5         [        R
                  " U R                  R                  5       U R                  5        SU l        g rg  )	rV  rE  r‹  r  rQ   r‰  rD  rS   r„  rƒ   s    r8   r  ÚFDCaptureBase.resume&  sX   € Ø×Ñ˜8Ð%=Ô>Ø�;‰;˜)Ó#ØØ�‰×ÑÔ Ü
�Š�—‘×#Ñ#Ó% t§}¡}Ô5Øˆ�r:   )rE  r‹  r„  r†  rŠ  rD  N)r„  r´   rŽ   r§   r�   ri  r¦   )r�   r�   r‘   r’   rž   rM  rV  r  r  r  r  r•   r   r:   r8   r�  r�  Ð  s&   † ô'$ôR
ô
ô ôô "÷ r:   r�  c                  ó0   • \ rS rSrSrSrSS jrS	S jrSrg)
ÚFDCaptureBinaryi/  zOCapture IO to/from a given OS-level file descriptor.

snap() produces `bytes`.
r:   c                ó  • U R                  SS5        U R                  R                  S5        U R                  R                  R	                  5       nU R                  R                  S5        U R                  R                  5         U$ rm  rn  ro  s     r8   r!  ÚFDCaptureBinary.snap7  rr  r:   c                ój   • U R                  SS5        [        R                  " U R                  U5        g)ú"Write to original file descriptor.r  rd  N)rV  rQ   ru   rŠ  rð   s     r8   r  ÚFDCaptureBinary.writeorg?  s'   € à×Ñ˜:Ð'?Ô@Ü
�Š�×#Ñ# TÕ*r:   r   Nrv  rx  ©	r�   r�   r‘   r’   Ú__doc__r
  r!  r  r•   r   r:   r8   rž  rž  /  s   † ñð
 €Lô÷+r:   rž  c                  ó0   • \ rS rSrSrSrSS jrS	S jrSrg)
Ú	FDCaptureiE  zLCapture IO to/from a given OS-level file descriptor.

snap() produces text.
r‰   c                óþ   • U R                  SS5        U R                  R                  S5        U R                  R                  5       nU R                  R                  S5        U R                  R	                  5         U$ rm  )rV  rD  rã   rÁ   rì   ro  s     r8   r!  ÚFDCapture.snapM  s^   € Ø×Ñ˜6Ð#;Ô<Ø�‰×Ñ˜!ÔØ�l‰l×ÑÓ!ˆØ�‰×Ñ˜!ÔØ�‰×ÑÔØˆ
r:   c                óˆ   • U R                  SS5        [        R                  " U R                  UR	                  S5      5        g)r¢  r  rd  rƒ  N)rV  rQ   ru   rŠ  Úencoderð   s     r8   r  ÚFDCapture.writeorgU  s0   € à×Ñ˜:Ð'?Ô@ä
�Š�×#Ñ# T§[¡[°Ó%9Õ:r:   r   Nr�   r:  r¤  r   r:   r8   r§  r§  E  s   † ñð
 €Lô÷;r:   r§  )é   é   c                  ó.   • \ rS rSr% SrS\S'   S\S'   Srg)ÚCaptureResultib  úOThe result of :method:`caplog.readouterr() <pytest.CaptureFixture.readouterr>`.r   ry   rz   r   N)r�   r�   r‘   r’   r¥  r$  r•   r   r:   r8   r°  r°  b  s   ‡ á]à‹ØŽr:   r°  c                  ó   • \ rS rSrSrSrSrg)r°  ik  r±  r   N)r�   r�   r‘   r’   r¥  r“   r•   r   r:   r8   r°  r°  k  s   † ñ 	^à‹	r:   ry   rz   c                  óŠ   • \ rS rSrSrSr        SS jrSS jrSS jrSS jr	SSS jjr
SS	 jrSS
 jrSS jrSS jrSrg)ÚMultiCaptureit  NFc                ó(   • Xl         X l        X0l        g r�   ©Úin_ry   rz   )r„   r·  ry   rz   s       r8   rž   ÚMultiCapture.__init__x  s   € ð 03ŒØ/2ŒØ/2�r:   c                ó”   • SU R                   < SU R                  < SU R                  < SU R                  < SU R                  < S3$ )Nz<MultiCapture out=z err=z in_=r�  z _in_suspended=r‘  )ry   rz   r·  rE  Ú_in_suspendedrƒ   s    r8   rM  ÚMultiCapture.__repr__‚  sJ   € à  §¡¡¨E°$·(±(±¸UÀ4Ç8Á8Á,ð OØ—k‘k‘_ O°D×4FÑ4FÑ3IÈðLð	
r:   c                ó  • SU l         U R                  (       a  U R                  R                  5         U R                  (       a  U R                  R                  5         U R                  (       a  U R                  R                  5         g g )Nr[  )rE  r·  r  ry   rz   rƒ   s    r8   Ústart_capturingÚMultiCapture.start_capturingˆ  sM   € ØˆŒØ�8�8Ø�H‰H�N‰NÔØ�8�8Ø�H‰H�N‰NÔØ�8�8Ø�H‰H�N‰NÕð r:   c                óð   • U R                  5       u  pU(       a*  U R                  c   eU R                  R                  U5        U(       a*  U R                  c   eU R                  R                  U5        X4$ )z?Pop current snapshot out/err capture and flush to orig streams.)Ú
readouterrry   r  rz   ©r„   ry   rz   s      r8   Úpop_outerr_to_origÚMultiCapture.pop_outerr_to_orig‘  sa   € à—?‘?Ó$‰ˆÞØ—8‘8Ñ'Ð'Ð'Ø�H‰H×Ñ˜cÔ"ÞØ—8‘8Ñ'Ð'Ð'Ø�H‰H×Ñ˜cÔ"Øˆxˆr:   c                ó4  • SU l         U R                  (       a  U R                  R                  5         U R                  (       a  U R                  R                  5         U(       a4  U R                  (       a"  U R                  R                  5         SU l        g g g )Nr`  T)rE  ry   r  rz   r·  rº  ©r„   r·  s     r8   Úsuspend_capturingÚMultiCapture.suspend_capturingœ  s_   € Ø!ˆŒØ�8�8Ø�H‰H×ÑÔØ�8�8Ø�H‰H×ÑÔÞ�4—8—8Ø�H‰H×ÑÔØ!%ˆDÕð ˆ3r:   c                óB  • SU l         U R                  (       a  U R                  R                  5         U R                  (       a  U R                  R                  5         U R                  (       a1  U R
                  c   eU R
                  R                  5         SU l        g g )Nr[  F)rE  ry   r  rz   rº  r·  rƒ   s    r8   Úresume_capturingÚ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                óL  • U R                   S:X  a  [        S5      eSU l         U R                  (       a  U R                  R                  5         U R                  (       a  U R                  R                  5         U R
                  (       a  U R
                  R                  5         gg)z+Stop capturing and reset capturing streams.Ústoppedzwas already stoppedN)rE  Ú
ValueErrorry   r  rz   r·  rƒ   s    r8   Ústop_capturingÚ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                ó    • U R                   S:H  $ )z7Whether actively capturing -- not suspended or stopped.r[  )rE  rƒ   s    r8   Ú
is_startedÚMultiCapture.is_started½  s   € à�{‰{˜iÑ'Ð'r:   c                óÌ   • U R                   (       a  U R                   R                  5       OSnU R                  (       a  U R                  R                  5       OSn[        X5      $ r6  )ry   r!  rz   r°  rÁ  s      r8   rÀ  ÚMultiCapture.readouterrÁ  s;   € Ø!%§§ˆd�h‰h�m‰mŒo¨rˆØ!%§§ˆd�h‰h�m‰mŒo¨rˆä˜SÓ&Ð&r:   )rº  rE  rz   r·  ry   )r·  úCaptureBase[AnyStr] | Nonery   rÕ  rz   rÕ  rŽ   r§   r�   r¦   )rŽ   ztuple[AnyStr, AnyStr]©F©r·  r  rŽ   r§   r  ©rŽ   zCaptureResult[AnyStr])r�   r�   r‘   r’   rE  rº  rž   rM  r½  rÂ  rÆ  rÉ  rÎ  rÑ  rÀ  r•   r   r:   r8   r´  r´  t  s_   † Ø€FØ€Mð3à'ð3ð (ð3ð (ð	3ð
 
ô3ô
ôô	ö&ô	'ô
ô(÷'r:   r´  c           	     ó4  • U S:X  a&  [        [        S5      [        S5      [        S5      S9$ U S:X  a&  [        [        S5      [        S5      [        S5      S9$ U S:X  a  [        S S S S9$ U S:X  a  [        S [        SS	S
9[        SS	S
9S9$ [        SU < 35      e)Nr"   r   r'  r(  r¶  r#   r$   r%   Tr=  zunknown capturing method: )r´  r§  r{  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                  óÊ  • \ rS rSrSrS!S jrS"S jrS#S jrS$S jrS%S jr	S%S jr
S%S	 jrS&S'S
 jjrS&S'S jjrS%S jrS(S jrS)S jrS%S jrS%S jrS%S jrS%S jrS%S jr\R.                  S*S j5       r\R.                  S+S j5       r\" SS9    S,S j5       r\" SS9S-S j5       r\" SS9S-S j5       r\" SS9S-S j5       r\" SS9S%S j5       r\" SS9S%S j5       r Sr!g ).rm   iÙ  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                ó,   • Xl         S U l        S U l        g r�   ©Ú_methodÚ_global_capturingÚ_capture_fixture)r„   r)   s     r8   rž   ÚCaptureManager.__init__ì  s   € Ø$ŒØ;?ˆÔØ<@ˆÕr:   c                ó\   • SU R                   < SU R                  < SU R                  < S3$ )Nz<CaptureManager _method=z _global_capturing=z _capture_fixture=r‘  rÝ  rƒ   s    r8   rM  ÚCaptureManager.__repr__ñ  s:   € à& t§|¡|Ñ&6Ð6IÈ$×J`ÑJ`ÑIcð d Ø $× 5Ñ 5Ñ8¸ð;ð	
r:   c                ó˜   • U R                  5       (       a  gU R                  (       a#  SU R                  R                  R                   3$ g)NÚglobalzfixture F)Úis_globally_capturingrà  ÚrequestÚfixturenamerƒ   s    r8   Úis_capturingÚCaptureManager.is_capturing÷  s@   € Ø×%Ñ%×'Ñ'ØØ× × Ø˜d×3Ñ3×;Ñ;×GÑGÐHÐIÐIØr:   c                ó    • U R                   S:g  $ )Nr$   )rÞ  rƒ   s    r8   ræ  Ú$CaptureManager.is_globally_capturing   s   € Ø�|‰|˜tÑ#Ð#r:   c                óŠ   • U R                   b   e[        U R                  5      U l         U R                   R                  5         g r�   )rß  rÚ  rÞ  r½  rƒ   s    r8   rq   Ú%CaptureManager.start_global_capturing  s7   € Ø×%Ñ%Ñ-Ð-Ð-Ü!2°4·<±<Ó!@ˆÔØ×Ñ×.Ñ.Õ0r:   c                ó–   • U R                   b<  U R                   R                  5         U R                   R                  5         S U l         g g r�   )rß  rÂ  rÎ  rƒ   s    r8   rp   Ú$CaptureManager.stop_global_capturing  s?   € Ø×!Ñ!Ñ-Ø×"Ñ"×5Ñ5Ô7Ø×"Ñ"×1Ñ1Ô3Ø%)ˆDÕ"ð .r:   c                óT   • U R                   b  U R                   R                  5         g g r�   )rß  rÉ  rƒ   s    r8   Úresume_global_captureÚ$CaptureManager.resume_global_capture  s'   € ð ×!Ñ!Ñ-Ø×"Ñ"×3Ñ3Õ5ð .r:   c                óR   • U R                   b  U R                   R                  US9  g g )N©r·  )rß  rÆ  rÅ  s     r8   rr   Ú%CaptureManager.suspend_global_capture  s*   € Ø×!Ñ!Ñ-Ø×"Ñ"×4Ñ4¸Ð4Ò=ð .r:   c                óF   • U R                  5         U R                  U5        g r�   )Úsuspend_fixturerr   rÅ  s     r8   r  ÚCaptureManager.suspend  s   € à×ÑÔØ×#Ñ# CÕ(r:   c                óD   • U R                  5         U R                  5         g r�   )rò  Úresume_fixturerƒ   s    r8   r  ÚCaptureManager.resume  s   € Ø×"Ñ"Ô$Ø×ÑÕr:   c                óT   • U R                   c   eU R                   R                  5       $ r�   )rß  rÀ  rƒ   s    r8   rt   Ú"CaptureManager.read_global_capture!  s)   € Ø×%Ñ%Ñ1Ð1Ð1Ø×%Ñ%×0Ñ0Ó2Ð2r:   c                óâ   • U R                   (       aX  U R                   R                  R                  nUR                  R                  nUR                  R                  SU SU S35        Xl         g )Nzcannot use z and z at the same time)rà  rç  rè  Ú
raiseerror)r„   Úcapture_fixtureÚcurrent_fixtureÚrequested_fixtures       r8   Úset_fixtureÚCaptureManager.set_fixture'  sf   € Ø× × Ø"×3Ñ3×;Ñ;×GÑGˆOØ /× 7Ñ 7× CÑ CÐØ×#Ñ#×.Ñ.ØÐ/Ð0°°oÐ5FÐFWÐXôð !0Õr:   c                ó   • S U l         g r�   )rà  rƒ   s    r8   Úunset_fixtureÚCaptureManager.unset_fixture0  s
   € Ø $ˆÕr:   c                ó\   • U R                   (       a  U R                   R                  5         gg)ztIf the current item is using ``capsys`` or ``capfd``, activate
them so they take precedence over the global capture.N)rà  Ú_startrƒ   s    r8   Úactivate_fixtureÚCaptureManager.activate_fixture3  s$   € ð × × Ø×!Ñ!×(Ñ(Õ*ð !r:   c                ó\   • U R                   (       a  U R                   R                  5         gg)zDDeactivate the ``capsys`` or ``capfd`` fixture of this item, if any.N)rà  rÚ   rƒ   s    r8   Údeactivate_fixtureÚ!CaptureManager.deactivate_fixture9  s"   € à× × Ø×!Ñ!×'Ñ'Õ)ð !r:   c                ó\   • U R                   (       a  U R                   R                  5         g g r�   )rà  Ú_suspendrƒ   s    r8   rø  ÚCaptureManager.suspend_fixture>  s"   € Ø× × Ø×!Ñ!×*Ñ*Õ,ð !r:   c                ó\   • U R                   (       a  U R                   R                  5         g g r�   )rà  Ú_resumerƒ   s    r8   rû  ÚCaptureManager.resume_fixtureB  s"   € Ø× × Ø×!Ñ!×)Ñ)Õ+ð !r:   c              #  óì  #   • U R                   =(       a    U R                   R                  5       nU(       a  U R                  5         U R                  =(       a    U R                  R	                  5       nU(       a  U R                  5          Sv •  U(       a  U R                  5         U(       a  U R                  5         gg! U(       a  U R                  5         U(       a  U R                  5         f f = f7f)zLContext manager to temporarily disable global and current fixture capturing.N)rà  Ú_is_startedrø  rß  rÑ  rr   rò  rû  )r„   Ú
do_fixtureÚ	do_globals      r8   Úglobal_and_fixture_disabledÚ*CaptureManager.global_and_fixture_disabledH  s´   é € ð ×*Ñ*×R¨t×/DÑ/D×/PÑ/PÓ/Rˆ
ÞØ× Ñ Ô"Ø×*Ñ*×R¨t×/EÑ/E×/PÑ/PÓ/Rˆ	ÞØ×'Ñ'Ô)ð	&ÛæØ×*Ñ*Ô,ÞØ×#Ñ#Õ%ð øö Ø×*Ñ*Ô,ÞØ×#Ñ#Õ%ð üs   ‚B	C4ÂC  Â0C4Ã 1C1Ã1C4c              #  ó¼  #   • U R                  5         U R                  5          S v •  U R                  5         U R                  SS9  U R	                  5       u  p4UR                  USU5        UR                  USU5        g ! U R                  5         U R                  SS9  U R	                  5       u  p4UR                  USU5        UR                  USU5        f = f7f)NFrõ  rc   rd   )rò  r  r  rr   rt   Úadd_report_section)r„   ÚwhenÚitemry   rz   s        r8   Úitem_captureÚ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Trg   c              #  ól  #   • [        U[        5      (       a�  U R                  5          S v •nU R                  5         U R	                  5       u  p4U(       a  UR
                  R                  SU45        U(       a  UR
                  R                  SU45        U$ S v •nU$ ! U R                  5         f = f7f)NzCaptured stdoutzCaptured stderr)r`   r   rò  rr   rt   ÚsectionsÚappend)r„   Ú	collectorÚrepry   rz   s        r8   Úpytest_make_collect_reportÚ)CaptureManager.pytest_make_collect_reporti  sž   é € ô �i¤×&Ñ&Ø×&Ñ&Ô(ð.Ú�à×+Ñ+Ô-Ø×/Ñ/Ó1‰HˆCÞØ—‘×#Ñ#Ð%6¸Ð$<Ô=ÞØ—‘×#Ñ#Ð%6¸Ð$<Ô=ð ˆ
ò ˆCØˆ
øð ×+Ñ+Õ-üs   ‚&B4©B ­A2B4ÂB1Â1B4c              #  ól   #   • U R                  SU5         S v •sS S S 5        $ ! , (       d  f       g = f7f)NÚsetup©r   ©r„   r  s     r8   Úpytest_runtest_setupÚ#CaptureManager.pytest_runtest_setup|  s#   é € à×Ñ˜w¨Õ-Ú÷ .×-×-üó   ‚4•#™
4£
1­4c              #  ól   #   • U R                  SU5         S v •sS S S 5        $ ! , (       d  f       g = f7f)NÚcallr+  r,  s     r8   Úpytest_runtest_callÚ"CaptureManager.pytest_runtest_call�  s#   é € à×Ñ˜v tÕ,Ú÷ -×,×,ür/  c              #  ól   #   • U R                  SU5         S v •sS S S 5        $ ! , (       d  f       g = f7f)NÚteardownr+  r,  s     r8   Úpytest_runtest_teardownÚ&CaptureManager.pytest_runtest_teardown†  s#   é € à×Ñ˜z¨4Õ0Ú÷ 1×0×0ür/  )Útryfirstc                ó$   • U R                  5         g r�   ©rp   rƒ   s    r8   Úpytest_keyboard_interruptÚ(CaptureManager.pytest_keyboard_interrupt‹  ó   € à×"Ñ"Õ$r:   c                ó$   • U R                  5         g r�   r:  rƒ   s    r8   Úpytest_internalerrorÚ#CaptureManager.pytest_internalerror�  r=  r:   )rà  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Ž   rC  )r%  r   rŽ   z-Generator[None, CollectReport, CollectReport])r  r   rŽ   rC  )"r�   r�   r‘   r’   r¥  rž   rM  ré  ræ  rq   rp   rò  rr   r  r  rt   r  r  r  r  rø  rû  Ú
contextlibÚcontextmanagerr  r   r   r'  r-  r2  r6  r;  r?  r•   r   r:   r8   rm   rm   Ù  s7  † ñô$Aô

ôô$ô1ô
*ô6ö>ö)ô
ô3ô0ô%ô+ô*ô
-ô,ð ×Ñó&ó ð&ð  ×Ñó9ó ð9ñ �dÑðØ"ðà	6óó ðñ$ �dÑóó ðñ �dÑóó ðñ �dÑóó ðñ �tÑó%ó ð%ñ �tÑó%ó ó%r:   rm   c                  ó¢   • \ rS rSrSrSSS.         SS jjrSS jrSS jrSS	 jrSS
 jr	SS jr
SS jr\R                  SS j5       rSrg)ÚCaptureFixturei”  zxObject returned by the :fixture:`capsys`, :fixture:`capsysbinary`,
:fixture:`capfd` and :fixture:`capfdbinary` fixtures.NF©ÚconfigÚ	_ispytestc               óÌ   • [        U5        Xl        X l        U(       a  UO0 U l        S U l        U R                  R
                  U l        U R                  R
                  U l        g r�   )r   Úcaptureclassrç  Ú_configÚ_capturer
  Ú_captured_outÚ_captured_err)r„   rL  rç  rI  rJ  s        r8   rž   ÚCaptureFixture.__init__˜  sQ   € ô 	�yÔ!Ø7CÔØŒÞ!'‘v¨RˆŒØ59ˆŒØ%)×%6Ñ%6×%CÑ%CˆÔØ%)×%6Ñ%6×%CÑ%CˆÕr:   c           	     óÜ   • U R                   c_  [        S U R                  " S0 U R                  D6U R                  " S0 U R                  D6S9U l         U R                   R	                  5         g g )Nr¶  )r'  )r(  )rN  r´  rL  rM  r½  rƒ   s    r8   r
  ÚCaptureFixture._start¨  s\   € Ø�=‰=Ñ Ü(ØØ×%Ò%Ñ8¨4¯<©<Ñ8Ø×%Ò%Ñ8¨4¯<©<Ñ8ñˆDŒMð
 �M‰M×)Ñ)Õ+ð !r:   c                óî   • U R                   bh  U R                   R                  5       u  pU =R                  U-  sl        U =R                  U-  sl        U R                   R	                  5         S U l         g g r�   )rN  rÂ  rO  rP  rÎ  rÁ  s      r8   rÚ   ÚCaptureFixture.close±  s^   € Ø�=‰=Ñ$Ø—}‘}×7Ñ7Ó9‰HˆCØ×Ò #Ñ%ÕØ×Ò #Ñ%ÕØ�M‰M×(Ñ(Ô*Ø ˆD�Mð %r:   c                ó  • U R                   U R                  p!U R                  b$  U R                  R                  5       u  p4X-  nX$-  nU R                  R
                  U l         U R                  R
                  U l        [        X5      $ )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.
)rO  rP  rN  rÀ  rL  r
  r°  )r„   Úcaptured_outÚcaptured_errry   rz   s        r8   rÀ  ÚCaptureFixture.readouterr¹  sx   € ð &*×%7Ñ%7¸×9KÑ9K�lØ�=‰=Ñ$Ø—}‘}×/Ñ/Ó1‰HˆCØÑˆLØÑˆLØ!×.Ñ.×;Ñ;ˆÔØ!×.Ñ.×;Ñ;ˆÔÜ˜\Ó8Ð8r:   c                óT   • U R                   b  U R                   R                  5         gg)z1Suspend this fixture's own capturing temporarily.N)rN  rÆ  rƒ   s    r8   r  ÚCaptureFixture._suspendÊ  s!   € à�=‰=Ñ$Ø�M‰M×+Ñ+Õ-ð %r:   c                óT   • U R                   b  U R                   R                  5         gg)z0Resume this fixture's own capturing temporarily.N)rN  rÉ  rƒ   s    r8   r  ÚCaptureFixture._resumeÏ  s!   € à�=‰=Ñ$Ø�M‰M×*Ñ*Õ,ð %r:   c                óR   • U R                   b  U R                   R                  5       $ g)z5Whether actively capturing -- not disabled or closed.F)rN  rÑ  rƒ   s    r8   r  ÚCaptureFixture._is_startedÔ  s"   € à�=‰=Ñ$Ø—=‘=×+Ñ+Ó-Ð-Ør:   c              #  óÆ   #   • U R                   R                  R                  R                  S5      nUR	                  5          Sv •  SSS5        g! , (       d  f       g= f7f)z>Temporarily disable capturing while inside the ``with`` block.rj   N)rç  rI  rl   Ú	getpluginr  )r„   Ú
capmanagers     r8   ÚdisabledÚCaptureFixture.disabledÚ  sF   é € ð &*§\¡\×%8Ñ%8×%FÑ%F×%PÑ%PØó&
ˆ
ð ×3Ñ3Õ5Û÷ 6×5Ö5üs   ‚A A!ÁAÁ	A!Á
AÁA!)rN  rP  rO  rM  rL  rç  )
rL  ztype[CaptureBase[AnyStr]]rç  r   rI  zdict[str, Any] | NonerJ  r  rŽ   r§   r¦   rØ  r  rB  )r�   r�   r‘   r’   r¥  rž   r
  rÚ   rÀ  r  r  r  rD  rE  rc  r•   r   r:   r8   rG  rG  ”  s‚   † ñ=ð )-ØñDà/ðDð ðDð
 &ðDð ðDð 
õDô ,ô!ô9ô".ô
-ô
ð ×Ñóó ór:   rG  c              #  óþ   #   • U R                   R                  R                  S5      n[        [        U SS9nUR                  U5        UR                  5         Uv •  UR                  5         UR                  5         g7f)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"
rj   T©rJ  N)	rI  rl   ra  rG  r{  r  r
  rÚ   r  ©rç  rx   r  s      r8   Úcapsysrh  ç  sh   é € ð& %Ÿ^™^×9Ñ9×CÑCÐDTÓU€FÜ$¤Z°ÀDÑI€OØ
×Ñ�Ô'Ø×ÑÔØ
ÒØ×ÑÔØ
×ÑÕùó   ‚A;A=c              #  ó  #   • U R                   R                  R                  S5      n[        [        U [        SS9SS9nUR                  U5        UR                  5         Uv •  UR                  5         UR                  5         g7f)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"
rj   Tr=  rH  N)
rI  rl   ra  rG  r{  Údictr  r
  rÚ   r  rg  s      r8   Ú	capteesysrl    ss   é € ð0 %Ÿ^™^×9Ñ9×CÑCÐDTÓU€FÜ$Ü�G¤D¨T¡N¸dñ€Oð ×Ñ�Ô'Ø×ÑÔØ
ÒØ×ÑÔØ
×ÑÕùs   ‚BBc              #  óþ   #   • U R                   R                  R                  S5      n[        [        U SS9nUR                  U5        UR                  5         Uv •  UR                  5         UR                  5         g7f)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"
rj   Trf  N)	rI  rl   ra  rG  rk  r  r
  rÚ   r  rg  s      r8   Úcapsysbinaryrn  &  si   é € ð& %Ÿ^™^×9Ñ9×CÑCÐDTÓU€FÜ$Ô%5°wÈ$ÑO€OØ
×Ñ�Ô'Ø×ÑÔØ
ÒØ×ÑÔØ
×ÑÕùri  c              #  óþ   #   • U R                   R                  R                  S5      n[        [        U SS9nUR                  U5        UR                  5         Uv •  UR                  5         UR                  5         g7f)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"
rj   Trf  N)	rI  rl   ra  rG  r§  r  r
  rÚ   r  rg  s      r8   Úcapfdrp  B  sh   é € ð& %Ÿ^™^×9Ñ9×CÑCÐDTÓU€FÜ$¤Y°À4ÑH€OØ
×Ñ�Ô'Ø×ÑÔØ
ÒØ×ÑÔØ
×ÑÕùri  c              #  óþ   #   • U R                   R                  R                  S5      n[        [        U SS9nUR                  U5        UR                  5         Uv •  UR                  5         UR                  5         g7f)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"

rj   Trf  N)	rI  rl   ra  rG  rž  r  r
  rÚ   r  rg  s      r8   Úcapfdbinaryrr  ^  sh   é € ð( %Ÿ^™^×9Ñ9×CÑCÐDTÓU€FÜ$¤_°gÈÑN€OØ
×Ñ�Ô'Ø×ÑÔØ
ÒØ×ÑÔØ
×ÑÕùri  )r6   r   rŽ   r§   r¦   )r[   r   rŽ   r§   )rv   r   rŽ   rC  )r)   rA  rŽ   zMultiCapture[str])rç  r   rŽ   zGenerator[CaptureFixture[str]])rç  r   rŽ   z Generator[CaptureFixture[bytes]])Sr¥  Ú
__future__r   r%  ÚcollectionsÚcollections.abcr   r   r   rD  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    rA  r9   rA   rE   rf   r{   rO   r}   r—   r«   r¶   ÚABCr	  rA  rŠ   r*  r<  rw  rk  r{  r�  rž  r§  Úversion_infor°  Ú
namedtupler´  rÚ  rm   rG  rh  rl  rn  rp  rr  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M�W˜V‘_ô Mðf 	óó 	ðð6 	óó 	ððD 	óó 	ðð6 	óó 	ðð6 	óó 	ñr:   