@@ -68,7 +68,7 @@ subprocesses.
68
68
69
69
Running centralised testing::
70
70
71
- py.test --cov myproj tests/
71
+ py.test --cov-source myproj tests/
72
72
73
73
Shows a terminal report::
74
74
@@ -91,7 +91,7 @@ file system. Each slave will have it's subprocesses measured.
91
91
92
92
Running distributed testing with dist mode set to load::
93
93
94
- py.test --cov myproj -n 2 tests/
94
+ py.test --cov-source myproj -n 2 tests/
95
95
96
96
Shows a terminal report::
97
97
@@ -107,7 +107,7 @@ Shows a terminal report::
107
107
108
108
Again but spread over different hosts and different directories::
109
109
110
- py.test --cov myproj --dist load
110
+ py.test --cov-source myproj --dist load
111
111
--tx ssh=memedough@host1//chdir=testenv1
112
112
--tx ssh=memedough@host2//chdir=/tmp/testenv2//python=/tmp/env1/bin/python
113
113
--rsyncdir myproj --rsyncdir tests --rsync examples
@@ -134,7 +134,7 @@ environments.
134
134
135
135
Running distributed testing with dist mode set to each::
136
136
137
- py.test --cov myproj --dist each
137
+ py.test --cov-source myproj --dist each
138
138
--tx popen//chdir=/tmp/testenv3//python=/usr/local/python27/bin/python
139
139
--tx ssh=memedough@host2//chdir=/tmp/testenv4//python=/tmp/env2/bin/python
140
140
--rsyncdir myproj --rsyncdir tests --rsync examples
@@ -164,7 +164,7 @@ annotated source code.
164
164
165
165
The terminal report without line numbers (default)::
166
166
167
- py.test --cov-report term --cov myproj tests/
167
+ py.test --cov-report term --cov-source myproj tests/
168
168
169
169
-------------------- coverage: platform linux2, python 2.6.4-final-0 ---------------------
170
170
Name Stmts Miss Cover
@@ -178,7 +178,7 @@ The terminal report without line numbers (default)::
178
178
179
179
The terminal report with line numbers::
180
180
181
- py.test --cov-report term-missing --cov myproj tests/
181
+ py.test --cov-report term-missing --cov-source myproj tests/
182
182
183
183
-------------------- coverage: platform linux2, python 2.6.4-final-0 ---------------------
184
184
Name Stmts Miss Cover Missing
@@ -190,14 +190,20 @@ The terminal report with line numbers::
190
190
TOTAL 353 20 94%
191
191
192
192
193
- The remaining three reports output to files without showing anything on the terminal (useful for
194
- when the output is going to a continuous integration server)::
193
+ These three report options output to files without showing anything on the terminal::
195
194
196
195
py.test --cov-report html
197
196
--cov-report xml
198
197
--cov-report annotate
199
- --cov myproj tests/
198
+ --cov-source myproj tests/
200
199
200
+ The final report option can also suppress printing to the terminal::
201
+
202
+ py.test --cov-report= --cov-source myproj tests/
203
+
204
+ This mode can be especially useful on continuous integration servers, where a coverage file
205
+ is needed for subsequent processing, but no local report needs to be viewed. For example,
206
+ tests run on Travis-CI could produce a .coverage file for use with Coveralls.
201
207
202
208
Coverage Data File
203
209
------------------
@@ -218,7 +224,7 @@ For example if tests are contained within the directory tree being measured the
218
224
excluded if desired by using a .coveragerc file with the omit option set::
219
225
220
226
py.test --cov-config .coveragerc
221
- --cov myproj
227
+ --cov-source myproj
222
228
myproj/tests/
223
229
224
230
Where the .coveragerc file contains file globs::
0 commit comments