Skip to content

Commit d9c1f19

Browse files
authored
bpo-40474: Updated coverage.yml to better report coverage stats (#19851)
Currently modules which are imported early are misreported in coverage. A fix is documented in the devguide, but the fix wasn't being used in CI.
1 parent cfc6ce4 commit d9c1f19

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

.github/workflows/coverage.yml

+2
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
python -m pip install -U coverage
5353
python -m pip install -r Misc/requirements-test.txt
5454
python -m test.pythoninfo
55+
export PYTHONPATH=`find .venv -name fullcoverage`
5556
- name: 'Tests with coverage'
5657
run: >
5758
source ./.venv/bin/activate &&
@@ -67,6 +68,7 @@ jobs:
6768
|| true
6869
- name: 'Publish code coverage results'
6970
run: |
71+
export PYTHONPATH=
7072
source ./.venv/bin/activate
7173
bash <(curl -s https://codecov.io/bash) -y .github/codecov.yml
7274
env:

.travis.yml

+2
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,13 @@ matrix:
8989
- ./venv/bin/python -m pip install -U coverage
9090
- ./venv/bin/python -m pip install -r Misc/requirements-test.txt
9191
- ./venv/bin/python -m test.pythoninfo
92+
- export PYTHONPATH=`find venv -name fullcoverage`
9293
script:
9394
# Skip tests that re-run the entire test suite.
9495
- xvfb-run ./venv/bin/python -m coverage run --branch --pylib -m test --fail-env-changed -uall,-cpu -x test_multiprocessing_fork -x test_multiprocessing_forkserver -x test_multiprocessing_spawn -x test_concurrent_futures || true
9596
after_script: # Probably should be after_success once test suite updated to run under coverage.py.
9697
# Make the `coverage` command available to Codecov w/ a version of Python that can parse all source files.
98+
- export PYTHONPATH=
9799
- source ./venv/bin/activate
98100
- bash <(curl -s https://codecov.io/bash) -y .github/codecov.yml
99101
- name: "Test code coverage (C)"

0 commit comments

Comments
 (0)