487281e7a7
Allow to decople global fixture definition from test cases. Fixtures can be defined as a subclass of tobiko.Fixture class MyFixture(tobiko.Fixture): ... Tobiko will reference to it as: '<module-name>.MyFixture' where module-name is the full name of the module where the class is defined. Fixture name are accessible via 'fixture_name' class attribute. tobiko.Fixture subclass has to implement bellow methods def create_fixture(self): # mandatory ... def delete_fixture(self): # optional method ... Test cases to create a fixture should mane one of below calls: fixture = tobiko.create_fixture(<fixture-name>) fixture = tobiko.create_fixture(<fixture-class>) Existing fixtures can be find using one of below calls: fixture = tobiko.get_fixture(<fixture-name>) fixture = tobiko.get_fixture(<fixture-class>) Existing fixtures can be deleted using one of below calls: tobiko.delete_fixture(<fixture-name>) tobiko.delete_fixture(<fixture-class>) Change-Id: I5c104a732234ab2183fbfb9909cba4a445f59b60
130 lines
2.8 KiB
INI
130 lines
2.8 KiB
INI
[tox]
|
|
envlist = pep8,pylint,py35,py36,py37,py27
|
|
|
|
minversion = 2.0
|
|
|
|
|
|
[tobiko]
|
|
deps =
|
|
-c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt}
|
|
-r{toxinidir}/requirements.txt
|
|
-r{toxinidir}/extra-requirements.txt
|
|
|
|
setenv =
|
|
VIRTUAL_ENV={envdir}
|
|
PYTHONWARNINGS=ignore::Warning,{env:PYTHONWARNINGS:}
|
|
OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true}
|
|
OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true}
|
|
OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true}
|
|
|
|
|
|
[testenv]
|
|
|
|
commands =
|
|
find . -type f -name ".coverage*" -delete
|
|
find . -type f -name "*.pyc" -delete
|
|
coverage erase
|
|
stestr --test-path ./tobiko/tests run --black-regex 'scenario' {posargs}
|
|
coverage combine
|
|
coverage html -d cover
|
|
coverage xml -o cover/coverage.xml
|
|
coverage report
|
|
find . -type f -name ".coverage*" -delete
|
|
|
|
deps =
|
|
{[tobiko]deps}
|
|
-r{toxinidir}/test-requirements.txt
|
|
-r{toxinidir}/extra-requirements.txt
|
|
|
|
setenv =
|
|
{[tobiko]setenv}
|
|
PYTHON=coverage run --source tobiko --parallel-mode
|
|
|
|
usedevelop = True
|
|
|
|
whitelist_externals=
|
|
find
|
|
|
|
|
|
[testenv:neutron]
|
|
basepython = python3
|
|
|
|
commands =
|
|
tobiko-delete --all
|
|
tobiko-create --all
|
|
stestr --test-path ./tobiko/tests/scenario run {posargs}
|
|
|
|
deps =
|
|
{[tobiko]deps}
|
|
-r{toxinidir}/neutron-requirements.txt
|
|
|
|
setenv =
|
|
{[tobiko]setenv}
|
|
PYTHON=python
|
|
|
|
|
|
[testenv:venv]
|
|
basepython = python3
|
|
|
|
commands =
|
|
{posargs}
|
|
|
|
deps =
|
|
{[testenv]deps}
|
|
{[testenv:neutron]deps}
|
|
|
|
setenv =
|
|
{[tobiko]setenv}
|
|
PYTHON=python
|
|
|
|
[testenv:pep8]
|
|
basepython = python3
|
|
|
|
commands =
|
|
flake8
|
|
|
|
deps =
|
|
{[testenv]deps}
|
|
{[testenv:neutron]deps}
|
|
-r{toxinidir}/pep8-requirements.txt
|
|
|
|
setenv =
|
|
{[tobiko]setenv}
|
|
PYTHON=python
|
|
|
|
|
|
[testenv:pylint]
|
|
basepython = python3
|
|
|
|
commands =
|
|
pylint -E --rcfile=.pylintrc -e W,E tobiko
|
|
|
|
deps =
|
|
{[testenv]deps}
|
|
{[testenv:neutron]deps}
|
|
-r{toxinidir}/pylint-requirements.txt
|
|
|
|
setenv =
|
|
{[tobiko]setenv}
|
|
PYTHON=python
|
|
|
|
|
|
[flake8]
|
|
# E125 continuation line does not distinguish itself from next logical line
|
|
# E126 continuation line over-indented for hanging indent
|
|
# E128 continuation line under-indented for visual indent
|
|
# E129 visually indented line with same indent as next logical line
|
|
# E265 block comment should start with '# '
|
|
# H404 multi line docstring should start with a summary
|
|
# H405 multi line docstring summary not separated with an empty line
|
|
# N530 direct neutron imports not allowed
|
|
ignore = E125,E126,E128,E129,E265,H404,H405,N530
|
|
|
|
# H106: Don't put vim configuration in source files
|
|
# H203: Use assertIs(Not)None to check for None
|
|
# H904: Delay string interpolations at logging calls
|
|
enable-extensions = H106,H203,H904
|
|
show-source = true
|
|
exclude = ./.*,build,dist,doc,*egg*,releasenotes
|
|
import-order-style = pep8
|