-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
46 lines (40 loc) · 1.94 KB
/
tox.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
[tox]
skipsdist = true
envlist = test, test-reports, coverage-reports, coverage-linting
whitelist_externals = poetry, python
; https://pypi.org/project/tox-poetry-dev-dependencies/#dependency-settings-combination
requires =
tox-poetry-dev-dependencies
[testenv]
; These two flags must be true (other 3 combos fail) which produced the following warning but allows the tests to run;
; The plugin 'tox-poetry-dev-dependencies' can not add the following locked dependency to the 'deps' configuration setting for the test environement:
poetry_add_dev_dependencies = True
# This is needed to find all the non dev deps
poetry_experimental_add_locked_dependencies = True
allowlist_externals = mkdir
[testenv:test]
commands =
python -m pytest {posargs}
[testenv:test-reports]
commands =
python -m pytest --junitxml=build/reports/unit-tests.xml
[testenv:coverage-reports]
skip_install=true
commands =
mkdir -p build/reports
python -m pytest --cov=dating_app --cov-report xml:build/reports/code-coverage.xml
python -m pytest --cov=dating_app --cov-report html:build/reports/html-code-coverage
python -m pytest --json-report --json-report-indent=3 --json-report-file=build/reports/report.json
python -m pytest --json-report --json-report-summary --json-report-file=build/reports/report-summary.json
; https://stackoverflow.com/questions/68743112/invocationerror-while-running-flake8-in-tox-ini
[testenv:coverage-linting]
skip_install=true
commands =
mkdir -p build/reports
mkdir -p build/badges
python -m flake8 --extend-ignore=T --format=junit-xml --output-file=build/reports/linting.xml dating_app/ tests/
python -m flake8 --extend-ignore=T --statistics --show-source --output-file=build/reports/linting.txt dating_app/ tests/
# alternative to piping output of make lint to tee
python -m pylint -ry --exit-zero dating_app
; This package couldn't install the poetry deps
; https://pypi.org/project/tox-poetry-installer/#quick-start