Skip to content

Commit 7c3fd81

Browse files
authored
Make some fixes to the coverage Nox session
- Simplify it, by replacing a run with a Python if statement. - Pass an env argument to the coverage call to ensure it will work.
1 parent 097709b commit 7c3fd81

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

noxfile.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,16 +226,16 @@ def pinned_requirements(path: Path) -> Iterator[Tuple[str, str]]:
226226

227227
@nox.session
228228
def coverage(session: nox.Session):
229-
session.run(
230-
"python",
231-
"-c",
232-
"'import os, sys; os.path.exists(sys.argv[1]) or os.mkdir(sys.argv[1])'",
233-
"./.coverage-output"
234-
)
229+
if not os.path.exists("./.coverage-output"):
230+
os.mkdirs("./coverage-output")
235231
session.run(
236232
"pytest",
237233
"--cov=pip",
238234
"--cov-config=./setup.cfg"
235+
env={
236+
"COVERAGE_OUTPUT_DIR": "./coverage-output",
237+
"COVERAGE_PROCESS_START": "./setup.cfg",
238+
}
239239
)
240240

241241

0 commit comments

Comments
 (0)