Skip to content

Commit 772f2e2

Browse files
committed
Merge pull request #40 from Eric89GXL/silent
2 parents 241a367 + 9316835 commit 772f2e2

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

pytest-cov/README.rst

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ subprocesses.
6868

6969
Running centralised testing::
7070

71-
py.test --cov myproj tests/
71+
py.test --cov-source myproj tests/
7272

7373
Shows a terminal report::
7474

@@ -91,7 +91,7 @@ file system. Each slave will have it's subprocesses measured.
9191

9292
Running distributed testing with dist mode set to load::
9393

94-
py.test --cov myproj -n 2 tests/
94+
py.test --cov-source myproj -n 2 tests/
9595

9696
Shows a terminal report::
9797

@@ -107,7 +107,7 @@ Shows a terminal report::
107107

108108
Again but spread over different hosts and different directories::
109109

110-
py.test --cov myproj --dist load
110+
py.test --cov-source myproj --dist load
111111
--tx ssh=memedough@host1//chdir=testenv1
112112
--tx ssh=memedough@host2//chdir=/tmp/testenv2//python=/tmp/env1/bin/python
113113
--rsyncdir myproj --rsyncdir tests --rsync examples
@@ -134,7 +134,7 @@ environments.
134134

135135
Running distributed testing with dist mode set to each::
136136

137-
py.test --cov myproj --dist each
137+
py.test --cov-source myproj --dist each
138138
--tx popen//chdir=/tmp/testenv3//python=/usr/local/python27/bin/python
139139
--tx ssh=memedough@host2//chdir=/tmp/testenv4//python=/tmp/env2/bin/python
140140
--rsyncdir myproj --rsyncdir tests --rsync examples
@@ -164,7 +164,7 @@ annotated source code.
164164

165165
The terminal report without line numbers (default)::
166166

167-
py.test --cov-report term --cov myproj tests/
167+
py.test --cov-report term --cov-source myproj tests/
168168

169169
-------------------- coverage: platform linux2, python 2.6.4-final-0 ---------------------
170170
Name Stmts Miss Cover
@@ -178,7 +178,7 @@ The terminal report without line numbers (default)::
178178

179179
The terminal report with line numbers::
180180

181-
py.test --cov-report term-missing --cov myproj tests/
181+
py.test --cov-report term-missing --cov-source myproj tests/
182182

183183
-------------------- coverage: platform linux2, python 2.6.4-final-0 ---------------------
184184
Name Stmts Miss Cover Missing
@@ -190,14 +190,20 @@ The terminal report with line numbers::
190190
TOTAL 353 20 94%
191191

192192

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::
195194

196195
py.test --cov-report html
197196
--cov-report xml
198197
--cov-report annotate
199-
--cov myproj tests/
198+
--cov-source myproj tests/
200199

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.
201207

202208
Coverage Data File
203209
------------------
@@ -218,7 +224,7 @@ For example if tests are contained within the directory tree being measured the
218224
excluded if desired by using a .coveragerc file with the omit option set::
219225

220226
py.test --cov-config .coveragerc
221-
--cov myproj
227+
--cov-source myproj
222228
myproj/tests/
223229

224230
Where the .coveragerc file contains file globs::

0 commit comments

Comments
 (0)