diff --git a/_pytest/capture.py b/_pytest/capture.py index 5171358efb7..71b49a25756 100644 --- a/_pytest/capture.py +++ b/_pytest/capture.py @@ -292,10 +292,9 @@ def close(self): cap.stop_capturing() def readouterr(self): - """Read and return the captured output so far. + """Read and return the captured output so far, resetting the internal buffer. - :rtype: Tuple[str, str] - :return: captured content as a pair of (stdout, stdout) strings + :return: captured content as a namedtuple with ``out`` and ``err`` string attributes """ try: return self._capture.readouterr() diff --git a/doc/en/reference.rst b/doc/en/reference.rst index 8cf95a81825..6a39f75424c 100644 --- a/doc/en/reference.rst +++ b/doc/en/reference.rst @@ -264,6 +264,9 @@ capsys captured = capsys.readouterr() assert captured.out == "hello\n" +.. autoclass:: CaptureFixture() + :members: + capsysbinary ~~~~~~~~~~~~