diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2022-01-23 07:15:08 -0500 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2022-01-23 08:43:47 -0500 |
commit | 53b99ff2fd808b773fe75282813d985808b757f3 (patch) | |
tree | da70529d48210b8268014573e137ecd6e389f775 | |
parent | 2e8c1910cad1ba23726e62e03c4ae1608f3fb26e (diff) | |
download | python-coveragepy-git-53b99ff2fd808b773fe75282813d985808b757f3.tar.gz |
temp: possible doc changes?
-rw-r--r-- | doc/config.rst | 2 | ||||
-rw-r--r-- | doc/subprocess.rst | 13 |
2 files changed, 12 insertions, 3 deletions
diff --git a/doc/config.rst b/doc/config.rst index e44390e5..b82df993 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -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 diff --git a/doc/subprocess.rst b/doc/subprocess.rst index b28cbc91..68843713 100644 --- a/doc/subprocess.rst +++ b/doc/subprocess.rst @@ -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 |