+
    -jݏ              	      X   R t ^ RIHt ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHt ^ RI	t	^ RI
t
^ RI
Ht ^ RIt^ RIt^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ^ RIHt ]'       d   ^ RIHt ^ RI H!t! ^ RI H"t" ^ RI#H$t$ ^ RI%H&t& ^ RI'H(t( ^ RI'H)t) ^ RI*H+t+ ^ RI*H,t, ^ RI*H-t- ^ RI.H/t/ ]R],          t0R R  lt1R! R" lt2R# R$ lt3R% R& lt4]"! R'R(7      R) R* l4       t5 ! R+ R,]
Pl                  4      t7 ! R- R.]
Pl                  4      t8 ! R/ R0]84      t9 ! R1 R2]4      t: ! R3 R4]Pv                  ]],          4      t<^ R5^R6^R7/t= ! R8 R9]<]>,          4      t? ! R: R;]<],          4      t@ ! R< R=]@]A,          4      tB ! R> R?]@]>,          4      tC ! R@ RA]<],          4      tD ! RB RC]D]A,          4      tE ! RD RE]D]>,          4      tF]P                  R^8  g	   ]'       d   ] ! RF RG]]],          4      4       tHM& ! RH RG]P                  ! RGRIRJ.4      ]],          4      tH ! RK RL]],          4      tJRM RN ltK ! RO RP4      tL ! RQ RR]],          4      tM](RS RT l4       tN](RU RV l4       tO](RW RX l4       tP](RY RZ l4       tQ](R[ R\ l4       tRR# )_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)CollectReportc                    V ^8  d   QhRRRR/# )   parserr   returnNone )formats   "d/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/lib/python3.14/site-packages/_pytest/capture.py__annotate__r(   1   s      V      c           	         V P                  R 4      pVP                  RRRR. RORR7       VP                  RR	RR
RR7       R# )generalz	--capturestorefdmethodnoz3Per-test capturing method: one of fd|sys|no|tee-sys)actiondefaultmetavarchoiceshelpz-sstore_constcapturezShortcut for --capture=no)r0   constdestr4   Nr-   sysr/   tee-sys)getgroup	addoption
_addoption)r"   groups   & r'   pytest_addoptionr@   1   sW    OOI&E	OO.B   
(  r)   c                   V ^8  d   QhRR/# r!   r#   r$   r%   )r&   s   "r'   r(   r(   D   s      d r)   c                     \         P                  P                  R4      '       d    ^ RIp R# R#   \         d     R# i ; i)zEnsure 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.
win32N)r:   platform
startswithcoloramaImportError)rG   s    r'   _colorama_workaroundrI   D   s:     ||w''	 (  		s   / >>c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r(   S   s      d r)   c                 4     ^ RI p R#   \         d     R# i ; i)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.
N)readlinerH   rL   s    r'   _readline_workaroundrN   S   s     s    c                    V ^8  d   QhRRRR/# )r!   streamr   r#   r$   r%   )r&   s   "r'   r(   r(   d   s     41 41 41D 41r)   c                6  a  \         P                  P                  R4      '       d   \        \         R4      '       d   R# \        S R4      '       g   R# \        S P                  R4      '       d   S P                  P
                  MS P                  p\        V\        P                  4      '       g   R# V 3R lpV! \         P                  R4      \         n	        V! \         P                  R4      \         n
        V! \         P                  R4      \         n        R# )	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.
rD   pypy_version_infoNbufferrawc                >  < \        SP                  R 4      '       g   V^ ,          R8X  d   ^ pMRp\        P                  ! \	        \
        P                  ! V P                  4       4      W4      V P                  V P                  V P                  V P                  4      # )rT   w)hasattrrS   ioTextIOWrapperopenosdupfilenoencodingerrorsnewlinesline_buffering)fmode	bufferingrP   s   && r'   _reopen_stdio3_windowsconsoleio_workaround.<locals>._reopen_stdio   sr    v}}e,,aCII
#T5JJHHJJ
 	
r)   rbwb)r:   rE   rF   rX   rS   rT   
isinstancerY   _WindowsConsoleIOstdinstdoutstderr)rP   
raw_stdoutrf   s   f  r'   _windowsconsoleio_workaroundrp   d   s    0 <<""7++ws<O/P/P 68$$&-fmmU&C&C""Jj""6"677
 cii.CIszz40CJszz40CJr)   Twrapperc                    V ^8  d   QhRRRR/# )r!   early_configr   r#   Generator[None]r%   )r&   s   "r'   r(   r(      s       ? r)   c              #  t  "   V P                   pVP                  R 8X  d   \        \        P                  4       \        4        \        4        V P                  p\        VP                  4      pVP                  VR4       V P                  VP                  4       VP                  4          Rx  VP                  4        R#   TP                  4        i ; i  \         dS    TP                  4       w  rE\        P                  P!                  T4       \        P"                  P!                  T4       h i ; i5i)r-   capturemanagerN)known_args_namespacer6   rp   r:   rm   rI   rN   pluginmanagerCaptureManagerregisteradd_cleanupstop_global_capturingstart_global_capturingsuspend_global_captureBaseExceptionread_global_capturewritern   )rt   nsry   capmanouterrs   &     r'   pytest_load_initial_conftestsr      s     		*	*B	zzT$SZZ0 ..MBJJ'F6#34 V99: !!#		,))+F))+ --/



	s1   B)D8-C 1C D8CC AD55D8c                  F    ] tR t^tRt]R R l4       t]R R l4       tRtR# )EncodedFilec                   V ^8  d   QhRR/# r!   r#   strr%   )r&   s   "r'   r(   EncodedFile.__annotate__   s     ! !c !r)   c                	,    \        V P                  4      # N)reprrS   selfs   &r'   nameEncodedFile.name   s     DKK  r)   c                   V ^8  d   QhRR/# r   r%   )r&   s   "r'   r(   r      s     < <c <r)   c                	    \        V P                  R 4      '       g   Q h\        \        V P                  P                  P                  RR4      4      # )rd   b )rX   rS   r   r   rd   replacer   s   &r'   rd   EncodedFile.mode   s?     t{{F++++C))11#r:;;r)   r%   N)	__name__
__module____qualname____firstlineno__	__slots__propertyr   rd   __static_attributes__r%   r)   r'   r   r      s-    I! !
 < <r)   r   c                  :   a  ] tR t^tR V 3R lltR R ltRtV ;t# )	CaptureIOc                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   CaptureIO.__annotate__   s     Y Y$ Yr)   c                	T   < \         SV `  \        P                  ! 4       R RRR7       R# )UTF-8r   T)r_   newlinewrite_throughN)super__init__rY   BytesIO)r   	__class__s   &r'   r   CaptureIO.__init__   s     SWXr)   c                   V ^8  d   QhRR/# r   r%   )r&   s   "r'   r(   r      s     6 6# 6r)   c                	    \        V P                  \        P                  4      '       g   Q hV P                  P	                  4       P                  R 4      # )r   )rj   rS   rY   r   getvaluedecoder   s   &r'   r   CaptureIO.getvalue   s;    $++rzz2222{{##%,,W55r)   r%   )r   r   r   r   r   r   r   __classcell__r   s   @r'   r   r      s    Y Y6 6r)   r   c                  @   a  ] tR t^tR V 3R lltR V 3R lltRtV ;t# )TeeCaptureIOc                    V ^8  d   QhRRRR/# )r!   otherr   r#   r$   r%   )r&   s   "r'   r(   TeeCaptureIO.__annotate__   s      f  r)   c                	0   < Wn         \        SV `	  4        R # r   )_otherr   r   )r   r   r   s   &&r'   r   TeeCaptureIO.__init__   s    r)   c                    V ^8  d   QhRRRR/# )r!   sr   r#   intr%   )r&   s   "r'   r(   r      s     $ $s $s $r)   c                	X   < \         SV `  V4       V P                  P                  V4      # r   )r   r   r   )r   r   r   s   &&r'   r   TeeCaptureIO.write   s$    a{{  ##r)   )r   )r   r   r   r   r   r   r   r   r   s   @r'   r   r      s     $ $r)   r   c                  .   ] tR t^t]R R l4       tR+R R llt]tR R ltR+R R llt	R	 R
 lt
R R ltR R ltR R ltR R ltR R ltR,R R lltR R ltR R ltR-R R lltR R ltR  R! ltR" R# ltR$ R% ltR& R' lt]R( R) l4       tR*tR# ).DontReadFromInputc                   V ^8  d   QhRR/# r   r%   )r&   s   "r'   r(   DontReadFromInput.__annotate__   s     & &# &r)   c                	^    \         P                  f   Q h\         P                  P                  # r   )r:   	__stdin__r_   r   s   &r'   r_   DontReadFromInput.encoding   s"    }}(((}}%%%r)   c                    V ^8  d   QhRRRR/# )r!   sizer   r#   r   r%   )r&   s   "r'   r(   r      s     
 
 
c 
r)   c                	    \        R 4      hzJpytest: reading from stdin while output is captured!  Consider using `-s`.OSErrorr   r   s   &&r'   readDontReadFromInput.read       X
 	
r)   c                   V ^8  d   QhRR/# r   r%   )r&   s   "r'   r(   r      s      # r)   c                	"    V P                  4       # r   rM   r   s   &r'   __next__DontReadFromInput.__next__   s    }}r)   c                    V ^8  d   QhRRRR/# )r!   hint
int | Noner#   z	list[str]r%   )r&   s   "r'   r(   r      s     
 
j 
) 
r)   c                	    \        R 4      hr   r   )r   r   s   &&r'   	readlinesDontReadFromInput.readlines   r   r)   c                   V ^8  d   QhRR/# )r!   r#   zIterator[str]r%   )r&   s   "r'   r(   r      s      - r)   c                	    V # r   r%   r   s   &r'   __iter__DontReadFromInput.__iter__       r)   c                   V ^8  d   QhRR/# r!   r#   r   r%   )r&   s   "r'   r(   r      s     V V Vr)   c                	    \        R 4      h)z/redirected stdin is pseudofile, has no fileno()r   r   s   &r'   r^   DontReadFromInput.fileno   s    "#TUUr)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r      s     U Ut Ur)   c                	    \        R 4      h)z.redirected stdin is pseudofile, has no flush()r   r   s   &r'   flushDontReadFromInput.flush   s    "#STTr)   c                   V ^8  d   QhRR/# r!   r#   boolr%   )r&   s   "r'   r(   r      s       r)   c                	    R # Fr%   r   s   &r'   isattyDontReadFromInput.isatty       r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r            t r)   c                	    R # r   r%   r   s   &r'   closeDontReadFromInput.close       r)   c                   V ^8  d   QhRR/# r   r%   )r&   s   "r'   r(   r           $ r)   c                	    R # r   r%   r   s   &r'   readableDontReadFromInput.readable  r   r)   c               $    V ^8  d   QhRRRRRR/# )r!   offsetr   whencer#   r%   )r&   s   "r'   r(   r     s&     W W3 W WC Wr)   c                	    \        R 4      h)z0redirected stdin is pseudofile, has no seek(int)r   )r   r   r   s   &&&r'   seekDontReadFromInput.seek  s    "#UVVr)   c                   V ^8  d   QhRR/# r   r%   )r&   s   "r'   r(   r     r   r)   c                	    R # r   r%   r   s   &r'   seekableDontReadFromInput.seekable  r   r)   c                   V ^8  d   QhRR/# r   r%   )r&   s   "r'   r(   r     s     T Tc Tr)   c                	    \        R 4      h)z-redirected stdin is pseudofile, has no tell()r   r   s   &r'   tellDontReadFromInput.tell  s    "#RSSr)   Nc                    V ^8  d   QhRRRR/# )r!   r   r   r#   r   r%   )r&   s   "r'   r(   r     s     < <Z <3 <r)   c                	    \        R 4      h)zcannot truncate stdinr   r   s   &&r'   truncateDontReadFromInput.truncate      "#:;;r)   c                    V ^8  d   QhRRRR/# )r!   datar   r#   r   r%   )r&   s   "r'   r(   r     s     < <# <# <r)   c                	    \        R 4      h)zcannot write to stdinr   r   r  s   &&r'   r   DontReadFromInput.write  r  r)   c                    V ^8  d   QhRRRR/# )r!   lineszIterable[str]r#   r$   r%   )r&   s   "r'   r(   r     s     < < <$ <r)   c                	    \        R 4      h)zCannot write to stdinr   )r   r  s   &&r'   
writelinesDontReadFromInput.writelines  r  r)   c                   V ^8  d   QhRR/# r   r%   )r&   s   "r'   r(   r     r   r)   c                	    R # r   r%   r   s   &r'   writableDontReadFromInput.writable  r   r)   c                   V ^8  d   QhRR/# )r!   r#   r   r%   )r&   s   "r'   r(   r     s      4 r)   c                	    V # r   r%   r   s   &r'   	__enter__DontReadFromInput.__enter__  r   r)   c               (    V ^8  d   QhRRRRRRRR/# )	r!   typeztype[BaseException] | NonevaluezBaseException | None	tracebackzTracebackType | Noner#   r$   r%   )r&   s   "r'   r(   r     s2      ( $ (	
 
r)   c                	    R # r   r%   )r   r$  r%  r&  s   &&&&r'   __exit__DontReadFromInput.__exit__  s     	r)   c                   V ^8  d   QhRR/# )r!   r#   r   r%   )r&   s   "r'   r(   r   &  s       r)   c                	    V # r   r%   r   s   &r'   rS   DontReadFromInput.buffer%  s	     r)   r%   )rW   )    r   )r   r   r   r   r   r_   r   rL   r   r   r   r^   r   r   r   r   r  r  r
  r  r   r  r  r!  r(  rS   r   r%   r)   r'   r   r      s    & &

 H

VUWT<<<  r)   r   c                  H   ] tR tRt$ R]R&   ]P                  R R l4       t]P                  R R l4       t]P                  R R	 l4       t	]P                  R
 R l4       t
]P                  R R l4       t]P                  R R l4       t]P                  R R l4       tRtR# )CaptureBasei.  r   EMPTY_BUFFERc                    V ^8  d   QhRRRR/# r!   r-   r   r#   r$   r%   )r&   s   "r'   r(   CaptureBase.__annotate__2  s     $ $3 $4 $r)   c                	    \        4       hr   NotImplementedErrorr   r-   s   &&r'   r   CaptureBase.__init__1      !##r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r3  6  s     $ $t $r)   c                	    \        4       hr   r5  r   s   &r'   startCaptureBase.start5  r9  r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r3  :  s     $ $d $r)   c                	    \        4       hr   r5  r   s   &r'   doneCaptureBase.done9  r9  r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r3  >  s     $ $ $r)   c                	    \        4       hr   r5  r   s   &r'   suspendCaptureBase.suspend=  r9  r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r3  B  s     $ $ $r)   c                	    \        4       hr   r5  r   s   &r'   resumeCaptureBase.resumeA  r9  r)   c                    V ^8  d   QhRRRR/# )r!   r  r   r#   r$   r%   )r&   s   "r'   r(   r3  F  s     $ $V $ $r)   c                	    \        4       hr   r5  r  s   &&r'   writeorgCaptureBase.writeorgE  r9  r)   c                   V ^8  d   QhRR/# )r!   r#   r   r%   )r&   s   "r'   r(   r3  J  s     $ $f $r)   c                	    \        4       hr   r5  r   s   &r'   snapCaptureBase.snapI  r9  r)   r%   N)r   r   r   r   __annotations__abcabstractmethodr   r<  r@  rD  rH  rL  rP  r   r%   r)   r'   r/  r/  .  s    $ $ 	$ $ 	$ $ 	$ $ 	$ $ 	$ $ 	$ $r)   r/  rl   rm   rn   c                  n    ] tR tRtRtR R ltR R ltR R ltR	 R
 ltR R lt	R R lt
R R ltRtR# )	NoCaptureiQ  r   c                    V ^8  d   QhRRRR/# r2  r%   )r&   s   "r'   r(   NoCapture.__annotate__T  s      3 4 r)   c                	    R # r   r%   r7  s   &&r'   r   NoCapture.__init__T  r   r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   rX  W  r   r)   c                	    R # r   r%   r   s   &r'   r<  NoCapture.startW  r   r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   rX  Z  s      d r)   c                	    R # r   r%   r   s   &r'   r@  NoCapture.doneZ  r   r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   rX  ]  s       r)   c                	    R # r   r%   r   s   &r'   rD  NoCapture.suspend]  r   r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   rX  `  s       r)   c                	    R # r   r%   r   s   &r'   rH  NoCapture.resume`  r   r)   c                   V ^8  d   QhRR/# r   r%   )r&   s   "r'   r(   rX  c  s      c r)   c                	    R # r   r%   r   s   &r'   rP  NoCapture.snapc  s    r)   c                    V ^8  d   QhRRRR/# r!   r  r   r#   r$   r%   )r&   s   "r'   r(   rX  f  s      S T r)   c                	    R # r   r%   r  s   &&r'   rL  NoCapture.writeorgf  r   r)   r%   N)r   r   r   r   r0  r   r<  r@  rD  rH  rP  rL  r   r%   r)   r'   rV  rV  Q  s/    L r)   rV  c                      ] tR tRtRRR/R R llltR R ltR	 R
 ltR R ltR R ltR R lt	R R lt
R R ltRtR# )SysCaptureBaseij  NteeFc               (    V ^8  d   QhRRRRRRRR/# )	r!   r-   r   tmpfilezTextIO | Nonerq  r   r#   r$   r%   )r&   s   "r'   r(   SysCaptureBase.__annotate__k  s,     $ $$ -$>B$	$r)   c               	    \         V,          p\        \        V4      V n        W@n        Vf:   VR8X  d   \        4       pM'V'       g   \        4       M\        V P                  4      pW n        RV n	        R # )Nrl   initialized)
patchsysdictgetattrr:   _oldr   r   r   r   rs  _state)r   r-   rs  rq  r   s   &&&$ r'   r   SysCaptureBase.__init__k  sU     B#C.		?w+--0)+l4996M#r)   c                    V ^8  d   QhRRRR/# )r!   
class_namer   r#   r%   )r&   s   "r'   r(   rt  y  s     
 
s 
s 
r)   c                	    R P                  TV P                  \        V R4      ;'       d    \        V P                  4      ;'       g    RV P
                  V P                  4      # z(<{} {} _old={} _state={!r} tmpfile={!r}>ry  z<UNSET>)r&   r   rX   r   ry  rz  rs  )r   r}  s   &&r'   r   SysCaptureBase.repry  sO    9@@IIT6"66tDIIDD9KKLL
 	
r)   c                   V ^8  d   QhRR/# r   r%   )r&   s   "r'   r(   rt    s     
 
# 
r)   c                	    R P                  V P                  P                  V P                  \	        V R4      ;'       d    \        V P                  4      ;'       g    RV P                  V P                  4      # r  )	r&   r   r   r   rX   r   ry  rz  rs  r   s   &r'   __repr__SysCaptureBase.__repr__  sY    9@@NN##IIT6"66tDIIDD9KKLL
 	
r)   c               $    V ^8  d   QhRRRRRR/# r!   opr   statesztuple[str, ...]r#   r$   r%   )r&   s   "r'   r(   rt    !     
 
 
_ 
 
r)   c                	    V P                   V9   g1   Q R P                  WP                   RP                  V4      4      4       hR# z+cannot {} in state {!r}: expected one of {}z, Nrz  r&   joinr   r  r  s   &&&r'   _assert_stateSysCaptureBase._assert_state  ;    {{f$ 	
9@@KK6!2	
$r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   rt    s        t  r)   c                	    V P                  R R4       \        \        V P                  V P                  4       RV n        R# )r<  startedNrv  )r  setattrr:   r   rs  rz  r   s   &r'   r<  SysCaptureBase.start  s.    7$45TYY-r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   rt    s      d r)   c                	    V P                  R R4       V P                  R 8X  d   R# \        \        V P                  V P
                  4       V =V P                  P                  4        R V n        R# )r@  Nrv  r  	suspendedr@  )r  rz  r  r:   r   ry  rs  r   r   s   &r'   r@  SysCaptureBase.done  sR    6#RS;;& TYY		*Ir)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   rt    s     " " "r)   c                	    V P                  R R4       \        \        V P                  V P                  4       RV n        R# rD  r  Nr  r  )r  r  r:   r   ry  rz  r   s   &r'   rD  SysCaptureBase.suspend  s.    9&>?TYY		*!r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   rt    s          r)   c                	    V P                  R R4       V P                  R8X  d   R# \        \        V P                  V P
                  4       RV n        R# rH  r  Nr  )r  rz  r  r:   r   rs  r   s   &r'   rH  SysCaptureBase.resume  s=    8%=>;;)#TYY-r)   )ry  rz  r   rs  r   )r   r   r   r   r   r   r  r  r<  r@  rD  rH  r   r%   r)   r'   rp  rp  j  s<    $EJ$ $


 
"
   r)   rp  c                  2    ] tR tRtRtR R ltR R ltRtR# )	SysCaptureBinaryi  r)   c                   V ^8  d   QhRR/# r!   r#   bytesr%   )r&   s   "r'   r(   SysCaptureBinary.__annotate__        e r)   c                	   V P                  R R4       V P                  P                  ^ 4       V P                  P                  P	                  4       pV P                  P                  ^ 4       V P                  P                  4        V# rP  r  r  rs  r  rS   r   r  r   ress   & r'   rP  SysCaptureBinary.snap  d    6#;<!ll!!&&(!
r)   c                    V ^8  d   QhRRRR/# r!   r  r  r#   r$   r%   )r&   s   "r'   r(   r    s     ! !U !t !r)   c                	    V P                  R R4       V P                  P                  4        V P                  P                  P	                  V4       V P                  P                  P                  4        R# rL  Nr  )r  ry  r   rS   r   r  s   &&r'   rL  SysCaptureBinary.writeorg  sO    :'?@				t$		 r)   r%   Nr   r   r   r   r0  rP  rL  r   r%   r)   r'   r  r    s    L! !r)   r  c                  2    ] tR tRtRtR R ltR R ltRtR# )	
SysCapturei  r   c                   V ^8  d   QhRR/# r   r%   )r&   s   "r'   r(   SysCapture.__annotate__        c r)   c                	   V P                  R R4       \        V P                  \        4      '       g   Q hV P                  P	                  4       pV P                  P                  ^ 4       V P                  P                  4        V# r  )r  rj   rs  r   r   r  r  r  s   & r'   rP  SysCapture.snap  sc    6#;<$,,	2222ll##%!
r)   c                    V ^8  d   QhRRRR/# rl  r%   )r&   s   "r'   r(   r    s      S T r)   c                	    V P                  R R4       V P                  P                  V4       V P                  P                  4        R# r  )r  ry  r   r   r  s   &&r'   rL  SysCapture.writeorg  s1    :'?@				r)   r%   Nr  r%   r)   r'   r  r    s    L r)   r  c                  j    ] tR tRtR R ltR R ltR R ltR R	 ltR
 R ltR R lt	R R lt
RtR# )FDCaptureBasei  c                    V ^8  d   QhRRRR/# )r!   targetfdr   r#   r$   r%   )r&   s   "r'   r(   FDCaptureBase.__annotate__  s     '$ '$ '$ '$r)   c                	   Wn          \        P                  ! V4       R V n        \        P                  ! V4      V n
        V^ 8X  d2   \        \        P                  RR7      V n        \        V4      V n        MU\        \        ^ R7      RRRRR7      V n        V\         9   d   \        WP                  4      V n        M\#        V4      V n        RV n        R #   \         d^    \        P
                  ! \        P                  \        P                  4      T n        \        P                  ! T P                  T4        ELi ; i)	Nutf-8)r_   )re   r   r   T)r_   r`   r   r   rv  )r  r\   fstattargetfd_invalidr   r[   devnullO_RDWRdup2r]   targetfd_savers  r  
syscapturer   r   rw  rV  rz  )r   r  s   &&r'   r   FDCaptureBase.__init__  s     	)HHX  %)D!VVH-q=

W=DL0:80DDO&*  "DL <'",X||"D"+H"5#E  	5 13

BII0ND!GGD))84	5s   C A$D>=D>c                   V ^8  d   QhRR/# r   r%   )r&   s   "r'   r(   r         
 
# 
r)   c                	    R V P                   P                   RV P                   RV P                   RV P                  : RV P
                  : R2# )< z oldfd= _state=z	 tmpfile=>)r   r   r  r  rz  rs  r   s   &r'   r  FDCaptureBase.__repr__  sR    ''($--@R@R?S Tkk_Idll-=Q@	
r)   c               $    V ^8  d   QhRRRRRR/# r  r%   )r&   s   "r'   r(   r     r  r)   c                	    V P                   V9   g1   Q R P                  WP                   RP                  V4      4      4       hR# r  r  r  s   &&&r'   r  FDCaptureBase._assert_state   r  r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r    s        t  r)   c                    V P                  RR4       \        P                  ! V P                  P	                  4       V P
                  4       V P                  P                  4        RV n        R# )z4Start capturing on targetfd using memorized tmpfile.r<  r  Nr  )	r  r\   r  rs  r^   r  r  r<  rz  r   s   &r'   r<  FDCaptureBase.start  sI    7$45
##%t}}5r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r    s      d r)   c                .   V P                  RR4       V P                  R8X  d   R# \        P                  ! V P                  V P
                  4       \        P                  ! V P                  4       V P                  e\   V P                  V P
                  8w  d!   \        P                  ! V P
                  4       \        P                  ! V P                  4       V P                  P                  4        V P                  P                  4        RV n        R# )zWStop capturing, restore streams, return original capture file,
seeked to position zero.r@  Nr  )r  rz  r\   r  r  r  r   r  r  r@  rs  r   s   &r'   r@  FDCaptureBase.done  s     	6#RS;;& 
""DMM2
##$  ,$$5'HHT**+r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r    s     " " "r)   c                	    V P                  R R4       V P                  R8X  d   R# V P                  P                  4        \        P
                  ! V P                  V P                  4       RV n        R# r  )r  rz  r  rD  r\   r  r  r  r   s   &r'   rD  FDCaptureBase.suspend  sQ    9&>?;;+%!
""DMM2!r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r  &  s          r)   c                	   V P                  R R4       V P                  R8X  d   R# V P                  P                  4        \        P
                  ! V P                  P                  4       V P                  4       RV n        R# r  )	r  rz  r  rH  r\   r  rs  r^   r  r   s   &r'   rH  FDCaptureBase.resume&  sX    8%=>;;)# 
##%t}}5r)   )rz  r  r  r  r  rs  N)r   r   r   r   r   r  r  r<  r@  rD  rH  r   r%   r)   r'   r  r    s+    '$R

  "   r)   r  c                  6    ] tR tRtRtRtR R ltR R ltRtR	# )
FDCaptureBinaryi/  zOCapture IO to/from a given OS-level file descriptor.

snap() produces `bytes`.
r)   c                   V ^8  d   QhRR/# r  r%   )r&   s   "r'   r(   FDCaptureBinary.__annotate__7  r  r)   c                	   V P                  R R4       V P                  P                  ^ 4       V P                  P                  P	                  4       pV P                  P                  ^ 4       V P                  P                  4        V# r  r  r  s   & r'   rP  FDCaptureBinary.snap7  r  r)   c                    V ^8  d   QhRRRR/# r  r%   )r&   s   "r'   r(   r  ?  s     + +U +t +r)   c                l    V P                  RR4       \        P                  ! V P                  V4       R# )"Write to original file descriptor.rL  Nr  )r  r\   r   r  r  s   &&r'   rL  FDCaptureBinary.writeorg?  s'    :'?@
##T*r)   r%   N	r   r   r   r   __doc__r0  rP  rL  r   r%   r)   r'   r  r  /  s    
 L+ +r)   r  c                  6    ] tR tRtRtRtR R ltR R ltRtR	# )
	FDCaptureiE  zLCapture IO to/from a given OS-level file descriptor.

snap() produces text.
r   c                   V ^8  d   QhRR/# r   r%   )r&   s   "r'   r(   FDCapture.__annotate__M  r  r)   c                	    V P                  R R4       V P                  P                  ^ 4       V P                  P                  4       pV P                  P                  ^ 4       V P                  P	                  4        V# r  )r  rs  r  r   r  r  s   & r'   rP  FDCapture.snapM  s^    6#;<!ll!!
r)   c                    V ^8  d   QhRRRR/# rl  r%   )r&   s   "r'   r(   r  U  s     ; ;S ;T ;r)   c                    V P                  RR4       \        P                  ! V P                  VP	                  R4      4       R# )r  rL  r  Nr  )r  r\   r   r  encoder  s   &&r'   rL  FDCapture.writeorgU  s0    :'?@
##T[[%9:r)   r%   Nr  r%   r)   r'   r  r  E  s    
 L; ;r)   r  c                  0    ] tR tRt$ RtR]R&   R]R&   RtR# )CaptureResultib  OThe result of :method:`caplog.readouterr() <pytest.CaptureFixture.readouterr>`.r   r   r   r%   N)r   r   r   r   r  rR  r   r%   r)   r'   r  r  b  s    ]r)   r  c                      ] tR tRtRtRtRtR# )r  ik  r  r%   N)r   r   r   r   r  r   r   r%   r)   r'   r  r  k  s     	^	r)   r   r   c                      ] tR tRtRtRtR R ltR R ltR R	 ltR
 R lt	RR R llt
R R ltR R ltR R ltR R ltRtR# )MultiCaptureit  NFc               (    V ^8  d   QhRRRRRRRR/# )r!   in_zCaptureBase[AnyStr] | Noner   r   r#   r$   r%   )r&   s   "r'   r(   MultiCapture.__annotate__x  s2     3 3'3 (3 (	3
 
3r)   c                	*    Wn         W n        W0n        R # r   r  r   r   )r   r  r   r   s   &&&&r'   r   MultiCapture.__init__x  s     03/2/2r)   c                   V ^8  d   QhRR/# r   r%   )r&   s   "r'   r(   r    r  r)   c                	    R V P                   : RV P                  : RV P                  : RV P                  : RV P                  : R2# )z<MultiCapture out=z err=z in_=r  z _in_suspended=r  )r   r   r  rz  _in_suspendedr   s   &r'   r  MultiCapture.__repr__  sJ     E$((U488, Okk_OD4F4F3IL	
r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r    s       r)   c                	    R V n         V P                  '       d   V P                  P                  4        V P                  '       d   V P                  P                  4        V P                  '       d   V P                  P                  4        R# R# )r  N)rz  r  r<  r   r   r   s   &r'   start_capturingMultiCapture.start_capturing  sS    888HHNN888HHNN888HHNN r)   c                   V ^8  d   QhRR/# )r!   r#   ztuple[AnyStr, AnyStr]r%   )r&   s   "r'   r(   r    s     	 	$9 	r)   c                    V P                  4       w  rV'       d,   V P                  f   Q hV P                  P                  V4       V'       d,   V P                  f   Q hV P                  P                  V4       W3# )z?Pop current snapshot out/err capture and flush to orig streams.)
readouterrr   rL  r   r   r   r   s   &  r'   pop_outerr_to_origMultiCapture.pop_outerr_to_orig  sa    ??$88'''HHc"88'''HHc"xr)   c                    V ^8  d   QhRRRR/# r!   r  r   r#   r$   r%   )r&   s   "r'   r(   r    s     & &T &d &r)   c                	B   R V n         V P                  '       d   V P                  P                  4        V P                  '       d   V P                  P                  4        V'       d8   V P                  '       d$   V P                  P                  4        RV n        R# R# R# )r  TN)rz  r   rD  r   r  r  r   r  s   &&r'   suspend_capturingMultiCapture.suspend_capturing  se    !888HH888HH4888HH!%D 3r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r    s     	' 	'$ 	'r)   c                	N   R V n         V P                  '       d   V P                  P                  4        V P                  '       d   V P                  P                  4        V P                  '       d4   V P
                  f   Q hV P
                  P                  4        RV n        R# R# )r  NF)rz  r   rH  r   r  r  r   s   &r'   resume_capturingMultiCapture.resume_capturing  sn    888HHOO888HHOO88'''HHOO!&D r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r    s     
 
 
r)   c                X   V P                   R8X  d   \        R4      hRV n         V P                  '       d   V P                  P                  4        V P                  '       d   V P                  P                  4        V P
                  '       d   V P
                  P                  4        R# R# )z+Stop capturing and reset capturing streams.stoppedzwas already stoppedN)rz  
ValueErrorr   r@  r   r  r   s   &r'   stop_capturingMultiCapture.stop_capturing  sh    ;;)#233888HHMMO888HHMMO888HHMMO r)   c                   V ^8  d   QhRR/# r   r%   )r&   s   "r'   r(   r    s     ( (D (r)   c                     V P                   R8H  # )z7Whether actively capturing -- not suspended or stopped.r  )rz  r   s   &r'   
is_startedMultiCapture.is_started  s    {{i''r)   c                   V ^8  d   QhRR/# r!   r#   zCaptureResult[AnyStr]r%   )r&   s   "r'   r(   r    s     ' '1 'r)   c                	    V P                   '       d   V P                   P                  4       MR pV P                  '       d   V P                  P                  4       MR p\        W4      # ri  )r   rP  r   r  r  s   &  r'   r  MultiCapture.readouterr  s?    !%dhhmmor!%dhhmmorS&&r)   )r  rz  r   r  r   r   )r   r   r   r   rz  r  r   r  r  r  r  r"  r(  r,  r  r   r%   r)   r'   r  r  t  s>    FM3
	&	'
(' 'r)   r  c                    V ^8  d   QhRRRR/# )r!   r.   _CaptureMethodr#   zMultiCapture[str]r%   )r&   s   "r'   r(   r(     s     > >n >1B >r)   c           	     `   V R 8X  d*   \        \        ^ 4      \        ^4      \        ^4      R7      # V R8X  d*   \        \        ^ 4      \        ^4      \        ^4      R7      # V R8X  d   \        RRRR7      # V R8X  d%   \        R\        ^RR7      \        ^RR7      R7      # \        RV : 24      h)	r-   r
  r:   r/   Nr;   Trq  zunknown capturing method: )r  r  r  r'  )r.   s   &r'   _get_multicapturer6    s    ~	!)A,IaLQQ	5
1:a=jQRmTT	4$D99	9	*QD1z!7N
 	
 1&<
==r)   c                     ] tR tRtRtR R ltR R ltR R ltR	 R
 ltR R lt	R R lt
R R ltR:R R lltR:R R lltR R ltR R ltR R ltR R ltR R ltR R  ltR! R" ltR# R$ lt]P.                  R% R& l4       t]P.                  R' R( l4       t]! R)R*7      R+ R, l4       t]! R)R*7      R- R. l4       t]! R)R*7      R/ R0 l4       t]! R)R*7      R1 R2 l4       t]! R)R37      R4 R5 l4       t]! R)R37      R6 R7 l4       t R8t!R9# );rz   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                    V ^8  d   QhRRRR/# )r!   r.   r3  r#   r$   r%   )r&   s   "r'   r(   CaptureManager.__annotate__  s     A A~ A$ Ar)   c                	.    Wn         R V n        R V n        R # r   _method_global_capturing_capture_fixture)r   r.   s   &&r'   r   CaptureManager.__init__  s    $;?<@r)   c                   V ^8  d   QhRR/# r   r%   )r&   s   "r'   r(   r9    r  r)   c                	\    R V P                   : RV P                  : RV P                  : R2# )z<CaptureManager _method=z _global_capturing=z _capture_fixture=r  r;  r   s   &r'   r  CaptureManager.__repr__  s:    &t||&66I$J`J`Ic d  $ 5 58;	
r)   c                   V ^8  d   QhRR/# )r!   r#   z
str | boolr%   )r&   s   "r'   r(   r9    s      j r)   c                	    V P                  4       '       d   R # V P                  '       d$   RV P                  P                  P                   2# R# )globalzfixture F)is_globally_capturingr>  requestfixturenamer   s   &r'   is_capturingCaptureManager.is_capturing  sC    %%''   d33;;GGHIIr)   c                   V ^8  d   QhRR/# r   r%   )r&   s   "r'   r(   r9     s     $ $t $r)   c                	     V P                   R 8g  # )r/   )r<  r   s   &r'   rF  $CaptureManager.is_globally_capturing   s    ||t##r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r9    s     1 1 1r)   c                	    V P                   e   Q h\        V P                  4      V n         V P                   P                  4        R # r   )r=  r6  r<  r  r   s   &r'   r~   %CaptureManager.start_global_capturing  s7    %%---!24<<!@..0r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r9    s     * *t *r)   c                	    V P                   e>   V P                   P                  4        V P                   P                  4        R V n         R # R # r   )r=  r  r(  r   s   &r'   r}   $CaptureManager.stop_global_capturing  s?    !!-""557""113%)D" .r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r9    s     6 6t 6r)   c                	Z    V P                   e   V P                   P                  4        R # R # r   )r=  r"  r   s   &r'   resume_global_capture$CaptureManager.resume_global_capture  s'     !!-""335 .r)   c                    V ^8  d   QhRRRR/# r  r%   )r&   s   "r'   r(   r9    s     > >$ >4 >r)   c                	^    V P                   e   V P                   P                  VR7       R # R # )Nr  )r=  r  r  s   &&r'   r   %CaptureManager.suspend_global_capture  s*    !!-""444= .r)   c                    V ^8  d   QhRRRR/# r  r%   )r&   s   "r'   r(   r9    s     ) )4 )D )r)   c                	H    V P                  4        V P                  V4       R # r   )suspend_fixturer   r  s   &&r'   rD  CaptureManager.suspend  s    ##C(r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r9    s       r)   c                	F    V P                  4        V P                  4        R # r   )rV  resume_fixturer   s   &r'   rH  CaptureManager.resume  s    ""$r)   c                   V ^8  d   QhRR/# )r!   r#   zCaptureResult[str]r%   )r&   s   "r'   r(   r9  !  s     3 3%7 3r)   c                	V    V P                   f   Q hV P                   P                  4       # r   )r=  r  r   s   &r'   r   "CaptureManager.read_global_capture!  s)    %%111%%0022r)   c                    V ^8  d   QhRRRR/# )r!   capture_fixturezCaptureFixture[Any]r#   r$   r%   )r&   s   "r'   r(   r9  '  s     0 0+> 04 0r)   c                	    V P                   '       dY   V P                   P                  P                  pVP                  P                  pVP                  P                  R V RV R24       Wn         R# )zcannot use z and z at the same timeN)r>  rG  rH  
raiseerror)r   rh  current_fixturerequested_fixtures   &&  r'   set_fixtureCaptureManager.set_fixture'  si       "33;;GGO / 7 7 C C##../0o5FFWX !0r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r9  0  s     % %t %r)   c                	    R V n         R # r   )r>  r   s   &r'   unset_fixtureCaptureManager.unset_fixture0  s
     $r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r9  3  s     + +$ +r)   c                b    V P                   '       d   V P                   P                  4        R# R# )ztIf the current item is using ``capsys`` or ``capfd``, activate
them so they take precedence over the global capture.N)r>  _startr   s   &r'   activate_fixtureCaptureManager.activate_fixture3  s'        !!((* !r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r9  9  s     * *D *r)   c                b    V P                   '       d   V P                   P                  4        R# R# )zDDeactivate the ``capsys`` or ``capfd`` fixture of this item, if any.N)r>  r   r   s   &r'   deactivate_fixture!CaptureManager.deactivate_fixture9  s%       !!'') !r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r9  >  s     - - -r)   c                	b    V P                   '       d   V P                   P                  4        R # R # r   )r>  _suspendr   s   &r'   r^  CaptureManager.suspend_fixture>  s%       !!**, !r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r9  B  s     , , ,r)   c                	b    V P                   '       d   V P                   P                  4        R # R # r   )r>  _resumer   s   &r'   rb  CaptureManager.resume_fixtureB  s%       !!))+ !r)   c                   V ^8  d   QhRR/# r!   r#   ru   r%   )r&   s   "r'   r(   r9  I  s     & &_ &r)   c              #     "   V P                   ;'       d    V P                   P                  4       pV'       d   V P                  4        V P                  ;'       d    V P                  P	                  4       pV'       d   V P                  4         Rx  V'       d   V P                  4        V'       d   V P                  4        R# R#   T'       d   T P                  4        T'       d   T P                  4        i i ; i5i)zLContext manager to temporarily disable global and current fixture capturing.N)r>  _is_startedr^  r=  r,  r   rV  rb  )r   
do_fixture	do_globals   &  r'   global_and_fixture_disabled*CaptureManager.global_and_fixture_disabledH  s      **RRt/D/D/P/P/R
  "**RRt/E/E/P/P/R	'')	&**,##%  **,##% s:   6C>"C>"C>?C>C C>4C> C;)C;;C>c               $    V ^8  d   QhRRRRRR/# )r!   whenr   itemr   r#   ru   r%   )r&   s   "r'   r(   r9  Z  s!     9 9 9D 9_ 9r)   c              #  	  "   V P                  4        V P                  4         R x  V P                  4        V P                  RR7       V P	                  4       w  r4VP                  VRV4       VP                  VRV4       R #   T P                  4        T P                  RR7       T P	                  4       w  r4TP                  TRT4       TP                  TRT4       i ; i5i)NFrZ  rm   rn   )rV  rv  rz  r   r   add_report_section)r   r  r  r   r   s   &&&  r'   item_captureCaptureManager.item_captureY  s     ""$	9##%''E'2//1HC##D(C8##D(C8 ##%''E'2//1HC##D(C8##D(C8s   !C#B AC#AC  C#Trq   c                    V ^8  d   QhRRRR/# )r!   	collectorr   r#   z-Generator[None, CollectReport, CollectReport]r%   )r&   s   "r'   r(   r9  j  s      "	6r)   c              #  	r  "   \        V\        4      '       d   V P                  4         R x pV P                  4        V P	                  4       w  r4V'       d   VP
                  P                  RV34       V'       d   VP
                  P                  RV34       V# R x pV#   T P                  4        i ; i5i)NzCaptured stdoutzCaptured stderr)rj   r   rV  r   r   sectionsappend)r   r  repr   r   s   &&   r'   pytest_make_collect_report)CaptureManager.pytest_make_collect_reporti  s      i&&&&(.++-//1HC##%6$<=##%6$<= 
 C
 ++-s"   'B7B" AB7=%B7"B44B7c                    V ^8  d   QhRRRR/# r!   r  r   r#   ru   r%   )r&   s   "r'   r(   r9  }  s       / r)   c              #  	   "   V P                  R V4      ;_uu_ 4        Rx uuRRR4       #   + '       g   i     R# ; i5i)setupNr  r   r  s   &&r'   pytest_runtest_setup#CaptureManager.pytest_runtest_setup|  s)     w-- .---   A ,A =		A c                    V ^8  d   QhRRRR/# r  r%   )r&   s   "r'   r(   r9    s        r)   c              #  	   "   V P                  R V4      ;_uu_ 4        Rx uuRRR4       #   + '       g   i     R# ; i5i)callNr  r  s   &&r'   pytest_runtest_call"CaptureManager.pytest_runtest_call  s)     vt,, -,,,r  c                    V ^8  d   QhRRRR/# r  r%   )r&   s   "r'   r(   r9    s      D _ r)   c              #  	   "   V P                  R V4      ;_uu_ 4        Rx uuRRR4       #   + '       g   i     R# ; i5i)teardownNr  r  s   &&r'   pytest_runtest_teardown&CaptureManager.pytest_runtest_teardown  s)     z400 1000r  )tryfirstc                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r9    s     % %4 %r)   c                	&    V P                  4        R # r   r}   r   s   &r'   pytest_keyboard_interrupt(CaptureManager.pytest_keyboard_interrupt      ""$r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r9    s     % %d %r)   c                	&    V P                  4        R # r   r  r   s   &r'   pytest_internalerror#CaptureManager.pytest_internalerror  r  r)   )r>  r=  r<  Nr   )"r   r   r   r   r  r   r  rI  rF  r~   r}   rV  r   rD  rH  r   rm  rq  rv  rz  r^  rb  
contextlibcontextmanagerr  r  r   r  r  r  r  r  r  r   r%   r)   r'   rz   rz     s'   $A

$1
*6>)
30%+*
-, & &  9 9 d $ d  d  d  t% % t% %r)   rz   c                      ] tR tRtRtRRRR/R R lltR	 R
 ltR R ltR R ltR R lt	R R lt
R R lt]P                  R R l4       tRtR# )CaptureFixturei  zxObject returned by the :fixture:`capsys`, :fixture:`capsysbinary`,
:fixture:`capfd` and :fixture:`capfdbinary` fixtures.configN	_ispytestFc          
     ,    V ^8  d   QhRRRRRRRRR	R
/# )r!   captureclassztype[CaptureBase[AnyStr]]rG  r   r  zdict[str, Any] | Noner  r   r#   r$   r%   )r&   s   "r'   r(   CaptureFixture.__annotate__  sC     D D/D D
 &D D 
Dr)   c               	    \        V4       Wn        W n        V'       d   TM/ V n        R V n        V P                  P
                  V n        V P                  P
                  V n        R # r   )r   r  rG  _config_capturer0  _captured_out_captured_err)r   r  rG  r  r  s   &&&$$r'   r   CaptureFixture.__init__  sQ     	y!7C!'vR59%)%6%6%C%C%)%6%6%C%Cr)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r    s     , , ,r)   c           	     	    V P                   fd   \        R V P                  ! R/ V P                  B V P                  ! R/ V P                  B R7      V n         V P                   P	                  4        R # R # )Nr
  )   )r!   )r  r  r  r  r  r   s   &r'   ru  CaptureFixture._start  s\    == (%%84<<8%%84<<8DM
 MM))+ !r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r    s     ! !t !r)   c                	   V P                   er   V P                   P                  4       w  rV ;P                  V,          un        V ;P                  V,          un        V P                   P	                  4        R V n         R # R # r   )r  r  r  r  r(  r  s   &  r'   r   CaptureFixture.close  s^    ==$}}779HC#%#%MM((* DM %r)   c                   V ^8  d   QhRR/# r/  r%   )r&   s   "r'   r(   r    s     9 91 9r)   c                &   V P                   V P                  r!V P                  e-   V P                  P                  4       w  r4W,          pW$,          pV P                  P
                  V n         V P                  P
                  V n        \        W4      # )zRead 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  r  r  r0  r  )r   captured_outcaptured_errr   r   s   &    r'   r  CaptureFixture.readouterr  sx     &*%7%79K9Kl==$}}//1HCLL!..;;!..;;\88r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r    s     . .$ .r)   c                Z    V P                   e   V P                   P                  4        R# R# )z1Suspend this fixture's own capturing temporarily.N)r  r  r   s   &r'   r~  CaptureFixture._suspend  s!    ==$MM++- %r)   c                   V ^8  d   QhRR/# rB   r%   )r&   s   "r'   r(   r    s     - - -r)   c                Z    V P                   e   V P                   P                  4        R# R# )z0Resume this fixture's own capturing temporarily.N)r  r"  r   s   &r'   r  CaptureFixture._resume  s!    ==$MM**, %r)   c                   V ^8  d   QhRR/# r   r%   )r&   s   "r'   r(   r    s      T r)   c                V    V P                   e   V P                   P                  4       # R# )z5Whether actively capturing -- not disabled or closed.F)r  r,  r   s   &r'   r  CaptureFixture._is_started  s"    ==$==++--r)   c                   V ^8  d   QhRR/# r  r%   )r&   s   "r'   r(   r    s      / r)   c              #     "   V P                   P                  P                  P                  R4      pVP	                  4       ;_uu_ 4        Rx  RRR4       R#   + '       g   i     R# ; i5i)z>Temporarily disable capturing while inside the ``with`` block.rw   N)rG  r  ry   	getpluginr  )r   
capmanagers   & r'   disabledCaptureFixture.disabled  sL      &*\\%8%8%F%F%P%P&

 3355 6555s   AA-
A
A-A*	$	A-)r  r  r  r  r  rG  )r   r   r   r   r  r   ru  r   r  r~  r  r  r  r  r  r   r%   r)   r'   r  r    s[    =D
 )-D  D ,!9".
-
  r)   r  c                    V ^8  d   QhRRRR/# r!   rG  r   r#   zGenerator[CaptureFixture[str]]r%   )r&   s   "r'   r(   r(     s      J #A r)   c              #    "   V P                   P                  P                  R4      p\        \        V RR7      pVP                  V4       VP                  4        Vx  VP                  4        VP                  4        R# 5i)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"
rw   Tr  N)	r  ry   r  r  r  rm  ru  r   rq  rG  r   rh  s   &  r'   capsysr    sh     & %^^99CCDTUF$ZDIO
'

   A?Bc                    V ^8  d   QhRRRR/# r  r%   )r&   s   "r'   r(   r(     s      z &D r)   c              #    "   V P                   P                  P                  R4      p\        \        V \        RR7      RR7      pVP                  V4       VP                  4        Vx  VP                  4        VP                  4        R# 5i)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"
rw   Tr5  )r  r  N)
r  ry   r  r  r  dictrm  ru  r   rq  r  s   &  r'   	capteesysr    ss     0 %^^99CCDTUF$GDTNdO '

s   B
Bc                    V ^8  d   QhRRRR/# r!   rG  r   r#   z Generator[CaptureFixture[bytes]]r%   )r&   s   "r'   r(   r(   '  s      * )I r)   c              #    "   V P                   P                  P                  R4      p\        \        V RR7      pVP                  V4       VP                  4        Vx  VP                  4        VP                  4        R# 5i)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"
rw   Tr  N)	r  ry   r  r  r  rm  ru  r   rq  r  s   &  r'   capsysbinaryr  &  si     & %^^99CCDTUF$%5w$OO
'

r  c                    V ^8  d   QhRRRR/# r  r%   )r&   s   "r'   r(   r(   C  s      : "@ r)   c              #    "   V P                   P                  P                  R4      p\        \        V RR7      pVP                  V4       VP                  4        Vx  VP                  4        VP                  4        R# 5i)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"
rw   Tr  N)	r  ry   r  r  r  rm  ru  r   rq  r  s   &  r'   capfdr  B  sh     & %^^99CCDTUF$Y4HO
'

r  c                    V ^8  d   QhRRRR/# r  r%   )r&   s   "r'   r(   r(   _  s       (H r)   c              #    "   V P                   P                  P                  R4      p\        \        V RR7      pVP                  V4       VP                  4        Vx  VP                  4        VP                  4        R# 5i)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"

rw   Tr  N)	r  ry   r  r  r  rm  ru  r   rq  r  s   &  r'   capfdbinaryr  ^  sh     ( %^^99CCDTUF$_gNO
'

r  r9   )      )Sr  
__future__r   rS  collectionscollections.abcr   r   r   r  rY   r   r\   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   r3  r@   rI   rN   rp   r   rZ   r   r   r   r   ABCr/  rw  r   rV  rp  r  r  r  r  r  r  version_infor  
namedtupler  r6  rz   r  r  r  r  r  r  r%   r)   r'   <module>r
     s   1 " 
  % $ $  	 # 	 
 "              & ! # , - $ ' #   ) 56&"41n 
$ <<""" <"6   6$9 $J J`$#''76? $@ 7AxH5C  2@ [( @ F!~e, !$$ "\ K' \ ~+mE* +,;c" ;6 w-

GFO  ?Q'76? Q'h>"x% x%vMWV_ Mf 	 	6 	 	D 	 	6 	 	6 	 	r)   