From 03dc73b1959b8429a9909663e9fe66924afb1752 Mon Sep 17 00:00:00 2001 From: hpk Date: Mon, 5 Feb 2007 01:47:43 +0100 Subject: [PATCH] [svn r37949] fix test for nocapturing output runs (and --pdb) --HG-- branch : trunk --- py/io/test/test_stdcapture.py | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/py/io/test/test_stdcapture.py b/py/io/test/test_stdcapture.py index a83d9d6ac..e6cb8ea1f 100644 --- a/py/io/test/test_stdcapture.py +++ b/py/io/test/test_stdcapture.py @@ -123,14 +123,18 @@ class TestStdCaptureFD(TestStdCapture): assert err.startswith("4") def test_capture_no_sys(): - cap = py.io.StdCaptureFD(patchsys=False) - print >>sys.stdout, "hello" - print >>sys.stderr, "world" - os.write(1, "1") - os.write(2, "2") - out, err = cap.reset() - assert out == "1" - assert err == "2" + capsys = py.io.StdCapture() + try: + cap = py.io.StdCaptureFD(patchsys=False) + print >>sys.stdout, "hello" + print >>sys.stderr, "world" + os.write(1, "1") + os.write(2, "2") + out, err = cap.reset() + assert out == "1" + assert err == "2" + finally: + capsys.reset() def test_callcapture_nofd(): def func(x, y):