Avishek Dutta | a9d5648 | 2018-07-27 16:38:53 +0000 | [diff] [blame] | 1 | [tox] |
| 2 | minversion = 1.6 |
| 3 | envlist = pep8,py35,py27 |
| 4 | skipsdist = True |
| 5 | |
| 6 | [testenv] |
| 7 | usedevelop = True |
| 8 | install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} |
| 9 | setenv = |
| 10 | VIRTUAL_ENV={envdir} |
| 11 | OS_TEST_PATH=./tungsten_tempest_plugin/tests/unit |
| 12 | LANGUAGE=en_US |
| 13 | LC_ALL=en_US.utf-8 |
| 14 | PYTHONWARNINGS=default::DeprecationWarning |
| 15 | passenv = OS_STDOUT_CAPTURE OS_STDERR_CAPTURE OS_TEST_TIMEOUT OS_TEST_LOCK_PATH http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY |
| 16 | whitelist_externals = find |
| 17 | deps = -r{toxinidir}/requirements.txt |
| 18 | -r{toxinidir}/test-requirements.txt |
| 19 | commands = |
| 20 | find . -type f -name "*.pyc" -delete |
Avishek Dutta | a9d5648 | 2018-07-27 16:38:53 +0000 | [diff] [blame] | 21 | |
| 22 | [testenv:pep8] |
| 23 | basepython = python3 |
Avishek Dutta | 18a630b | 2018-10-31 20:14:12 +0000 | [diff] [blame^] | 24 | deps = |
| 25 | -r{toxinidir}/test-requirements.txt |
| 26 | commands = |
| 27 | flake8 |
| 28 | check-uuid --package tungsten_tempest_plugin.tests.api |
Avishek Dutta | a9d5648 | 2018-07-27 16:38:53 +0000 | [diff] [blame] | 29 | |
| 30 | [testenv:uuidgen] |
| 31 | basepython = python3 |
| 32 | commands = check-uuid --package tungsten_tempest_plugin.tests.api --fix |
| 33 | |
| 34 | [testenv:venv] |
| 35 | basepython = python3 |
| 36 | commands = {posargs} |
| 37 | |
| 38 | [testenv:cover] |
| 39 | basepython = python3 |
| 40 | commands = rm -rf *.pyc |
| 41 | rm -rf cover |
| 42 | rm -f .coverage |
| 43 | nosetests {posargs} |
| 44 | setenv = VIRTUAL_ENV={envdir} |
| 45 | NOSE_WITH_COVERAGE=1 |
| 46 | NOSE_COVER_BRANCHES=1 |
| 47 | NOSE_COVER_PACKAGE=tungsten_tempest_plugin |
| 48 | NOSE_COVER_HTML=1 |
| 49 | NOSE_COVER_HTML_DIR={toxinidir}/cover |
| 50 | NOSE_WHERE=tungsten_tempest_plugin/tests/unit |
| 51 | whitelist_externals = nosetests |
| 52 | rm |
| 53 | |
| 54 | [testenv:docs] |
| 55 | basepython = python3 |
| 56 | deps = |
| 57 | -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} |
| 58 | -r{toxinidir}/requirements.txt |
| 59 | -r{toxinidir}/doc/requirements.txt |
| 60 | commands = |
| 61 | rm -rf doc/build |
| 62 | sphinx-build -W -b html doc/source doc/build/html |
| 63 | whitelist_externals = rm |
| 64 | |
| 65 | [testenv:releasenotes] |
| 66 | basepython = python3 |
| 67 | deps = |
| 68 | -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} |
| 69 | -r{toxinidir}/requirements.txt |
| 70 | -r{toxinidir}/doc/requirements.txt |
| 71 | commands = |
| 72 | rm -rf releasenotes/build |
| 73 | sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html |
| 74 | whitelist_externals = rm |
| 75 | |
| 76 | [testenv:debug] |
| 77 | basepython = python3 |
| 78 | commands = oslo_debug_helper -t tungsten_tempest_plugin/tests {posargs} |
| 79 | |
| 80 | [testenv:genconfig] |
| 81 | basepython = python3 |
| 82 | commands = oslo-config-generator --config-file etc/config-generator.tungsten_tempest.conf |
| 83 | |
| 84 | [flake8] |
| 85 | # [H106] Don't put vim configuration in source files. |
| 86 | # [H203] Use assertIs(Not)None to check for None. |
| 87 | # [H204] Use assert(Not)Equal to check for equality. |
| 88 | # [H205] Use assert(Greater|Less)(Equal) for comparison. |
| 89 | # [H210] Require 'autospec', 'spec', or 'spec_set' in mock.patch/mock.patch.object calls |
| 90 | # [H904] Delay string interpolations at logging calls. |
Avishek Dutta | 18a630b | 2018-10-31 20:14:12 +0000 | [diff] [blame^] | 91 | enable-extensions = H106,H203,H204,H205,H210,H904,H306 |
Avishek Dutta | a9d5648 | 2018-07-27 16:38:53 +0000 | [diff] [blame] | 92 | show-source = True |
| 93 | # E123, E125 skipped as they are invalid PEP-8. |
| 94 | # |
| 95 | # H405 is another one that is good as a guideline, but sometimes |
| 96 | # multiline doc strings just don't have a natural summary |
| 97 | # line. Rejecting code for this reason is wrong. |
Avishek Dutta | 18a630b | 2018-10-31 20:14:12 +0000 | [diff] [blame^] | 98 | ignore = E123,E125,H405,H404,E303,E124,H306 |
Avishek Dutta | a9d5648 | 2018-07-27 16:38:53 +0000 | [diff] [blame] | 99 | builtins = _ |
| 100 | exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build |
| 101 | |
| 102 | [hacking] |
| 103 | local-check-factory = tungsten_tempest_plugin.hacking.checks.factory |
| 104 | |
| 105 | [testenv:lower-constraints] |
| 106 | basepython = python3 |
| 107 | deps = |
| 108 | -c{toxinidir}/lower-constraints.txt |
| 109 | -r{toxinidir}/test-requirements.txt |
| 110 | -r{toxinidir}/requirements.txt |