Skip to content

Commit 662b39f

Browse files
committed
ch08: install _coverage.pth into the environment
1 parent b808a0e commit 662b39f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

chapter08-automation-with-nox/noxfile.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ def build(session):
2424
session.run("twine", "check", *distdir.glob("*"))
2525

2626

27+
def install_coverage_pth(session):
28+
output = session.run(
29+
"python",
30+
"-c",
31+
"import sysconfig; print(sysconfig.get_path('purelib'))",
32+
silent=True,
33+
)
34+
purelib = Path(output.strip())
35+
(purelib / "_coverage.pth").write_text(
36+
"import coverage; coverage.process_startup()"
37+
)
38+
39+
2740
@nox.session(python=["3.12", "3.11", "3.10", "3.9", "3.8", "3.7"])
2841
def tests(session):
2942
"""Run the test suite."""

0 commit comments

Comments
 (0)