[svn r37949] fix test for nocapturing output runs (and --pdb)

--HG--
branch : trunk
This commit is contained in:
hpk 2007-02-05 01:47:43 +01:00
parent 99661844dd
commit 03dc73b195
1 changed files with 12 additions and 8 deletions

View File

@ -123,14 +123,18 @@ class TestStdCaptureFD(TestStdCapture):
assert err.startswith("4") assert err.startswith("4")
def test_capture_no_sys(): def test_capture_no_sys():
cap = py.io.StdCaptureFD(patchsys=False) capsys = py.io.StdCapture()
print >>sys.stdout, "hello" try:
print >>sys.stderr, "world" cap = py.io.StdCaptureFD(patchsys=False)
os.write(1, "1") print >>sys.stdout, "hello"
os.write(2, "2") print >>sys.stderr, "world"
out, err = cap.reset() os.write(1, "1")
assert out == "1" os.write(2, "2")
assert err == "2" out, err = cap.reset()
assert out == "1"
assert err == "2"
finally:
capsys.reset()
def test_callcapture_nofd(): def test_callcapture_nofd():
def func(x, y): def func(x, y):