Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Adrien Ferrand
committed
Sep 14, 2023
1 parent
39f20a6
commit bf33a3e
Showing
2 changed files
with
46 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,49 @@ | ||
[flake8] | ||
max-line-length = 88 | ||
extend-ignore = E203,E501 | ||
|
||
[tox:tox] | ||
envlist = cover,lint,mypy | ||
isolated_build = true | ||
|
||
# Standard env will run all test available for all providers. | ||
[testenv] | ||
allowlist_externals = poetry | ||
extras = | ||
full | ||
setenv = | ||
PYTEST_ADDOPTS = {env:PYTEST_ADDOPTS:--numprocesses auto} | ||
PYTHONHASHSEED = 0 | ||
commands_pre = | ||
poetry install --extras full --no-root --sync | ||
commands = | ||
poetry run pytest tests/ \ | ||
--junitxml=junit/test-results.xml --dist=loadfile | ||
|
||
# Cover env will run all test available for all providers with coverage enabled. | ||
[testenv:cover] | ||
commands = | ||
poetry run pytest tests/ \ | ||
--junitxml=junit/test-results.xml --dist=loadfile \ | ||
--cov=lexicon --cov-report=term-missing --cov-report=xml | ||
|
||
# Light env will run all tests except for providers with optional dependencies. | ||
[testenv:light] | ||
extras = | ||
commands_pre = | ||
poetry install --no-root --sync | ||
commands = | ||
poetry run pytest tests/ \ | ||
--junitxml=junit/test-results.xml --dist=loadfile \ | ||
--xfail-providers-with-missing-deps | ||
|
||
# Lint env will check for code quality and errors, and fails if it does not match the minimal requirements. | ||
[testenv:lint] | ||
commands = | ||
poetry run flake8 src tests | ||
|
||
|
||
# Mypy env will check for types in the Lexicon codebase. | ||
[testenv:mypy] | ||
commands = | ||
poetry run mypy src tests |