DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 1 | [tox] |
DavidPurcell | 029d8c3 | 2017-01-06 15:27:41 -0500 | [diff] [blame] | 2 | minversion = 1.6 |
Felipe Monteiro | df95870 | 2017-02-27 03:53:50 +0000 | [diff] [blame] | 3 | envlist = pep8,py35,py27 |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 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} |
Felipe Monteiro | 7de1905 | 2017-08-06 05:47:27 +0100 | [diff] [blame] | 11 | OS_TEST_PATH=./patrole_tempest_plugin/tests/unit |
| 12 | LANGUAGE=en_US |
| 13 | LC_ALL=en_US.utf-8 |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 14 | PYTHONWARNINGS=default::DeprecationWarning |
Felipe Monteiro | 5fa20f7 | 2017-12-01 02:09:08 +0000 | [diff] [blame] | 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 |
Felipe Monteiro | df95870 | 2017-02-27 03:53:50 +0000 | [diff] [blame] | 16 | whitelist_externals = find |
DavidPurcell | 029d8c3 | 2017-01-06 15:27:41 -0500 | [diff] [blame] | 17 | deps = -r{toxinidir}/requirements.txt |
| 18 | -r{toxinidir}/test-requirements.txt |
Jeremy Liu | e1014be | 2017-03-22 18:33:00 -0700 | [diff] [blame] | 19 | commands = |
DavidPurcell | 029d8c3 | 2017-01-06 15:27:41 -0500 | [diff] [blame] | 20 | find . -type f -name "*.pyc" -delete |
Felipe Monteiro | 5fa20f7 | 2017-12-01 02:09:08 +0000 | [diff] [blame] | 21 | stestr --test-path ./patrole_tempest_plugin/tests/unit run {posargs} |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 22 | |
| 23 | [testenv:pep8] |
| 24 | commands = flake8 {posargs} |
Jeremy Liu | 78b1925 | 2017-04-01 16:19:09 +0800 | [diff] [blame] | 25 | check-uuid --package patrole_tempest_plugin.tests.api |
Felipe Monteiro | df95870 | 2017-02-27 03:53:50 +0000 | [diff] [blame] | 26 | |
| 27 | [testenv:uuidgen] |
Jeremy Liu | 78b1925 | 2017-04-01 16:19:09 +0800 | [diff] [blame] | 28 | commands = check-uuid --package patrole_tempest_plugin.tests.api --fix |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 29 | |
| 30 | [testenv:venv] |
| 31 | commands = {posargs} |
| 32 | |
| 33 | [testenv:cover] |
Joseph Abad | ae7d7bb | 2017-04-19 12:07:13 -0400 | [diff] [blame] | 34 | commands = rm -rf *.pyc |
| 35 | rm -rf cover |
| 36 | rm -f .coverage |
| 37 | nosetests {posargs} |
Felipe Monteiro | 1ee5f4d | 2017-03-04 18:07:27 +0000 | [diff] [blame] | 38 | setenv = VIRTUAL_ENV={envdir} |
| 39 | NOSE_WITH_COVERAGE=1 |
| 40 | NOSE_COVER_BRANCHES=1 |
| 41 | NOSE_COVER_PACKAGE=patrole_tempest_plugin |
| 42 | NOSE_COVER_HTML=1 |
| 43 | NOSE_COVER_HTML_DIR={toxinidir}/cover |
| 44 | NOSE_WHERE=patrole_tempest_plugin/tests/unit |
| 45 | whitelist_externals = nosetests |
Joseph Abad | ae7d7bb | 2017-04-19 12:07:13 -0400 | [diff] [blame] | 46 | rm |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 47 | |
| 48 | [testenv:docs] |
| 49 | commands = python setup.py build_sphinx |
| 50 | |
| 51 | [testenv:releasenotes] |
| 52 | commands = |
| 53 | sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html |
| 54 | |
| 55 | [testenv:debug] |
HaiJieZhang | ae9db6f | 2017-03-23 11:28:16 +0800 | [diff] [blame] | 56 | commands = oslo_debug_helper -t patrole_tempest_plugin/tests {posargs} |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 57 | |
Felipe Monteiro | 098a8cd | 2017-09-20 21:31:27 +0100 | [diff] [blame] | 58 | [testenv:genconfig] |
| 59 | commands = oslo-config-generator --config-file etc/config-generator.patrole.conf |
| 60 | |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 61 | [flake8] |
melissaml | 686e0d9 | 2018-01-26 01:07:42 +0800 | [diff] [blame^] | 62 | # [H106] Don't put vim configuration in source files. |
Felipe Monteiro | b18a3f6 | 2017-09-19 04:25:51 +0100 | [diff] [blame] | 63 | # [H203] Use assertIs(Not)None to check for None. |
| 64 | # [H204] Use assert(Not)Equal to check for equality. |
| 65 | # [H205] Use assert(Greater|Less)(Equal) for comparison. |
melissaml | 686e0d9 | 2018-01-26 01:07:42 +0800 | [diff] [blame^] | 66 | # [H210] Require 'autospec', 'spec', or 'spec_set' in mock.patch/mock.patch.object calls |
Felipe Monteiro | b18a3f6 | 2017-09-19 04:25:51 +0100 | [diff] [blame] | 67 | # [H904] Delay string interpolations at logging calls. |
| 68 | enable-extensions = H106,H203,H204,H205,H210,H904 |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 69 | show-source = True |
Felipe Monteiro | 4bf66a2 | 2017-05-07 14:44:21 +0100 | [diff] [blame] | 70 | # E123, E125 skipped as they are invalid PEP-8. |
Felipe Monteiro | f6eb862 | 2017-08-06 06:08:02 +0100 | [diff] [blame] | 71 | # |
| 72 | # H405 is another one that is good as a guideline, but sometimes |
| 73 | # multiline doc strings just don't have a natural summary |
| 74 | # line. Rejecting code for this reason is wrong. |
| 75 | ignore = E123,E125,H405 |
DavidPurcell | 663aedf | 2017-01-03 10:01:14 -0500 | [diff] [blame] | 76 | builtins = _ |
| 77 | exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build |
Felipe Monteiro | 0854ded | 2017-05-05 16:30:55 +0100 | [diff] [blame] | 78 | |
| 79 | [hacking] |
| 80 | local-check-factory = patrole_tempest_plugin.hacking.checks.factory |