-
Notifications
You must be signed in to change notification settings - Fork 59
/
tox.ini
74 lines (57 loc) · 1.97 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
[tox]
# You can run a specific section with `tox -e py3`
# You can run a specific test with `tox -e py3 adserver/auth/tests.py`
envlist = all
skipsdist = True
[testenv]
description = Run the full test suite
setenv =
PYTHONPATH={toxinidir}/ethicaladserver:{toxinidir}
DJANGO_SETTINGS_MODULE=config.settings.testing
DJANGO_SETTINGS_SKIP_LOCAL=True
deps = -r{toxinidir}/requirements/development.txt
commands =
# Run the unit tests
coverage run -m pytest {posargs}
# Run the coverage reports
coverage html
coverage report --show-missing --fail-under=93
# Linting and code style
pre-commit run --all-files
# Migrations checks
python manage.py makemigrations --check --dry-run
# Docs checks
sphinx-build -W --keep-going -b html -d {envtmpdir}/docs/doctrees docs {envtmpdir}/docs/html
[testenv:py3]
description = run test suite for the application with {basepython}
setenv =
PYTHONPATH={toxinidir}/ethicaladserver:{toxinidir}
DJANGO_SETTINGS_MODULE=config.settings.testing
DJANGO_SETTINGS_SKIP_LOCAL=True
deps = -r{toxinidir}/requirements/development.txt
# You can run a specific test with `tox -e py3 adserver/auth/tests.py`
commands =
coverage run -m pytest {posargs}
[testenv:migrations]
description = check for missing migrations
changedir = {toxinidir}
commands =
python manage.py makemigrations --check --dry-run
[testenv:lint]
description = run through black to check coding standards
deps = -r{toxinidir}/requirements/development.txt
commands =
# Linting and code style
pre-commit run --all-files
[testenv:docs]
description = check and build documentation
changedir = {toxinidir}/docs
commands =
sphinx-build -W --keep-going -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
[testenv:coverage]
description = shows the coverage report
whitelist_externals = echo
commands =
# Run html first so we have a report of the failing coverage results
coverage html
coverage report --show-missing --fail-under=93