Skip to content

Commit 42274ee

Browse files
committed
docs: tweak up some wording
1 parent a50d6d7 commit 42274ee

File tree

2 files changed

+22
-28
lines changed

2 files changed

+22
-28
lines changed

coverage/cmdline.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class Opts:
4242

4343
append = optparse.make_option(
4444
"-a", "--append", action="store_true",
45-
help="Append coverage data to .coverage, otherwise it starts clean each time.",
45+
help="Append data to the data file. Otherwise it starts clean each time.",
4646
)
4747
branch = optparse.make_option(
4848
"", "--branch", action="store_true",
@@ -166,9 +166,8 @@ class Opts:
166166
parallel_mode = optparse.make_option(
167167
"-p", "--parallel-mode", action="store_true",
168168
help=(
169-
"Append the machine name, process id and random number to the " +
170-
"data file name to simplify collecting data from " +
171-
"many processes."
169+
"Append a unique suffix to the data file name to collect separate " +
170+
"data from multiple processes."
172171
),
173172
)
174173
precision = optparse.make_option(

doc/cmd.rst

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ There are many options:
110110
Run a Python program, measuring code execution.
111111
112112
Options:
113-
-a, --append Append coverage data to .coverage, otherwise it starts
113+
-a, --append Append data to the data file. Otherwise it starts
114114
clean each time.
115115
--branch Measure branch coverage in addition to statement
116116
coverage.
@@ -130,9 +130,8 @@ There are many options:
130130
Accepts shell-style wildcards, which must be quoted.
131131
-L, --pylib Measure coverage even inside the Python installed
132132
library, which isn't done by default.
133-
-p, --parallel-mode Append the machine name, process id and random number
134-
to the data file name to simplify collecting data from
135-
many processes.
133+
-p, --parallel-mode Append a unique suffix to the data file name to
134+
collect separate data from multiple processes.
136135
--save-signal=SIGNAL Specify a signal that will trigger coverage to write
137136
its collected data. Supported values are: USR1, USR2.
138137
Not available on Windows.
@@ -146,18 +145,21 @@ There are many options:
146145
--rcfile=RCFILE Specify configuration file. By default '.coveragerc',
147146
'setup.cfg', 'tox.ini', and 'pyproject.toml' are
148147
tried. [env: COVERAGE_RCFILE]
149-
.. [[[end]]] (sum: 1Ks5r6cadh)
148+
.. [[[end]]] (sum: YwMI03MDmQ)
149+
150+
Many of these options can also be set in the :ref:`config_run` section of your
151+
configuration file. Remember to put options for run after "run", but before
152+
the program invocation::
153+
154+
$ coverage run --source=dir1,dir2 my_program.py arg1 arg2
155+
$ coverage run --source=dir1,dir2 -m packagename.modulename arg1 arg2
150156

151157
If you want :ref:`branch coverage <branch>` measurement, use the ``--branch``
152158
flag. Otherwise only statement coverage is measured.
153159

154160
You can specify the code to measure with the ``--source``, ``--include``, and
155161
``--omit`` switches. See :ref:`Specifying source files <source_execution>` for
156-
details of their interpretation. Remember to put options for run after "run",
157-
but before the program invocation::
158-
159-
$ coverage run --source=dir1,dir2 my_program.py arg1 arg2
160-
$ coverage run --source=dir1,dir2 -m packagename.modulename arg1 arg2
162+
details of their interpretation.
161163

162164
.. note::
163165

@@ -166,7 +168,6 @@ but before the program invocation::
166168
<config_run_source>` setting in the configuration file to apply the setting
167169
uniformly to all commands.
168170

169-
170171
Coverage.py can measure multi-threaded programs by default. If you are using
171172
more other concurrency support, with the `multiprocessing`_, `greenlet`_,
172173
`eventlet`_, or `gevent`_ libraries, then coverage.py can get confused. Use the
@@ -205,22 +206,16 @@ If your coverage results seem to be overlooking code that you know has been
205206
executed, try running coverage.py again with the ``--timid`` flag. This uses a
206207
simpler but slower trace method, and might be needed in rare cases.
207208

208-
In Python 3.12 and above, you can try an experimental core based on the new
209-
:mod:`sys.monitoring <python:sys.monitoring>` module by defining a
210-
``COVERAGE_CORE=sysmon`` environment variable or by setting ``core = sysmon``
211-
in the configuration file. This should be faster, though plugins and
212-
dynamic contexts are not yet supported with it.
209+
If you are specifying ``--save-signal``, please make sure that your program
210+
doesn't intercept this signal. If it does, coverage won't receive the signal
211+
and the data file will not be written.
212+
213+
.. versionadded:: 7.10 ``--save-signal``
213214

214215
Coverage.py sets an environment variable, ``COVERAGE_RUN`` to indicate that
215216
your code is running under coverage measurement. The value is not relevant,
216217
and may change in the future.
217218

218-
These options can also be set in the :ref:`config_run` section of your
219-
.coveragerc file.
220-
221-
If you are specifying ``--save-signal``, please make sure that your program
222-
doesn't intercept this signal. If it does, coverage won't receive the signal
223-
and the data file will not be written.
224219

225220
.. _cmd_warnings:
226221

@@ -426,7 +421,7 @@ want to keep those files, use the ``--keep`` command-line option.
426421
data files in the default data file's directory are combined.
427422
428423
Options:
429-
-a, --append Append coverage data to .coverage, otherwise it starts
424+
-a, --append Append data to the data file. Otherwise it starts
430425
clean each time.
431426
--data-file=DATAFILE Base name of the data files to operate on. Defaults to
432427
'.coverage'. [env: COVERAGE_FILE]
@@ -439,7 +434,7 @@ want to keep those files, use the ``--keep`` command-line option.
439434
--rcfile=RCFILE Specify configuration file. By default '.coveragerc',
440435
'setup.cfg', 'tox.ini', and 'pyproject.toml' are
441436
tried. [env: COVERAGE_RCFILE]
442-
.. [[[end]]] (sum: C92D9kfudj)
437+
.. [[[end]]] (sum: ARyg8KB1fE)
443438
444439
445440
.. _cmd_combine_remapping:

0 commit comments

Comments
 (0)