summaryrefslogtreecommitdiff
path: root/run_tests.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2015-09-21 16:11:55 +0200
committerPetr Malik <pmalik@tesora.com>2015-11-19 10:25:01 +0000
commit41f2606435052bca2b891a95741db0da456073e6 (patch)
treeac56d79eb9aac7de9ca6039b6175003946f0aabe /run_tests.py
parentf8f89d46fd7b72bf62b64191484255bdf66dd804 (diff)
downloadtrove-41f2606435052bca2b891a95741db0da456073e6.tar.gz
Port run_tests.py to Python 3
* Replace urllib import with six.moves.urllib * gettext.install() doesn't require the unicode parameter on Python 3 * tox.ini: add py34 testenv Tests don't pass. It's the very first step to start the working on porting Trove to Python 3. Partially implements: blueprint trove-python3 Change-Id: Ide9ec1d2aee84905c03cacdb3ea35d0dcbf01596
Diffstat (limited to 'run_tests.py')
-rw-r--r--run_tests.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/run_tests.py b/run_tests.py
index de43aa82..5f4c98ee 100644
--- a/run_tests.py
+++ b/run_tests.py
@@ -21,11 +21,12 @@ import gettext
import os
import sys
import traceback
-import urllib
import eventlet
from oslo_log import log as logging
import proboscis
+import six
+from six.moves import urllib
import wsgi_intercept
from wsgi_intercept.httplib2_intercept import install as wsgi_install
@@ -56,7 +57,10 @@ def add_support_for_localization():
if os.path.exists(os.path.join(possible_topdir, 'nova', '__init__.py')):
sys.path.insert(0, possible_topdir)
- gettext.install('nova', unicode=1)
+ if six.PY2:
+ gettext.install('nova', unicode=1)
+ else:
+ gettext.install('nova')
def initialize_trove(config_file):
@@ -146,7 +150,7 @@ def initialize_fakes(app):
def call_back(env, start_response):
path_info = env.get('PATH_INFO')
if path_info:
- env['PATH_INFO'] = urllib.unquote(path_info)
+ env['PATH_INFO'] = urllib.parse.unquote(path_info)
return app.__call__(env, start_response)
return call_back