Migrate unit tests from testr to stestr

Note the interface doesn't actually have unit test.  This just migrates
away from the deprecated testr module.

Change-Id: I02cd48778bcbca8f6d05dc83d96d1e44852d1da3
This commit is contained in:
Alex Kavanagh 2021-02-10 11:43:21 +00:00
parent 62618955c7
commit 9efd83a572
3 changed files with 14 additions and 4 deletions

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=./unit_tests
top_dir=./

View File

@ -1,2 +1,2 @@
flake8>=2.2.4,<=2.4.1
os-testr>=0.4.1
flake8>=2.2.4
stestr>=2.2.0

11
tox.ini
View File

@ -1,5 +1,5 @@
[tox]
envlist = pep8,py34,py35,py36
envlist = pep8,py34,py35
skipsdist = True
# NOTE(beisner): Avoid build/test env pollution by not enabling sitepackages.
sitepackages = False
@ -11,7 +11,7 @@ setenv = VIRTUAL_ENV={envdir}
PYTHONHASHSEED=0
install_command =
pip install {opts} {packages}
commands = ostestr {posargs}
commands = stestr run {posargs}
[testenv:py34]
basepython = python3.4
@ -27,6 +27,13 @@ deps = -r{toxinidir}/test-requirements.txt
# https://github.com/juju/charm-tools/issues/249
commands = /bin/true
[testenv:py3]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt
# TODO: Need to write unit tests then remove the following command.
# https://github.com/juju/charm-tools/issues/249
commands = /bin/true
[testenv:pep8]
basepython = python3
deps = -r{toxinidir}/test-requirements.txt