diff --git a/.gitignore b/.gitignore index 46b5d5b..9a90fad 100644 --- a/.gitignore +++ b/.gitignore @@ -27,8 +27,7 @@ pip-log.txt # Unit test / coverage reports .coverage .tox -nosetests.xml -.testrepository +.stestr # Translations *.mo diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..684a532 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./reviewstats/tests +top_path=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index fb62267..0000000 --- a/.testr.conf +++ /dev/null @@ -1,7 +0,0 @@ -[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 ./ . $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list \ No newline at end of file diff --git a/test-requirements.txt b/test-requirements.txt index 37a10ee..e99e1b6 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,7 +5,7 @@ fixtures>=0.3.14 python-subunit sphinx>=1.1.2,<1.2 oslo.sphinx -testrepository>=0.0.17 +stestr>=2.0.0 testscenarios>=0.4,<0.5 testtools>=0.9.32 mock diff --git a/tox.ini b/tox.ini index a249245..84341b2 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -commands = python setup.py testr --slowest --testr-args='{posargs}' +commands = stestr run --slowest {posargs} [testenv:pep8] commands = flake8 @@ -19,7 +19,14 @@ commands = flake8 commands = {posargs} [testenv:cover] -commands = python setup.py testr --coverage --testr-args='{posargs}' +commands = + coverage erase + {[testenv]commands} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml + coverage report --show-missing + [flake8] show-source = True