-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
98 lines (86 loc) · 2.03 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
[tox]
envlist =
py38,
report,
codesec,
lint,
clean
[testenv]
description = run the tests with pytest under {basepython}
usedevelop=True
passenv =
http_proxy
https_proxy
no_proxy
setenv =
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
ENV = TEST
GENERATE_DATA = False
PYTHONPATH={toxinidir}/src:{toxinidir}/tests
PYTHONUNBUFFERED=yes
deps =
-r {toxinidir}/requirements-test.txt
-e {toxinidir}
fastapi-canary: https://github.com/tiangolo/fastapi/archive/refs/heads/master.zip
commands =
python tests/test_server.py
pytest --cov="src/app" \
--cov-report=term:skip-covered \
tests/
[testenv:report]
deps = {[testenv]deps}
coverage
skip_install = True
passenv = {[testenv]passenv}
setenv = COVERAGE_FILE={toxworkdir}/.coverage
commands = coverage combine
coverage report -m
coverage xml -o {toxworkdir}/coverage.xml
coverage html -d {toxworkdir}/htmlcov
depends = py38
parallel_show_output = True
[testenv:lint]
skip_install = True
usedevelop = False
deps = {[testenv]deps}
commands =
flake8 {toxinidir}/src {toxinidir}/tests
isort --check-only --df --profile black {toxinidir}/src/ {toxinidir}/tests
black --check --diff {toxinidir}/src/ {toxinidir}/tests
[testenv:codesec]
deps = {[testenv]deps}
usedevelop = False
passenv =
http_proxy
https_proxy
no_proxy
commands =
bandit -r {toxinidir}/src/ -ll -ii
; safety check -r {toxinidir}/requirements.txt
[testenv:clean]
skip_install = True
whitelist_externals = rm
commands =
coverage erase
rm -f {toxworkdir}/test-py38.db
rm -f {toxworkdir}/test-py39.db
rm -f {toxworkdir}/scot4-test.db
rm -f {toxinidir}/scot4-test.db
rm -f {toxinidir}/../scot4-test.db
depends=
report
[flake8]
max-line-length = 88
exclude =
.tox,
.git,
__pycache__,
docs/source/conf.py,
build,
dist,
*.pyc,
*.egg-info,
.cache,
.eggs
import-order-style = google
ignore = E226,E302,E41,E501,F401,F541,E303,E203,W503