Skip to content

Commit 8be911b

Browse files
authored
Merge pull request #11239 from pradyunsg/fix-coverage-tracking
Fix the coverage tracking nox session
2 parents 11b0654 + 56a26be commit 8be911b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

noxfile.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,23 @@ def pinned_requirements(path: Path) -> Iterator[Tuple[str, str]]:
229229

230230
@nox.session
231231
def coverage(session: nox.Session) -> None:
232-
if not os.path.exists("./.coverage-output"):
233-
os.mkdir("./.coverage-output")
232+
# Install source distribution
233+
run_with_protected_pip(session, "install", ".")
234+
235+
# Install test dependencies
236+
run_with_protected_pip(session, "install", "-r", REQUIREMENTS["tests"])
237+
238+
if not os.path.exists(".coverage-output"):
239+
os.mkdir(".coverage-output")
234240
session.run(
235241
"pytest",
236242
"--cov=pip",
237243
"--cov-config=./setup.cfg",
244+
*session.posargs,
238245
env={
239246
"COVERAGE_OUTPUT_DIR": "./.coverage-output",
240-
"COVERAGE_PROCESS_START": "./setup.cfg",
247+
"COVERAGE_PROCESS_START": os.fsdecode(Path("setup.cfg").resolve()),
248+
"SETUPTOOLS_USE_DISTUTILS": "stdlib",
241249
},
242250
)
243251

0 commit comments

Comments
 (0)