diff tests/test-ui-color.py @ 14614:afccc64eea73

ui: use I/O descriptors internally and as a result: - fix webproto to redirect the ui descriptors instead of sys.stdout/err - fix sshserver to use the ui descriptors
author Idan Kamara <idankk86@gmail.com>
date Wed, 08 Jun 2011 01:39:20 +0300
parents 842a9179132c
children a08775ec89f2
line wrap: on
line diff
--- a/tests/test-ui-color.py	Tue Jun 07 13:39:09 2011 +0300
+++ b/tests/test-ui-color.py	Wed Jun 08 01:39:20 2011 +0300
@@ -19,13 +19,13 @@
 ui_ = ui.ui()
 ui_.setconfig('ui', 'formatted', 'True')
 
+# we're not interested in the output, so write that to devnull
+ui_.fout = open(os.devnull, 'w')
+
 # call some arbitrary command just so we go through
 # color's wrapped _runcommand twice.
-# we're not interested in the output, so write that to devnull
 def runcmd():
-    sys.stdout = open(os.devnull, 'w')
     dispatch.dispatch(dispatch.request(['version', '-q'], ui_))
-    sys.stdout = sys.__stdout__
 
 runcmd()
 print "colored? " + str(issubclass(ui_.__class__, color.colorui))