StarlingX Test tools
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

110 lines
3.7 KiB

[tox]
minversion = 2.3
skipsdist = True
[testenv]
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
setenv = VIRTUAL_ENV={envdir}
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
OS_TEST_TIMEOUT=60
PYTHONDONTWRITEBYTECODE=True
deps = -r{toxinidir}/test-requirements.txt
[testenv:docs]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf doc/build
sphinx-build -a -E -W -d doc/build/doctrees -b html doc/source doc/build/html
whitelist_externals = rm
[testenv:linters]
basepython = python3
whitelist_externals = bash
commands =
bash -c "find {toxinidir} \
\( -name .tox -prune \) \
-o -type f -name '*.yaml' \
-print0 | xargs -0 yamllint"
doc8 doc/source
[testenv:pylint]
basepython = python3
recreate = True
commands = pylint --rcfile=pylint.rc automated-pytest-suite automated-robot-suite
[testenv:pep8]
basepython = python3
deps = flake8<3.8.3
commands = flake8 {posargs}
[flake8]
# Following checks should be enabled in the future.
#
# H101 Use TODO(NAME)
# H104 File contains nothing but comments
# H201 no 'except:'
# H238 old style class declaration
# H301 one import per line
# H306 imports not in alphabetical order
# H401 docstring should not start with a space
# H403 multi line docstrings should end on a new line
# H404 multi line docstring should start without a leading new line
# H405 multi line docstring summary not separated with an empty line
# H903 Windows style line endings not allowed in code
#
# W291 trailing whitespace
# W292 no newline at end of file
# W391 blank line at end of file
# W503 line break before binary operator
# W504 line break after binary operator
# W605 Invalid escape sequence 'x'
#
# E121 continuation line under-indented for hanging indent
# E123 closing bracket does not match indentation of opening bracket's line
# E126 continuation line over-indented for hanging indent
# E127 continuation line over-indented for visual indent
# E128 continuation line under-indented for visual indent
# E226 missing whitespace around arithmetic operator
# E241 multiple spaces after ','
# E261 at least two spaces before inline comment
# E302 expected 2 blank lines, found 1
# E303 too many blank lines
# E713 test for membership should be 'not in'
# E722 do not use bare except'
# E731 do not assign a lambda expression, use a def
#
# F401 'X' imported but unused
# F403 ‘from module import *’ used; unable to detect undefined names
# F523 unused positional arguments
# F632 use ==/!= to compare str, bytes, and int literals
# F811 redefinition of unused 'X' from line 'Y'
# F841 local variable 'X' is assigned to but never used
# F901 raise NotImplemented should be raise NotImplementedError
#
ignore = H101,H104,H201,H238,H301,H306,H401,H403,H404,H405,H903,
W291,W292,W391,W503,W504,W605
E121,E123,E126,E127,E128,E226,E261,E241,E302,E303,E713,E722,E731,
F401,F403,F523,F632,F811,F841,F901
show-source = True
exclude=.venv,.git,.tox,dist,*lib/python*,*egg,build,doc/source/conf.py,releasenotes
# Default max-line-length is 80. This should be reduced as the files are cleaned up.
max-line-length = 109
[testenv:releasenotes]
basepython = python3
deps = -r{toxinidir}/doc/requirements.txt
commands =
rm -rf releasenotes/build
sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
whitelist_externals =
rm
reno
[testenv:newnote]
basepython = python3
envdir = {toxworkdir}/releasenotes
deps = -r{toxinidir}/doc/requirements.txt
commands = reno new {posargs}