third_party.pylibs.pylint.src/tox.ini
2021-02-28 21:52:27 +01:00

116 lines
3.0 KiB
INI

[tox]
minversion = 2.4
envlist = py36, py37, py38, py39, pypy, pylint, benchmark
skip_missing_interpreters = true
[testenv:pylint]
deps =
-r {toxinidir}/requirements_test_min.txt
commands =
# This would be greatly simplified by a solution for https://github.com/PyCQA/pylint/issues/352
pylint -rn --rcfile={toxinidir}/pylintrc --load-plugins=pylint.extensions.docparams, pylint.extensions.mccabe \
{toxinidir}/pylint \
{toxinidir}/tests/message/ \
{toxinidir}/tests/checkers/ \
{toxinidir}/tests/extensions/ \
{toxinidir}/tests/utils/ \
{toxinidir}/tests/acceptance/ \
{toxinidir}/tests/conftest.py \
{toxinidir}/tests/test_config.py \
{toxinidir}/tests/test_func.py \
{toxinidir}/tests/test_functional.py \
{toxinidir}/tests/test_import_graph.py \
{toxinidir}/tests/test_pragma_parser.py \
{toxinidir}/tests/test_pylint_runners.py \
{toxinidir}/tests/test_regr.py \
{toxinidir}/tests/test_self.py \
{toxinidir}/tests/unittest_config.py \
{toxinidir}/tests/lint/ \
{toxinidir}/tests/unittest_pyreverse_diadefs.py \
{toxinidir}/tests/unittest_pyreverse_inspector.py \
{toxinidir}/tests/unittest_pyreverse_writer.py \
{toxinidir}/tests/unittest_reporters_json.py \
{toxinidir}/tests/unittest_reporting.py
[testenv:formatting]
basepython = python3
deps =
-r {toxinidir}/requirements_test_min.txt
pre-commit==2.10.1
commands =
pre-commit run --all-files
[testenv:mypy]
basepython = python3
deps =
pre-commit==2.10.1
commands =
pre-commit run mypy --all-files
[testenv]
setenv =
COVERAGE_FILE = {toxinidir}/.coverage.{envname}
deps =
-r {toxinidir}/requirements_test.txt
commands =
; Run tests, ensuring all benchmark tests do not run
pytest --benchmark-disable {toxinidir}/tests/ {posargs:}
[testenv:spelling]
deps =
-r {toxinidir}/requirements_test.txt
commands =
pytest {toxinidir}/tests/ {posargs:} -k unittest_spelling
[testenv:coverage-html]
setenv =
COVERAGE_FILE = {toxinidir}/.coverage
deps =
-r {toxinidir}/requirements_test.txt
skip_install = true
commands =
coverage combine
coverage html --ignore-errors --rcfile={toxinidir}/.coveragerc
[testenv:docs]
changedir = doc/
deps =
-r {toxinidir}/requirements_docs.txt
skip_install = true
commands =
sphinx-build -W -b html -d _build/doctrees . _build/html
[testenv:benchmark]
deps =
-r {toxinidir}/requirements_test.txt
pygal
commands =
; Run the only the benchmark tests, grouping output and forcing .json output so we
; can compare benchmark runs
pytest --exitfirst \
--failed-first \
--benchmark-only \
--benchmark-save=batch_files \
--benchmark-save-data \
--benchmark-autosave {toxinidir}/tests \
--benchmark-group-by="group" \
{posargs:}
[testenv:profile_against_external]
setenv =
PYTEST_PROFILE_EXTERNAL = 1
deps =
-r {toxinidir}/requirements_test.txt
gprof2dot
commands =
pytest --exitfirst \
--profile-svg {toxinidir}/tests/profile/test_profile_against_externals.py