[py-svn] r37949 - py/trunk/py/io/test

hpk at codespeak.net hpk at codespeak.net
Mon Feb 5 01:47:44 CET 2007


Author: hpk
Date: Mon Feb  5 01:47:43 2007
New Revision: 37949

Modified:
   py/trunk/py/io/test/test_stdcapture.py
Log:
fix test for nocapturing output runs (and --pdb)


Modified: py/trunk/py/io/test/test_stdcapture.py
==============================================================================
--- py/trunk/py/io/test/test_stdcapture.py	(original)
+++ py/trunk/py/io/test/test_stdcapture.py	Mon Feb  5 01:47:43 2007
@@ -123,14 +123,18 @@
         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): 


More information about the py-svn mailing list