-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
43 lines (34 loc) · 1.28 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
[thing]
; --config-file needed because pytest.ini will take precedence by default, even if empty.
pytest-options = --config-file=tox.ini --import-mode=importlib --quiet -ra
pytest-functional-test-path = tests
pytest-coverage-options = --cov={[pytest]pythonpath} --cov-config=tox.ini --cov-report=term-missing
[pytest]
pythonpath = src
[pycodestyle]
ignore = E203,E121,E123,E126,E133,E226,E241,E242,E704,E722,W291,W293,W503,W505
max-line-length = 120
[testenv]
basepython = python3.11
parallel_show_output = True
[testenv:format-and-lint]
description = Run Formatter (black) and Linter (pycodestyle)
extras = test
commands =
black --line-length={[pycodestyle]max-line-length} {[pytest]pythonpath}
pycodestyle --max-line-length={[pycodestyle]max-line-length} --ignore={[pycodestyle]ignore} {[pytest]pythonpath}
[testenv:type-check]
description = Run Type Checker (mypy)
deps = mypy
commands =
mypy --ignore-missing-imports --explicit-package-bases {[pytest]pythonpath}
[testenv:security-check]
description = Run Security Linter (bandit)
deps = bandit
commands = bandit --quiet --recursive {[pytest]pythonpath}
[testenv:functional-test]
description = Run Functional Tests (pytest)
extras = test
passenv = PATH, USER, HOME
commands =
pytest {[thing]pytest-options} {[thing]pytest-functional-test-path}