Add docs for CaptureFixture
This commit is contained in:
parent
3979f9ba3a
commit
18a47bfd22
|
@ -292,10 +292,9 @@ class CaptureFixture(object):
|
||||||
cap.stop_capturing()
|
cap.stop_capturing()
|
||||||
|
|
||||||
def readouterr(self):
|
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 namedtuple with ``out`` and ``err`` string attributes
|
||||||
:return: captured content as a pair of (stdout, stdout) strings
|
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
return self._capture.readouterr()
|
return self._capture.readouterr()
|
||||||
|
|
|
@ -264,6 +264,9 @@ capsys
|
||||||
captured = capsys.readouterr()
|
captured = capsys.readouterr()
|
||||||
assert captured.out == "hello\n"
|
assert captured.out == "hello\n"
|
||||||
|
|
||||||
|
.. autoclass:: CaptureFixture()
|
||||||
|
:members:
|
||||||
|
|
||||||
|
|
||||||
capsysbinary
|
capsysbinary
|
||||||
~~~~~~~~~~~~
|
~~~~~~~~~~~~
|
||||||
|
|
Loading…
Reference in New Issue