Skip to content

Commit

Permalink
temp: possible doc changes?
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Jan 23, 2022
1 parent 2e8c191 commit 53b99ff
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 2 additions & 0 deletions doc/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ option, or coverage.py will produce very wrong results.
.. _gevent: http://www.gevent.org/
.. _eventlet: http://eventlet.net/

See :ref:subprocess: for details of multi-process measurement.

Before version 4.2, this option only accepted a single string.

.. versionadded:: 4.0
Expand Down
13 changes: 10 additions & 3 deletions doc/subprocess.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,24 @@ the name of the :ref:`configuration file <config>` to use.

.. note::

If you have subprocesses because you are using :mod:`multiprocessing
If you have subprocesses created with :mod:`multiprocessing
<python:multiprocessing>`, the ``--concurrency=multiprocessing``
command-line option should take care of everything for you. See
:ref:`cmd_run` for details.

.. note::

Stopping a multiprocessing process with :meth:`terminate
<python:multiprocessing.Process.terminate>` or :meth:`kill
<python:multiprocessing.Process.kill>` will prevent recording data from the
stopped process. Those methods don't run clean-up code in the process.

When using this technique, be sure to set the parallel option to true so that
multiple coverage.py runs will each write their data to a distinct file.


Configuring Python for sub-process coverage
-------------------------------------------
Configuring Python for sub-process measurement
----------------------------------------------

Measuring coverage in sub-processes is a little tricky. When you spawn a
sub-process, you are invoking Python to run your program. Usually, to get
Expand Down

0 comments on commit 53b99ff

Please sign in to comment.