Skip to content

Commit 3d89d9f

Browse files
authored
PYTHON-5754 Fix USE_ACTIVE_VENV support (#2728)
1 parent b6cc22f commit 3d89d9f

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

.evergreen/scripts/setup_tests.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,10 @@ def handle_test_env() -> None:
153153
# Start compiling the args we'll pass to uv.
154154
UV_ARGS = ["--extra test --no-group dev"]
155155

156+
# If USE_ACTIVE_VENV is set, add --active to UV_ARGS so run-tests.sh uses the active venv.
157+
if is_set("USE_ACTIVE_VENV"):
158+
UV_ARGS.append("--active")
159+
156160
test_title = test_name
157161
if sub_test_name:
158162
test_title += f" {sub_test_name}"

justfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ lint-manual *args="": && resync
5757

5858
[group('test')]
5959
test *args="-v --durations=5 --maxfail=10": && resync
60-
uv run --extra test python -m pytest {{args}}
60+
#!/usr/bin/env bash
61+
set -euo pipefail
62+
uv run ${USE_ACTIVE_VENV:+--active} --extra test python -m pytest {{args}}
6163

6264
[group('test')]
6365
test-numpy *args="": && resync

0 commit comments

Comments
 (0)