Skip to content

Commit

Permalink
Add docs for CaptureFixture
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoddemus committed Mar 6, 2018
1 parent 3979f9b commit 18a47bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 2 additions & 3 deletions _pytest/capture.py
Expand Up @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions doc/en/reference.rst
Expand Up @@ -264,6 +264,9 @@ capsys
captured = capsys.readouterr()
assert captured.out == "hello\n"
.. autoclass:: CaptureFixture()
:members:


capsysbinary
~~~~~~~~~~~~
Expand Down

0 comments on commit 18a47bf

Please sign in to comment.