This package contains a .pth
file that calls coverage.process_startup()
.
Contents
Install it with Pip:
$ pip install coverage-p
Then run your tests like:
$ COVERAGE_PROCESS_START="$PWD/.coveragerc" coverage run -p -m unittest ...
Each Python processes your tests spawn will generate a .coverage
file.
Merge these by running coverage combine
.
See the Coverage.py document Measuring sub-processes for more information.
Note
coverage.process_startup()
is a no-op unless the COVERAGE_PROCESS_START
environment variable is set.
The coverage run
command does not set this variable!
The coverage_pth package attempts to do the same thing, but the wheels it provides only work on Python 3.6. It also appears unmaintained.
Any version of CPython supported upstream and by Coverage.py is considered supported and should be tested in CI. Additionally, CI covers supported 3.x releases of PyPy, subject to availability in GitHub Actions.
coverage-p is tested against the current version of Coverage.py. The API coverage-p invokes has been stable for many years, so compatibility issues are not expected.
- Initial release
File issues and PRs on GitHub. See CONTRIBUTING.rst for more. Please follow the Twisted code of conduct.
coverage-p is made available under the MIT license.