@pytest.fixture
def capsys(request):
 if ('capfd' in request.fixturenames):
  raise request.raiseerror(error_capsysfderror)
 request.node._capfuncarg = c = CaptureFixture(SysCapture, request)
 return c

@ pytest . fixture def capsys ( request ) : if ( 'capfd' in request . fixturenames ) : raise request . raiseerror ( error_capsysfderror ) request . node . _capfuncarg = c = CaptureFixture ( SysCapture , request ) return c
enable capturing of writes to sys .