* reworked capturing to only capture once per runtest cycle
* added readouterr() method to py.io capturing helpers --HG-- branch : 1.0.x
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
import py
|
||||
|
||||
def test_make_sdist_and_run_it(py_setup, venv):
|
||||
sdist = py_setup.make_sdist(venv.path)
|
||||
venv.easy_install(str(sdist))
|
||||
gw = venv.makegateway()
|
||||
ch = gw.remote_exec("import py ; channel.send(py.__version__)")
|
||||
version = ch.receive()
|
||||
assert version == py.__version__
|
||||
def test_make_sdist_and_run_it(capfd, py_setup, venv):
|
||||
try:
|
||||
sdist = py_setup.make_sdist(venv.path)
|
||||
venv.easy_install(str(sdist))
|
||||
gw = venv.makegateway()
|
||||
ch = gw.remote_exec("import py ; channel.send(py.__version__)")
|
||||
version = ch.receive()
|
||||
assert version == py.__version__
|
||||
except KeyboardInterrupt:
|
||||
raise
|
||||
except:
|
||||
print capfd.readouterr()
|
||||
raise
|
||||
capfd.close()
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import py
|
||||
from py.__.test import parseopt
|
||||
|
||||
pytest_plugins = 'pytest_iocapture'
|
||||
|
||||
class TestParser:
|
||||
def test_init(self, capsys):
|
||||
parser = parseopt.Parser(usage="xyz")
|
||||
py.test.raises(SystemExit, 'parser.parse(["-h"])')
|
||||
out, err = capsys.reset()
|
||||
out, err = capsys.readouterr()
|
||||
assert out.find("xyz") != -1
|
||||
|
||||
def test_group_add_and_get(self):
|
||||
|
||||
Reference in New Issue
Block a user