diff options
author | Pradyun Gedam <pgedam@bloomberg.net> | 2022-07-08 10:53:57 +0100 |
---|---|---|
committer | Pradyun Gedam <pradyunsg@users.noreply.github.com> | 2022-07-08 10:54:15 +0100 |
commit | 56a26be75d3470945040285a504701ec50cefdd5 (patch) | |
tree | d917c258c795faa915698f39cbf9a1cc9d1d4a4d /noxfile.py | |
parent | c260ecc3e3e836b4d0dcfd56e1c365e40421ac6e (diff) | |
download | pip-56a26be75d3470945040285a504701ec50cefdd5.tar.gz |
Fix the coverage tracking nox session
This session now correctly handles tracking coverage and running tests.
Diffstat (limited to 'noxfile.py')
-rw-r--r-- | noxfile.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/noxfile.py b/noxfile.py index 9de795fe5..b7d3d8253 100644 --- a/noxfile.py +++ b/noxfile.py @@ -229,15 +229,23 @@ def vendoring(session: nox.Session) -> None: @nox.session def coverage(session: nox.Session) -> None: - if not os.path.exists("./.coverage-output"): - os.mkdir("./.coverage-output") + # Install source distribution + run_with_protected_pip(session, "install", ".") + + # Install test dependencies + run_with_protected_pip(session, "install", "-r", REQUIREMENTS["tests"]) + + if not os.path.exists(".coverage-output"): + os.mkdir(".coverage-output") session.run( "pytest", "--cov=pip", "--cov-config=./setup.cfg", + *session.posargs, env={ "COVERAGE_OUTPUT_DIR": "./.coverage-output", - "COVERAGE_PROCESS_START": "./setup.cfg", + "COVERAGE_PROCESS_START": os.fsdecode(Path("setup.cfg").resolve()), + "SETUPTOOLS_USE_DISTUTILS": "stdlib", }, ) |