tests/test-ui-color.py
changeset 14614 afccc64eea73
parent 14516 842a9179132c
child 17956 a08775ec89f2
--- 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))