Skip to content

Commit 6f8a22d

Browse files
authored
PYTHON-4497 Fix handling of Python executable in run-tests (mongodb#1677)
1 parent 9a98020 commit 6f8a22d

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

.evergreen/run-tests.sh

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ set -o xtrace
3131
AUTH=${AUTH:-noauth}
3232
SSL=${SSL:-nossl}
3333
TEST_ARGS="${*:1}"
34-
PYTHON=$(which python)
35-
# TODO: Remove when we drop PyPy 3.8 support.
36-
OLD_PYPY=$(python -c "import sys; print(sys.implementation.name.lower() == 'pypy' and sys.implementation.version < (7, 3, 12))")
3734

3835
export PIP_QUIET=1 # Quiet by default
3936
export PIP_PREFER_BINARY=1 # Prefer binary dists by default
@@ -113,10 +110,6 @@ fi
113110

114111
if [ "$COMPRESSORS" = "snappy" ]; then
115112
python -m pip install '.[snappy]'
116-
if [ "$OLD_PYPY" == "True" ]; then
117-
pip install "python-snappy<0.7.0"
118-
fi
119-
PYTHON=python
120113
elif [ "$COMPRESSORS" = "zstd" ]; then
121114
python -m pip install zstandard
122115
fi
@@ -237,7 +230,7 @@ if [ -n "$PERF_TEST" ]; then
237230
TEST_ARGS="test/performance/perf_test.py"
238231
fi
239232

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

243236

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

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

0 commit comments

Comments
 (0)