-
Notifications
You must be signed in to change notification settings - Fork 1
/
tox.ini
74 lines (65 loc) · 2.07 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 (http://tox.testrun.org/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
[tox]
envlist = py3, flake8, bandit, black, docs
[testenv]
basepython = python3
install_command = python -m pip install --trusted-host pypi.org {opts} {packages}
setenv = CTS_DEVELOPER_ENV = 1
skip_install = True
deps = -r{toxinidir}/test-requirements.txt
commands =
python3 -m pytest \
-W "ignore::UserWarning:flask.sessions" \
-W "ignore:You do not have a working installation:UserWarning" \
-W "ignore:inspect.getargspec:DeprecationWarning" \
-W "ignore:This method will be removed in future versions. Use 'parser.read_file()':DeprecationWarning" \
-W "ignore:Use .persist_selectable:DeprecationWarning" \
{posargs}
sitepackages = True
[testenv:flake8]
basepython = python3
skip_install = true
deps = flake8
commands = flake8 conf contrib cts setup.py
sitepackages = False
[testenv:bandit]
basepython = python3
skip_install = true
deps = bandit
allowlist_externals=/bin/bash
commands =
; 0.0.0.0 is set in BaseConfiguration, which is ok for local dev and it
; will be replace with a specific host IP when deploy to a server. So, it
; works to ignore B104.
/bin/bash -c "bandit -r -s B104 -ll $(find contrib cts -mindepth 1 -maxdepth 1 ! -name tests ! -name \.\* -type d -o -name \*.py)"
[testenv:black]
basepython = python3
skip_install = true
deps = black
commands = black --check --diff conf contrib cts tests setup.py
sitepackages = False
[testenv:docs]
basepython = python3
skip_install = true
allowlist_externals=make
deps =
sphinx
commands = make -C docs html
sitepackages = True
[flake8]
ignore = E203,E501,E731,W503,W504
exclude = dev_scripts/*,cts/migrations/*,.tox/*,build/*,__pycache__,scripts/print_handlers_md.py,.copr/*,.env
[pytest]
addopts = --cov=cts
[coverage:report]
skip_covered = 1
show_missing = 1
fail_under = 50
omit =
.tox
.env
tests/*
/usr/*