summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-04-22 13:35:28 +0000
committerGerrit Code Review <review@openstack.org>2013-04-22 13:35:28 +0000
commit2492387789ece466e19ee1a76ce5f574bfc123e6 (patch)
tree206b84ddf2e326980b77d74a4c8633a7034cd091 /tests
parent572bb9ddb720c7cf948906c72be30b022ded0df0 (diff)
parent120ddeff7e1b8956fe35a7a39fae87ddcac8301c (diff)
downloadoslo-2492387789ece466e19ee1a76ce5f574bfc123e6.tar.gz
oslo-2492387789ece466e19ee1a76ce5f574bfc123e6.tar.xz
oslo-2492387789ece466e19ee1a76ce5f574bfc123e6.zip
Merge "Improve Python 3.x compatibility"
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/rpc/test_common.py4
-rw-r--r--tests/unit/test_excutils.py4
-rw-r--r--tests/unit/test_processutils.py2
-rw-r--r--tests/unit/test_service.py2
4 files changed, 6 insertions, 6 deletions
diff --git a/tests/unit/rpc/test_common.py b/tests/unit/rpc/test_common.py
index 755e2a4..2248a8f 100644
--- a/tests/unit/rpc/test_common.py
+++ b/tests/unit/rpc/test_common.py
@@ -213,7 +213,7 @@ class RpcCommonTestCase(test_utils.BaseTestCase):
raise ValueError()
except Exception:
raise rpc_common.ClientException()
- except rpc_common.ClientException, e:
+ except rpc_common.ClientException as e:
pass
self.assertTrue(isinstance(e, rpc_common.ClientException))
@@ -226,7 +226,7 @@ class RpcCommonTestCase(test_utils.BaseTestCase):
e = None
try:
rpc_common.catch_client_exception([ValueError], naughty, 'a')
- except rpc_common.ClientException, e:
+ except rpc_common.ClientException as e:
pass
self.assertTrue(isinstance(e, rpc_common.ClientException))
diff --git a/tests/unit/test_excutils.py b/tests/unit/test_excutils.py
index d3eeb8c..9d9050e 100644
--- a/tests/unit/test_excutils.py
+++ b/tests/unit/test_excutils.py
@@ -29,7 +29,7 @@ class SaveAndReraiseTest(utils.BaseTestCase):
except:
with excutils.save_and_reraise_exception():
pass
- except Exception, _e:
+ except Exception as _e:
e = _e
self.assertEqual(str(e), msg)
@@ -43,7 +43,7 @@ class SaveAndReraiseTest(utils.BaseTestCase):
except:
with excutils.save_and_reraise_exception():
raise Exception(msg)
- except Exception, _e:
+ except Exception as _e:
e = _e
self.assertEqual(str(e), msg)
diff --git a/tests/unit/test_processutils.py b/tests/unit/test_processutils.py
index 689bad0..f096cf7 100644
--- a/tests/unit/test_processutils.py
+++ b/tests/unit/test_processutils.py
@@ -72,7 +72,7 @@ class ProcessExecutionErrorTest(utils.BaseTestCase):
the Wielder of Wonder, with world's renown.
""".strip()
err = processutils.ProcessExecutionError(stdout=stdout)
- print err.message
+ print(err.message)
self.assertTrue('people-kings' in err.message)
def test_with_stderr(self):
diff --git a/tests/unit/test_service.py b/tests/unit/test_service.py
index af6c303..53b7eb4 100644
--- a/tests/unit/test_service.py
+++ b/tests/unit/test_service.py
@@ -87,7 +87,7 @@ class ServiceLauncherTest(utils.BaseTestCase):
try:
traceback.print_exc()
except BaseException:
- print "Couldn't print traceback"
+ print("Couldn't print traceback")
status = 2
# Really exit