← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~cjwatson/launchpad:py3-rabbit-server-tests into launchpad:master

 

Colin Watson has proposed merging ~cjwatson/launchpad:py3-rabbit-server-tests into launchpad:master.

Commit message:
Convert RabbitServer tests to io.StringIO

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/+git/launchpad/+merge/392393
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~cjwatson/launchpad:py3-rabbit-server-tests into launchpad:master.
diff --git a/lib/lp/services/rabbit/server.py b/lib/lp/services/rabbit/server.py
index eca1047..b446efd 100644
--- a/lib/lp/services/rabbit/server.py
+++ b/lib/lp/services/rabbit/server.py
@@ -3,6 +3,8 @@
 
 """RabbitMQ server fixture."""
 
+from __future__ import absolute_import, print_function, unicode_literals
+
 __metaclass__ = type
 __all__ = [
     'RabbitServer',
diff --git a/lib/lp/services/rabbit/tests/test_server.py b/lib/lp/services/rabbit/tests/test_server.py
index 6ffc87f..fc56263 100644
--- a/lib/lp/services/rabbit/tests/test_server.py
+++ b/lib/lp/services/rabbit/tests/test_server.py
@@ -3,9 +3,11 @@
 
 """Tests for lp.services.rabbit.RabbitServer."""
 
+from __future__ import absolute_import, print_function, unicode_literals
+
 __metaclass__ = type
 
-from StringIO import StringIO
+import io
 
 from fixtures import EnvironmentVariableFixture
 
@@ -28,7 +30,7 @@ class TestRabbitServer(TestCase):
         # RabbitServer pokes some .ini configuration into its config.
         fixture = self.useFixture(RabbitServer())
         service_config = SafeConfigParser()
-        service_config.readfp(StringIO(fixture.config.service_config))
+        service_config.readfp(io.StringIO(fixture.config.service_config))
         self.assertEqual(["rabbitmq"], service_config.sections())
         expected = {
             "host": "localhost:%d" % fixture.config.port,