Set up tox to run unit tests

Makes changes to tox configuration so unit tests can be run in the py27
environment.

Change-Id: I4867dfbdf180e6f84ca178b0770a3a3ae0ce32bf
This commit is contained in:
Nicholas Jones 2017-08-09 12:40:56 -05:00
parent 7667a7b9af
commit 77341ef4b7
4 changed files with 18 additions and 1 deletions

7
.testr.conf Normal file
View File

@ -0,0 +1,7 @@
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./orm/tests/unit} $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -11,6 +11,7 @@ oslotest>=1.10.0 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD
testtools>=1.4.0 # MIT
openstackdocstheme>=1.11.0 # Apache-2.0
os-testr>=0.8.0 # Apache-2.0
# releasenotes
reno>=1.8.0 # Apache-2.0

11
tox.ini
View File

@ -9,8 +9,17 @@ install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstac
setenv =
VIRTUAL_ENV={envdir}
PYTHONWARNINGS=default::DeprecationWarning
deps = -r{toxinidir}/test-requirements.txt
commands =
find . -type f -name "*.pyc" -delete
ostestr {posargs}
whitelist_externals =
bash
find
[testenv:pep8]
commands = flake8 {posargs}
@ -18,7 +27,7 @@ commands = flake8 {posargs}
commands = {posargs}
[testenv:cover]
commands = python setup.py test --coverage --testr-args='{posargs}'
commands = python setup.py testr --coverage --testr-args='{posargs}'
[testenv:docs]
commands = python setup.py build_sphinx