From 18a47bfd22bb93ad5875281ff82fd0efaf68156e Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Thu, 1 Mar 2018 23:33:21 -0300 Subject: [PATCH] Add docs for CaptureFixture --- _pytest/capture.py | 5 ++--- doc/en/reference.rst | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) 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 ~~~~~~~~~~~~