PYTHON-4002 No module named coverage.__main__ (#1398)
This commit is contained in:
parent
1cbd192a84
commit
fbf29374bc
23
.evergreen/combine-coverage.sh
Normal file
23
.evergreen/combine-coverage.sh
Normal file
@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Coverage combine merges (and removes) all the coverage files and
|
||||
# generates a new .coverage file in the current directory.
|
||||
|
||||
set -o xtrace # Write all commands first to stderr
|
||||
set -o errexit # Exit the script with error if any of the commands fail
|
||||
|
||||
. .evergreen/utils.sh
|
||||
|
||||
if [ -z "$PYTHON_BINARY" ]; then
|
||||
PYTHON_BINARY=$(find_python3)
|
||||
fi
|
||||
|
||||
createvirtualenv "$PYTHON_BINARY" covenv
|
||||
# coverage 7.3 dropped support for Python 3.7, keep in sync with run-tests.sh
|
||||
pip install -q "coverage<7.3"
|
||||
|
||||
pip list
|
||||
ls -la coverage/
|
||||
|
||||
python -m coverage combine coverage/coverage.*
|
||||
python -m coverage html -d htmlcov
|
||||
@ -131,12 +131,7 @@ functions:
|
||||
working_dir: "src"
|
||||
script: |
|
||||
${PREPARE_SHELL}
|
||||
set -o xtrace
|
||||
# Coverage combine merges (and removes) all the coverage files and
|
||||
# generates a new .coverage file in the current directory.
|
||||
ls -la coverage/
|
||||
/opt/python/3.7/bin/python3 -m coverage combine coverage/coverage.*
|
||||
/opt/python/3.7/bin/python3 -m coverage html -d htmlcov
|
||||
bash .evergreen/combine-coverage.sh
|
||||
# Upload the resulting html coverage report.
|
||||
- command: shell.exec
|
||||
params:
|
||||
|
||||
@ -258,7 +258,8 @@ python -c 'import sys; print(sys.version)'
|
||||
# Only cover CPython. PyPy reports suspiciously low coverage.
|
||||
PYTHON_IMPL=$($PYTHON -c "import platform; print(platform.python_implementation())")
|
||||
if [ -n "$COVERAGE" ] && [ "$PYTHON_IMPL" = "CPython" ]; then
|
||||
python -m pip install pytest-cov "coverage"
|
||||
# coverage 7.3 dropped support for Python 3.7, keep in sync with combine-coverage.sh.
|
||||
python -m pip install pytest-cov "coverage<7.3"
|
||||
TEST_ARGS="$TEST_ARGS --cov pymongo --cov-branch --cov-report term-missing:skip-covered"
|
||||
fi
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user