PYTHON-5754 Fix USE_ACTIVE_VENV support (#2728)

This commit is contained in:
Jeffrey 'Alex' Clark 2026-03-11 14:09:11 -04:00 committed by GitHub
parent b6cc22ffdd
commit 3d89d9faca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -153,6 +153,10 @@ def handle_test_env() -> None:
# Start compiling the args we'll pass to uv.
UV_ARGS = ["--extra test --no-group dev"]
# If USE_ACTIVE_VENV is set, add --active to UV_ARGS so run-tests.sh uses the active venv.
if is_set("USE_ACTIVE_VENV"):
UV_ARGS.append("--active")
test_title = test_name
if sub_test_name:
test_title += f" {sub_test_name}"

View File

@ -57,7 +57,9 @@ lint-manual *args="": && resync
[group('test')]
test *args="-v --durations=5 --maxfail=10": && resync
uv run --extra test python -m pytest {{args}}
#!/usr/bin/env bash
set -euo pipefail
uv run ${USE_ACTIVE_VENV:+--active} --extra test python -m pytest {{args}}
[group('test')]
test-numpy *args="": && resync