parent
eead8f9ab4
commit
89c53de084
|
@ -253,7 +253,7 @@ def pytest_funcarg__capsys(request):
|
||||||
them available successively via a ``capsys.readouterr()`` method
|
them available successively via a ``capsys.readouterr()`` method
|
||||||
which returns a ``(out, err)`` tuple of captured snapshot strings.
|
which returns a ``(out, err)`` tuple of captured snapshot strings.
|
||||||
"""
|
"""
|
||||||
return CaptureFuncarg(request, py.io.StdCapture)
|
return CaptureFuncarg(py.io.StdCapture)
|
||||||
|
|
||||||
def pytest_funcarg__capfd(request):
|
def pytest_funcarg__capfd(request):
|
||||||
"""captures writes to file descriptors 1 and 2 and makes
|
"""captures writes to file descriptors 1 and 2 and makes
|
||||||
|
@ -264,14 +264,11 @@ def pytest_funcarg__capfd(request):
|
||||||
"""
|
"""
|
||||||
if not hasattr(os, 'dup'):
|
if not hasattr(os, 'dup'):
|
||||||
py.test.skip("capfd funcarg needs os.dup")
|
py.test.skip("capfd funcarg needs os.dup")
|
||||||
return CaptureFuncarg(request, py.io.StdCaptureFD)
|
return CaptureFuncarg(py.io.StdCaptureFD)
|
||||||
|
|
||||||
|
|
||||||
class CaptureFuncarg:
|
class CaptureFuncarg:
|
||||||
def __init__(self, request, captureclass):
|
def __init__(self, captureclass):
|
||||||
self._cclass = captureclass
|
self.capture = captureclass(now=False)
|
||||||
self.capture = self._cclass(now=False)
|
|
||||||
#request.addfinalizer(self._finalize)
|
|
||||||
|
|
||||||
def _start(self):
|
def _start(self):
|
||||||
self.capture.startall()
|
self.capture.startall()
|
||||||
|
|
Loading…
Reference in New Issue