| 1 |
# Make it possible to enable test coverage reporting for Python |
| 2 |
# code run in children processes. |
| 3 |
# http://coverage.readthedocs.io/en/latest/subprocess.html |
| 4 |
|
| 5 |
import os.path as op |
| 6 |
from sysconfig import get_path |
| 7 |
|
| 8 |
FILE_CONTENT = """\ |
| 9 |
import coverage; coverage.process_startup() |
| 10 |
""" |
| 11 |
|
| 12 |
filename = op.join(get_path("purelib"), "coverage_subprocess.pth") |
| 13 |
with open(filename, "wb") as f: |
| 14 |
f.write(FILE_CONTENT.encode("ascii")) |
| 15 |
|
| 16 |
print("Installed subprocess coverage support: %s" % filename) |