2013-12-19 15:51:33 +00:00
|
|
|
[tox]
|
2020-09-07 17:58:35 +00:00
|
|
|
minversion = 2.4
|
2021-02-12 14:40:40 +00:00
|
|
|
envlist = py36, py37, py38, py39, pypy, pylint, benchmark
|
2015-12-14 15:56:33 +00:00
|
|
|
skip_missing_interpreters = true
|
2015-03-03 21:13:25 +00:00
|
|
|
|
2021-02-14 21:23:48 +00:00
|
|
|
|
2015-03-03 21:13:25 +00:00
|
|
|
[testenv:pylint]
|
|
|
|
deps =
|
2021-02-21 22:19:36 +00:00
|
|
|
-r {toxinidir}/requirements_test_min.txt
|
2020-04-20 10:30:48 +00:00
|
|
|
commands =
|
2020-09-12 10:06:22 +00:00
|
|
|
# This would be greatly simplified by a solution for https://github.com/PyCQA/pylint/issues/352
|
2020-05-01 12:07:08 +00:00
|
|
|
pylint -rn --rcfile={toxinidir}/pylintrc --load-plugins=pylint.extensions.docparams, pylint.extensions.mccabe \
|
|
|
|
{toxinidir}/pylint \
|
2020-04-26 15:46:42 +00:00
|
|
|
{toxinidir}/tests/message/ \
|
2020-04-26 15:41:15 +00:00
|
|
|
{toxinidir}/tests/checkers/ \
|
2020-04-26 15:46:42 +00:00
|
|
|
{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
|
2018-09-17 07:07:02 +00:00
|
|
|
|
2021-02-14 21:23:48 +00:00
|
|
|
|
2018-09-17 07:07:02 +00:00
|
|
|
[testenv:formatting]
|
|
|
|
basepython = python3
|
2019-03-19 19:44:59 +00:00
|
|
|
deps =
|
2021-02-21 22:19:36 +00:00
|
|
|
-r {toxinidir}/requirements_test_min.txt
|
|
|
|
pre-commit==2.10.1
|
2019-03-19 19:44:59 +00:00
|
|
|
commands =
|
2020-12-14 12:49:23 +00:00
|
|
|
pre-commit run --all-files
|
2018-09-17 07:07:02 +00:00
|
|
|
|
2021-02-14 21:23:48 +00:00
|
|
|
|
2018-07-23 17:20:58 +00:00
|
|
|
[testenv:mypy]
|
|
|
|
basepython = python3
|
|
|
|
deps =
|
2021-02-21 22:19:36 +00:00
|
|
|
pre-commit==2.10.1
|
2018-07-23 17:20:58 +00:00
|
|
|
commands =
|
2021-02-06 06:53:19 +00:00
|
|
|
pre-commit run mypy --all-files
|
2018-07-23 17:20:58 +00:00
|
|
|
|
2021-02-14 21:23:48 +00:00
|
|
|
|
2013-12-19 15:51:33 +00:00
|
|
|
[testenv]
|
2016-04-26 13:53:30 +00:00
|
|
|
setenv =
|
|
|
|
COVERAGE_FILE = {toxinidir}/.coverage.{envname}
|
2021-02-21 22:19:36 +00:00
|
|
|
deps =
|
|
|
|
-r {toxinidir}/requirements_test.txt
|
2016-04-26 13:53:30 +00:00
|
|
|
commands =
|
2020-04-26 20:07:00 +00:00
|
|
|
; Run tests, ensuring all benchmark tests do not run
|
2021-02-21 22:19:36 +00:00
|
|
|
pytest --benchmark-disable {toxinidir}/tests/ {posargs:}
|
2016-04-26 13:53:30 +00:00
|
|
|
|
2018-09-29 08:30:45 +00:00
|
|
|
|
|
|
|
[testenv:spelling]
|
|
|
|
deps =
|
2021-02-21 22:19:36 +00:00
|
|
|
-r {toxinidir}/requirements_test.txt
|
2016-04-26 13:53:30 +00:00
|
|
|
commands =
|
2021-02-21 22:19:36 +00:00
|
|
|
pytest {toxinidir}/tests/ {posargs:} -k unittest_spelling
|
2016-04-26 13:53:30 +00:00
|
|
|
|
2021-02-14 21:23:48 +00:00
|
|
|
|
2020-03-30 15:17:02 +00:00
|
|
|
[testenv:coverage-html]
|
|
|
|
setenv =
|
|
|
|
COVERAGE_FILE = {toxinidir}/.coverage
|
|
|
|
deps =
|
2021-02-21 22:19:36 +00:00
|
|
|
-r {toxinidir}/requirements_test.txt
|
2020-03-30 15:17:02 +00:00
|
|
|
skip_install = true
|
|
|
|
commands =
|
2021-02-21 22:19:36 +00:00
|
|
|
coverage combine
|
|
|
|
coverage html --ignore-errors --rcfile={toxinidir}/.coveragerc
|
2020-03-30 15:17:02 +00:00
|
|
|
|
2021-02-14 21:23:48 +00:00
|
|
|
|
2018-06-04 17:35:34 +00:00
|
|
|
[testenv:docs]
|
|
|
|
changedir = doc/
|
2021-02-21 22:19:36 +00:00
|
|
|
deps =
|
|
|
|
-r {toxinidir}/requirements_docs.txt
|
|
|
|
skip_install = true
|
2018-06-04 17:35:34 +00:00
|
|
|
commands =
|
2021-02-21 22:19:36 +00:00
|
|
|
sphinx-build -W -b html -d _build/doctrees . _build/html
|
2020-04-26 20:07:00 +00:00
|
|
|
|
2021-02-14 21:23:48 +00:00
|
|
|
|
2020-04-26 20:07:00 +00:00
|
|
|
[testenv:benchmark]
|
|
|
|
deps =
|
2021-02-21 22:19:36 +00:00
|
|
|
-r {toxinidir}/requirements_test.txt
|
|
|
|
pygal
|
2020-04-26 20:07:00 +00:00
|
|
|
commands =
|
|
|
|
; Run the only the benchmark tests, grouping output and forcing .json output so we
|
|
|
|
; can compare benchmark runs
|
2021-02-21 22:19:36 +00:00
|
|
|
pytest --exitfirst \
|
|
|
|
--failed-first \
|
|
|
|
--benchmark-only \
|
|
|
|
--benchmark-save=batch_files \
|
|
|
|
--benchmark-save-data \
|
|
|
|
--benchmark-autosave {toxinidir}/tests \
|
|
|
|
--benchmark-group-by="group" \
|
|
|
|
{posargs:}
|
2020-04-26 20:07:00 +00:00
|
|
|
|
2020-04-03 07:21:45 +00:00
|
|
|
[testenv:profile_against_external]
|
2021-02-21 22:19:36 +00:00
|
|
|
setenv =
|
|
|
|
PYTEST_PROFILE_EXTERNAL = 1
|
2020-04-03 07:21:45 +00:00
|
|
|
deps =
|
2021-02-21 22:19:36 +00:00
|
|
|
-r {toxinidir}/requirements_test.txt
|
2020-04-03 07:21:45 +00:00
|
|
|
gprof2dot
|
|
|
|
commands =
|
2021-02-21 22:19:36 +00:00
|
|
|
pytest --exitfirst \
|
|
|
|
--profile-svg {toxinidir}/tests/profile/test_profile_against_externals.py
|