From 0de0a0d4ab7dc2c1d4cd6cc23594ed3182aa02ec Mon Sep 17 00:00:00 2001 From: MinRK Date: Thu, 21 Apr 2011 15:55:30 -0700 Subject: [PATCH] io.Term.cin/out/err replaced by io.stdin/out/err Behavior is now the same as sys.stdin/out/err, and defaults to those streams. --- IPython/utils/tests/test_io.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/IPython/utils/tests/test_io.py b/IPython/utils/tests/test_io.py index c47e78891..59fdfc503 100644 --- a/IPython/utils/tests/test_io.py +++ b/IPython/utils/tests/test_io.py @@ -15,6 +15,7 @@ import sys from cStringIO import StringIO +from subprocess import Popen, PIPE import nose.tools as nt @@ -59,3 +60,12 @@ class TeeTestCase(dec.ParametricTestCase): for chan in ['stdout', 'stderr']: for check in ['close', 'del']: yield self.tchan(chan, check) + +def test_io_init(): + """Test that io.stdin/out/err exist at startup""" + for name in ('stdin', 'stdout', 'stderr'): + p = Popen([sys.executable, '-c', "from IPython.utils import io;print io.%s.__class__"%name], + stdout=PIPE) + p.wait() + classname = p.stdout.read().strip() + nt.assert_equals(classname, 'IPython.utils.io.IOStream')