stop exposing capsys/capfd.capture

This commit is contained in:
Ronny Pfannschmidt 2014-01-22 21:52:32 +01:00
parent ac2f2b1deb
commit 8976b3ee0e
2 changed files with 7 additions and 5 deletions

View File

@ -18,6 +18,8 @@ UNRELEASED
- copy, cleanup and integrate py.io capture - copy, cleanup and integrate py.io capture
from pylib 1.4.20.dev2 (rev 13d9af95547e) from pylib 1.4.20.dev2 (rev 13d9af95547e)
- make capfd/capsys.capture private, its unused and shouldnt be exposed
2.5.1 2.5.1
----------------------------------- -----------------------------------

View File

@ -283,20 +283,20 @@ def pytest_funcarg__capfd(request):
class CaptureFixture: class CaptureFixture:
def __init__(self, captureclass): def __init__(self, captureclass):
self.capture = captureclass(now=False) self._capture = captureclass(now=False)
def _start(self): def _start(self):
self.capture.startall() self._capture.startall()
def _finalize(self): def _finalize(self):
if hasattr(self, 'capture'): if hasattr(self, 'capture'):
outerr = self._outerr = self.capture.reset() outerr = self._outerr = self._capture.reset()
del self.capture del self._capture
return outerr return outerr
def readouterr(self): def readouterr(self):
try: try:
return self.capture.readouterr() return self._capture.readouterr()
except AttributeError: except AttributeError:
return self._outerr return self._outerr