diff --git a/_pytest/capture.py b/_pytest/capture.py index 5171358ef..71b49a257 100644 --- a/_pytest/capture.py +++ b/_pytest/capture.py @@ -292,10 +292,9 @@ class CaptureFixture(object): 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 8cf95a818..6a39f7542 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 ~~~~~~~~~~~~