c6bc5f8ace
When looking at recent edit of emit_releases_file.py it seems that the amount of manual unit test changes required [1] is so high that it might deter contributors and consume too much effort. Much of the edited unit test data seems repetitive, so my rationale here is that we can reduce the amount of data resulting in a small loss of coverage but considerable reduction of required labor when making emit_releases_file amendments. The order of side effects for get_hash function was considered for the test result, now we use a fixture that is backed up by a tuple to a string dictionary to configure the mock, so the order is not important anymore. Co-Authored-By: Quique Llorente <ellorent@redhat.com> [1] https://review.openstack.org/#/c/606996/7/scripts/emit_releases_file/test_release_name.py Change-Id: Ie573813a4916aeb1bb15b5aa38dc2a732586e8c2
54 lines
1.5 KiB
INI
54 lines
1.5 KiB
INI
[tox]
|
|
envlist = linters, py27, py35
|
|
|
|
[testenv]
|
|
usedevelop = True
|
|
setenv = VIRTUAL_ENV={envdir}
|
|
deps = -r{toxinidir}/test-requirements.txt
|
|
-r{toxinidir}/requirements.txt
|
|
|
|
[testenv:venv]
|
|
commands = {posargs}
|
|
|
|
[testenv:pyflakes]
|
|
basepython = python3
|
|
deps = pyflakes
|
|
commands = pyflakes setup.py scripts
|
|
|
|
[testenv:linters]
|
|
basepython = python3
|
|
whitelist_externals = bash
|
|
commands = flake8 --max-line-length 80 {toxinidir} {posargs}
|
|
|
|
# deprecated: use linters instead. kept only as a convenience alias
|
|
[testenv:pep8]
|
|
envdir = {toxworkdir}/linters
|
|
whitelist_externals = {[testenv:linters]whitelist_externals}
|
|
commands = {[testenv:linters]commands}
|
|
|
|
[testenv:cireport]
|
|
passenv =
|
|
SSH_AUTH_SOCK
|
|
commands = python scripts/tripleo-jobs-gerrit.py {posargs}
|
|
|
|
# This environment can be used to quickly validate that all needed system
|
|
# packages required to successfully execute test targets are installed
|
|
[testenv:bindep]
|
|
# Do not install any requirements. We want this to be fast and work even if
|
|
# system dependencies are missing, since it's used to tell you what system
|
|
# dependencies are missing! This also means that bindep must be installed
|
|
# separately, outside of the requirements files.
|
|
deps = bindep
|
|
commands = bindep test
|
|
|
|
# This environment is used to run unit tests
|
|
[testenv:py27]
|
|
deps = {[testenv]deps}
|
|
changedir = scripts/emit_releases_file
|
|
commands = pytest {posargs:--cov=emit_releases_file}
|
|
|
|
[testenv:py35]
|
|
deps={[testenv]deps}
|
|
changedir = {[testenv:py27]changedir}
|
|
commands = {[testenv:py27]commands}
|