@@ -17,13 +17,21 @@ envlist =
17
17
docs
18
18
19
19
[testenv]
20
- commands = pytest --lsof -ra {posargs:testing}
20
+ commands =
21
+ {env:_PYTEST_TOX_COVERAGE_RUN:} pytest --lsof -ra {env:_PYTEST_TEST_OPTS:} {posargs:testing}
22
+ coverage: coverage report -m --skip-covered
23
+ setenv =
24
+ coverage: _PYTEST_TOX_COVERAGE_RUN =coverage run -m
25
+ coverage: _PYTEST_TOX_EXTRA_DEP =coverage-enable-subprocess
26
+ coverage: COVERAGE_FILE ={toxinidir}/.coverage
27
+ coverage: COVERAGE_PROCESS_START ={toxinidir}/.coveragerc
21
28
passenv = USER USERNAME
22
29
deps =
23
30
hypothesis>=3.56
24
31
nose
25
32
mock
26
33
requests
34
+ {env:_PYTEST_TOX_EXTRA_DEP:}
27
35
28
36
[testenv:py27-subprocess]
29
37
changedir = .
@@ -47,9 +55,10 @@ deps =
47
55
mock
48
56
nose
49
57
hypothesis>=3.56
58
+ {env:_PYTEST_TOX_EXTRA_DEP:}
50
59
changedir =testing
51
60
commands =
52
- pytest -n8 -ra {posargs:.}
61
+ {env:_PYTEST_TOX_COVERAGE_RUN:} pytest -n8 -ra {posargs:.}
53
62
54
63
[testenv:py36-xdist]
55
64
deps = {[testenv:py27-xdist]deps}
@@ -58,9 +67,11 @@ commands = {[testenv:py27-xdist]commands}
58
67
[testenv:py27-pexpect]
59
68
changedir = testing
60
69
platform = linux|darwin
61
- deps = pexpect
70
+ deps =
71
+ pexpect
72
+ {env:_PYTEST_TOX_EXTRA_DEP:}
62
73
commands =
63
- pytest -ra test_pdb.py test_terminal.py test_unittest.py
74
+ {env:_PYTEST_TOX_COVERAGE_RUN:} pytest -ra test_pdb.py test_terminal.py test_unittest.py
64
75
65
76
[testenv:py36-pexpect]
66
77
changedir = {[testenv:py27-pexpect]changedir}
@@ -73,33 +84,40 @@ deps =
73
84
pytest-xdist>=1.13
74
85
hypothesis>=3.56
75
86
mock
87
+ {env:_PYTEST_TOX_EXTRA_DEP:}
76
88
distribute = true
77
89
changedir =testing
78
90
setenv =
91
+ {[testenv]setenv}
79
92
PYTHONDONTWRITEBYTECODE =1
80
93
commands =
81
- pytest -n3 -ra {posargs:.}
94
+ {env:_PYTEST_TOX_COVERAGE_RUN:} pytest -n3 -ra {posargs:.}
82
95
83
96
[testenv:py27-trial]
84
- deps = twisted
97
+ deps =
98
+ twisted
99
+ {env:_PYTEST_TOX_EXTRA_DEP:}
85
100
commands =
86
- pytest -ra {posargs:testing/test_unittest.py}
101
+ {env:_PYTEST_TOX_COVERAGE_RUN:} pytest -ra {posargs:testing/test_unittest.py}
87
102
88
103
[testenv:py36-trial]
89
104
deps = {[testenv:py27-trial]deps}
90
105
commands = {[testenv:py27-trial]commands}
91
106
92
107
[testenv:py27-numpy]
93
- deps = numpy
108
+ deps =
109
+ numpy
110
+ {env:_PYTEST_TOX_EXTRA_DEP:}
94
111
commands =
95
- pytest -ra {posargs:testing/python/approx.py}
112
+ {env:_PYTEST_TOX_COVERAGE_RUN:} pytest -ra {posargs:testing/python/approx.py}
96
113
97
114
[testenv:py36-numpy]
98
115
deps = {[testenv:py27-numpy]deps}
99
116
commands = {[testenv:py27-numpy]commands}
100
117
101
118
[testenv:py27-pluggymaster]
102
119
setenv =
120
+ {[testenv]setenv}
103
121
_PYTEST_SETUP_SKIP_PLUGGY_DEP =1
104
122
deps =
105
123
{[testenv]deps}
@@ -123,15 +141,13 @@ commands =
123
141
124
142
[testenv:doctesting]
125
143
basepython = python
126
- usedevelop = True
127
144
skipsdist = True
128
- # ensure the given pyargs can't mean anything else
129
- changedir = doc/
130
145
deps =
131
146
PyYAML
147
+ {env:_PYTEST_TOX_EXTRA_DEP:}
132
148
commands =
133
- pytest -ra en
134
- pytest --doctest-modules --pyargs _pytest
149
+ {env:_PYTEST_TOX_COVERAGE_RUN:} pytest -ra doc/ en
150
+ {env:_PYTEST_TOX_COVERAGE_RUN:} pytest --doctest-modules --pyargs _pytest
135
151
136
152
[testenv:regen]
137
153
changedir = doc/en
@@ -155,7 +171,8 @@ commands =
155
171
156
172
[testenv:py36-freeze]
157
173
changedir = testing/freeze
158
- deps = pyinstaller
174
+ deps =
175
+ pyinstaller
159
176
commands =
160
177
{envpython} create_executable.py
161
178
{envpython} tox_run.py
@@ -170,7 +187,7 @@ deps =
170
187
coveralls
171
188
codecov
172
189
commands =
173
- coverage run -- source =_pytest - m pytest testing
190
+ coverage run -m pytest testing
174
191
coverage report -m
175
192
coveralls
176
193
codecov
0 commit comments