Skip to content

Commit

Permalink
PYTHON-4497 [v4.8] Fix handling of Python executable in run-tests (#1679
Browse files Browse the repository at this point in the history
)
  • Loading branch information
blink1073 authored Jun 14, 2024
1 parent 2e39101 commit 8cbefe5
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ set -o xtrace
AUTH=${AUTH:-noauth}
SSL=${SSL:-nossl}
TEST_ARGS="${*:1}"
PYTHON=$(which python)
# TODO: Remove when we drop PyPy 3.8 support.
OLD_PYPY=$(python -c "import sys; print(sys.implementation.name.lower() == 'pypy' and sys.implementation.version < (7, 3, 12))")

export PIP_QUIET=1 # Quiet by default
export PIP_PREFER_BINARY=1 # Prefer binary dists by default
Expand Down Expand Up @@ -113,10 +110,6 @@ fi

if [ "$COMPRESSORS" = "snappy" ]; then
python -m pip install '.[snappy]'
if [ "$OLD_PYPY" == "True" ]; then
pip install "python-snappy<0.7.0"
fi
PYTHON=python
elif [ "$COMPRESSORS" = "zstd" ]; then
python -m pip install zstandard
fi
Expand Down Expand Up @@ -237,7 +230,7 @@ if [ -n "$PERF_TEST" ]; then
TEST_ARGS="test/performance/perf_test.py"
fi

echo "Running $AUTH tests over $SSL with python $PYTHON"
echo "Running $AUTH tests over $SSL with python $(which python)"
python -c 'import sys; print(sys.version)'


Expand All @@ -246,7 +239,7 @@ python -c 'import sys; print(sys.version)'

# Run the tests with coverage if requested and coverage is installed.
# Only cover CPython. PyPy reports suspiciously low coverage.
PYTHON_IMPL=$($PYTHON -c "import platform; print(platform.python_implementation())")
PYTHON_IMPL=$(python -c "import platform; print(platform.python_implementation())")
if [ -n "$COVERAGE" ] && [ "$PYTHON_IMPL" = "CPython" ]; then
# Keep in sync with combine-coverage.sh.
# coverage >=5 is needed for relative_files=true.
Expand Down

0 comments on commit 8cbefe5

Please sign in to comment.