summaryrefslogtreecommitdiffstats
path: root/tests/unit/test_log.py
diff options
context:
space:
mode:
authorChuck Short <chuck.short@canonical.com>2013-05-24 10:35:28 -0500
committerChuck Short <chuck.short@canonical.com>2013-05-31 12:17:38 -0500
commit2bdad357fa19f05a3a579b47578f1510974eb0a4 (patch)
treeec5303886a1155dd931518c93eb1d0ac2d3b7c95 /tests/unit/test_log.py
parentbabe5fd2f3cb5b3fb08597d537e9a44aa39609bd (diff)
downloadoslo-2bdad357fa19f05a3a579b47578f1510974eb0a4.tar.gz
oslo-2bdad357fa19f05a3a579b47578f1510974eb0a4.tar.xz
oslo-2bdad357fa19f05a3a579b47578f1510974eb0a4.zip
python3: python3 binary/text data compatbility
Python3 enforces the distinction between byte strings far more rigorously than Python 2 does; binary data cannot be automatically coerced to or from text data. Use six to provide a fake file object for textual data. It provides an alias for StringIO.StringIO in python2 and io.StringIO in python3 Change-Id: I65897bb0cca2cbeb5819a769b98645c9eb066401 Signed-off-by: Chuck Short <chuck.short@canonical.com>
Diffstat (limited to 'tests/unit/test_log.py')
-rw-r--r--tests/unit/test_log.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/unit/test_log.py b/tests/unit/test_log.py
index f87a1da..a2045d2 100644
--- a/tests/unit/test_log.py
+++ b/tests/unit/test_log.py
@@ -1,11 +1,11 @@
import cStringIO
import logging
import os
-import StringIO
import sys
import tempfile
from oslo.config import cfg
+from six import StringIO
from openstack.common import context
from openstack.common import jsonutils
@@ -351,7 +351,7 @@ class SetDefaultsTestCase(test_utils.BaseTestCase):
class LogConfigOptsTestCase(test_utils.BaseTestCase):
def test_print_help(self):
- f = StringIO.StringIO()
+ f = StringIO()
CONF([])
CONF.print_help(file=f)
self.assertTrue('debug' in f.getvalue())