File: install_coverage_subprocess_pth.py

package info (click to toggle)
cloudpickle 3.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 544 kB
  • sloc: python: 3,315; sh: 9; makefile: 8
file content (16 lines) | stat: -rw-r--r-- 484 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# Make it possible to enable test coverage reporting for Python
# code run in children processes.
# http://coverage.readthedocs.io/en/latest/subprocess.html

import os.path as op
from sysconfig import get_path

FILE_CONTENT = """\
import coverage; coverage.process_startup()
"""

filename = op.join(get_path("purelib"), "coverage_subprocess.pth")
with open(filename, "wb") as f:
    f.write(FILE_CONTENT.encode("ascii"))

print("Installed subprocess coverage support: %s" % filename)