Skip to main content

This package installs a pth file that enables the coveragepy process_startup feature in this python prefix/virtualenv in subsequent runs.

See: http://nedbatchelder.com/code/coverage/subprocess.html

Demo:

$ virtualenv tmpenv
$ . tmpenv/bin/activate
$ pip install coverage-enable-subprocess
$ touch .coveragerc
$ export COVERAGE_PROCESS_START=$PWD/.coveragerc
$ echo 'print("oh, hi!")' > ohhi.py
$ python ohhi.py
oh, hi!

$ coverage report
Name                              Stmts   Miss  Cover
-----------------------------------------------------
/etc/python2.6/sitecustomize.py       5      1    80%
ohhi.py                               1      0   100%
tmpenv/lib/python2.6/site.py        433    392     9%
-----------------------------------------------------
TOTAL                               439    393    10%

For projects that need to cd during their test runs, and run many processes in parallel, I ensure a $TOP variable is exported, and I use this .coveragerc:

[run]
parallel = True
branch = True
data_file = $TOP/.coverage

[report]
exclude_lines =
    # Have to re-enable the standard pragma
    \#.*pragma:\s*no.?cover

    # we can't get coverage for functions that don't return:
    \#.*never returns
    \#.*doesn't return

    # Don't complain if tests don't hit defensive assertion code:
    ^\s*raise Impossible\b
    ^\s*raise AssertionError\b
    ^\s*raise NotImplementedError\b
    ^\s*return NotImplemented\b

    # Don't complain if tests don't hit re-raise of unexpected errors:
    ^\s*raise$

    # if main is covered, we're good:
    ^\s*exit\(main\(\)\)$
show_missing = True

[html]
directory = $TOP/coverage-html

# vim:ft=dosini

Release files for coverage_enable_subprocess 0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for coverage_enable_subprocess 0
File Size Uploaded
coverage_enable_subprocess-0.tar.gz 2.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for coverage_enable_subprocess 0
File Interpreter ABI Platform
coverage_enable_subprocess-0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 6.6 kB

Release files / coverage_enable_subprocess-0.tar.gz

Download URL coverage_enable_subprocess-0.tar.gz
Size 2.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5df6a00ff256c1f063f2fd8b0fadbd584e46b80838606db3381647c19266564e
BLAKE2b-256 checksum
How to use checksums
16e55469d8c6aaba3b1565c126f263c91330b3948155582d0b7abd19c0d53691
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / coverage_enable_subprocess-0-py2.py3-none-any.whl

Download URL coverage_enable_subprocess-0-py2.py3-none-any.whl
Size 4.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
c6860e549795f235d8ecc2c8e079bf9c584e73f31bd4094f410b7518bf98829d
BLAKE2b-256 checksum
How to use checksums
0b0d8d41cbe695b0f55f9a6e7c175f5f1d70f0dbeb0c58f31e3297becdb17777
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.0

2 release files

This release

0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page