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