diff options
author | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-11-11 12:03:46 +0100 |
---|---|---|
committer | Stefano Lattarini <stefano.lattarini@gmail.com> | 2012-11-11 12:11:13 +0100 |
commit | c3dc900373daa90464d3f16598f941c5a564c3b5 (patch) | |
tree | fba3ef4db7a4d9fdd2c2a418742941545d1912d9 /t/python-virtualenv.sh | |
parent | 2ccd405661bf7f49d14c5be54d4adacb046d521c (diff) | |
download | automake-c3dc900373daa90464d3f16598f941c5a564c3b5.tar.gz |
tests: honour $PYTHON override
* t/ax/am-test-lib.sh (require_tool): Here.
* t/python-too-old.sh: And here.
* t/python-vars.sh: And here.
* t/python-virtualenv.sh: And here. Also add some sanity
checks while at it.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Diffstat (limited to 't/python-virtualenv.sh')
-rwxr-xr-x | t/python-virtualenv.sh | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/t/python-virtualenv.sh b/t/python-virtualenv.sh index f1e049478..23a9edc5b 100755 --- a/t/python-virtualenv.sh +++ b/t/python-virtualenv.sh @@ -23,8 +23,10 @@ required='cc python virtualenv' # In case the user's config.site defines pythondir or pyexecdir. CONFIG_SITE=/dev/null; export CONFIG_SITE +py_version_pre=$($PYTHON -V) + # Skip the test if a proper virtualenv cannot be created. -virtualenv --verbose virtenv && test -f virtenv/bin/activate \ +virtualenv -p"$PYTHON" --verbose virtenv && test -f virtenv/bin/activate \ || skip_ "couldn't create python virtual environment" # Activate the virtualenv. @@ -34,6 +36,11 @@ if test -z "$VIRTUAL_ENV"; then framework_failure_ "can't activate python virtual environment" fi +py_version_post=$(python -V) + +# Sanity check. +test "$py_version_pre" = "$py_version_post" + cwd=$(pwd) || fatal_ "getting current working directory" py_version=$(python -c 'import sys; print("%u.%u" % tuple(sys.version_info[:2]))') py_site=$VIRTUAL_ENV/lib/python$py_version/site-packages |