diff --git a/os_vif/tests/functional/base.py b/os_vif/tests/functional/base.py index 67f428ae..c70bc92f 100644 --- a/os_vif/tests/functional/base.py +++ b/os_vif/tests/functional/base.py @@ -18,7 +18,6 @@ import functools import inspect import os import six -import string import sys import eventlet.timeout @@ -74,8 +73,7 @@ def setup_logging(): def sanitize_log_path(path): """Sanitize the string so that its log path is shell friendly""" - replace_map = string.maketrans(' ()', '-__') - return path.translate(replace_map) + return path.replace(' ', '-').replace('(', '_').replace(')', '_') # Test worker cannot survive eventlet's Timeout exception, which effectively diff --git a/tox.ini b/tox.ini index 1859bb86..dfdf6e6f 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,10 @@ [tox] -minversion = 2.0 +minversion = 3.1.1 envlist = py37,py27,pep8 skipsdist = True [testenv] +basepython = python3 usedevelop = True install_command = pip install -U {opts} {packages} setenv = @@ -17,11 +18,9 @@ whitelist_externals = bash commands = stestr run --black-regex ".tests.functional" {posargs} [testenv:pep8] -basepython = python3 commands = flake8 [testenv:venv] -basepython = python3 commands = {posargs} deps = {env:CONSTRAINTS_OPT} @@ -29,29 +28,32 @@ deps = -r{toxinidir}/test-requirements.txt -r{toxinidir}/doc/requirements.txt -[testenv:functional] +[testenv:functional-py27] basepython = python2.7 setenv = {[testenv]setenv} commands = stestr run --black-regex ".tests.unit" '{posargs}' +[testenv:functional] +setenv = + {[testenv]setenv} +commands = + stestr run --black-regex ".tests.unit" '{posargs}' + [testenv:docs] -basepython = python3 deps = {env:CONSTRAINTS_OPT} -r{toxinidir}/doc/requirements.txt commands = sphinx-build -W -b html doc/source doc/build/html [testenv:releasenotes] -basepython = python3 deps = {env:CONSTRAINTS_OPT} -r{toxinidir}/doc/requirements.txt commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:lower-constraints] -basepython = python3 deps = -c{toxinidir}/lower-constraints.txt -r{toxinidir}/requirements.txt