Use six.moves.reload_module instead of builtin reload
Builtin function 'reload' in Python 2 has been moved to standard library module in Python 3 [1]. To make code compatible, we should replace reload(mod) with six.moves.reload_module(mod) [1] http://python3porting.com/stdlib.html#moved-builtins Change-Id: Ice919c8725ec00f25a5aa0440d7ee6bc9065f653 Patially-Implements: blueprint python3
This commit is contained in:
parent
ffe45ebb42
commit
a1ca88ce78
@ -16,6 +16,7 @@ import datetime
|
|||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_utils import timeutils
|
from oslo_utils import timeutils
|
||||||
|
from six.moves import reload_module
|
||||||
|
|
||||||
from keystone.common import dependency
|
from keystone.common import dependency
|
||||||
from keystone.common import utils
|
from keystone.common import utils
|
||||||
@ -809,7 +810,8 @@ class PKIProviderTests(object):
|
|||||||
self.cms.subprocess = self.target_subprocess
|
self.cms.subprocess = self.target_subprocess
|
||||||
self.environment.subprocess = self.target_subprocess
|
self.environment.subprocess = self.target_subprocess
|
||||||
|
|
||||||
reload(pki) # force module reload so the imports get re-evaluated
|
# force module reload so the imports get re-evaluated
|
||||||
|
reload_module(pki)
|
||||||
|
|
||||||
def test_get_token_id_error_handling(self):
|
def test_get_token_id_error_handling(self):
|
||||||
# cause command-line failure
|
# cause command-line failure
|
||||||
|
1
tox.ini
1
tox.ini
@ -63,6 +63,7 @@ commands =
|
|||||||
keystone/tests/unit/tests/test_core.py \
|
keystone/tests/unit/tests/test_core.py \
|
||||||
keystone/tests/unit/tests/test_utils.py \
|
keystone/tests/unit/tests/test_utils.py \
|
||||||
keystone/tests/unit/test_token_bind.py \
|
keystone/tests/unit/test_token_bind.py \
|
||||||
|
keystone/tests/unit/test_token_provider.py \
|
||||||
keystone/tests/unit/test_url_middleware.py \
|
keystone/tests/unit/test_url_middleware.py \
|
||||||
keystone/tests/unit/test_v2_controller.py \
|
keystone/tests/unit/test_v2_controller.py \
|
||||||
keystone/tests/unit/test_v3_controller.py \
|
keystone/tests/unit/test_v3_controller.py \
|
||||||
|
Loading…
Reference in New Issue
Block a user