浏览代码

Removing stderr output from test

As per request by @mnaberez in pull request
https://github.com/Supervisor/supervisor/pull/95#issuecomment-10778589
Jens Rantil 12 年之前
父节点
当前提交
c310c82887
共有 1 个文件被更改,包括 10 次插入0 次删除
  1. 10 0
      supervisor/tests/test_options.py

+ 10 - 0
supervisor/tests/test_options.py

@@ -8,6 +8,13 @@ import unittest
 import signal
 import shutil
 import errno
+try:
+    # Python < 3
+    from StringIO import StringIO
+except ImportError:
+    # Python >= 3
+    from io import StringIO
+
 from mock import Mock, patch, sentinel
 
 from supervisor.tests.base import DummySupervisor
@@ -432,6 +439,9 @@ class ServerOptionsTests(unittest.TestCase):
             raise DummyException(exitcode)
         instance.exit = dummy_exit
 
+        # Making sure we capture stdout and stderr
+        instance.stderr = StringIO()
+
         try:
             instance.realize()
         except DummyException, e: