MCPcopy Create free account
hub / github.com/pytest-dev/pytest / readouterr

Method readouterr

src/_pytest/capture.py:833–848  ·  view source on GitHub ↗

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.

(self)

Source from the content-addressed store, hash-verified

831 self._capture = None
832
833 def readouterr(self) -> CaptureResult[AnyStr]:
834 """Read and return the captured output so far, resetting the internal
835 buffer.
836
837 :returns:
838 The captured content as a namedtuple with ``out`` and ``err``
839 string attributes.
840 """
841 captured_out, captured_err = self._captured_out, self._captured_err
842 if self._capture is not None:
843 out, err = self._capture.readouterr()
844 captured_out += out
845 captured_err += err
846 self._captured_out = self.captureclass.EMPTY_BUFFER
847 self._captured_err = self.captureclass.EMPTY_BUFFER
848 return CaptureResult(captured_out, captured_err)
849
850 def _suspend(self) -> None:
851 """Suspend this fixture's own capturing temporarily."""

Callers

nothing calls this directly

Calls 2

CaptureResultClass · 0.85
readouterrMethod · 0.45

Tested by

no test coverage detected