Merge "make functional tests run on python 3"

This commit is contained in:
Zuul 2019-02-26 15:59:29 +00:00 committed by Gerrit Code Review
commit b623c782d4
2 changed files with 10 additions and 10 deletions

View File

@ -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

16
tox.ini
View File

@ -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