-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
141 lines (120 loc) · 3.08 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
# 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.
[flake8]
max-line-length = 120
builtins = _,__request__
ignore = E133
exclude = .tox,.git,dist,build,yarss2/lib,yarss2/include,install
[tox]
envlist = pydef, trial, flake8, flake8-complexity, isort, testcoverage, testcoverage-html
minversion=1.8
[testenv]
passenv = DISPLAY
setenv = PYTHONPATH = {env:PWD}:{env:PYTHONPATH}
sitepackages = True
deps =
twisted
service_identity
mako
chardet
pyopenssl
pyxdg
pytest
pytest-twisted
whitelist_externals = py.test
install_command = pip install {opts} {packages}
commands = {envpython} setup.py test
[pytest]
python_functions = test_
norecursedirs = .tox .git dist build
pep8maxlinelength = 120
whitelist_externals= {[testenv]whitelist_externals}
commands = py.test yarss2
##############
# Unit tests
##############
[testenv:pydef]
commands =
py.test -v -s --twisted -m "not label" yarss2/tests
[testenv:all]
commands =
py.test -v -s --twisted yarss2/tests
[testenv:todo]
commands =
py.test -v -s --twisted -m "todo" yarss2/tests
[testenv:trial]
whitelist_externals = trial
commands =
trial yarss2/tests
[testenv:py26]
basepython = python2.6
commands = {[testenv:pydef]commands}
[testenv:py27]
basepython = python2.7
commands = {[testenv:pydef]commands}
###########################
# Code style verification
###########################
[testenv:isort]
deps =
{[testenv]deps}
isort
pytest-isort
whitelist_externals =
{[testenv]whitelist_externals}
isort
commands = python -c "import subprocess, sys; output = subprocess.check_output('isort -q --stdout --diff yarss2/*.py yarss2/util/*.py *.py', shell=True); print output; sys.exit(len(output) != 0)"
[testenv:flake8]
setenv = {[testenv]setenv}
whitelist_externals =
{[testenv]whitelist_externals}
flake8
deps =
{[testenv]deps}
flake8
pep8-naming
commands =
flake8 --version
flake8
[testenv:flake8-complexity]
setenv = {[testenv]setenv}
whitelist_externals =
{[testenv]whitelist_externals}
flake8
sh
deps =
{[testenv]deps}
flake8
mccabe
commands =
flake8 --version
flake8 --exit-zero --max-complexity 15 yarss2
######################
# Unit Test coverage
######################
[testcoveragebase]
deps =
{[testenv]deps}
pytest-cov
coverage
whitelist_externals =
{[testenv]whitelist_externals}
coverage
commands =
coverage run --branch --source=yarss2 -m py.test --twisted -m "not todo" yarss2/tests/
[testenv:testcoverage]
deps = {[testcoveragebase]deps}
setenv = {[testenv]setenv}
whitelist_externals = {[testcoveragebase]whitelist_externals}
commands =
{[testcoveragebase]commands}
coverage report
[testenv:testcoverage-html]
deps = {[testcoveragebase]deps}
setenv = {[testenv]setenv}
whitelist_externals = {[testcoveragebase]whitelist_externals}
commands =
{[testcoveragebase]commands}
coverage html -d docs/build/htmlcoverage