|
|
@ -22,16 +22,12 @@ unstub_pyenv() { |
|
|
|
|
|
|
|
@test "use pyvenv if virtualenv is not available" { |
|
|
|
export PYENV_VERSION="3.4.1" |
|
|
|
setup_pyvenv "3.4.1" |
|
|
|
stub_pyenv "${PYENV_VERSION}" |
|
|
|
stub pyenv-prefix " : echo '${PYENV_ROOT}/versions/${PYENV_VERSION}'" |
|
|
|
stub pyenv-exec "pyvenv * : echo PYENV_VERSION=\${PYENV_VERSION} \"\$@\"" |
|
|
|
stub pyenv-exec "python -s -m ensurepip : true" |
|
|
|
|
|
|
|
create_executable "3.4.1" "python" |
|
|
|
remove_executable "3.4.1" "virtualenv" |
|
|
|
create_executable "3.4.1" "pyvenv" |
|
|
|
remove_executable "3.4.1" "conda" |
|
|
|
|
|
|
|
run pyenv-virtualenv venv |
|
|
|
|
|
|
|
assert_success |
|
|
@ -42,20 +38,18 @@ OUT |
|
|
|
|
|
|
|
unstub_pyenv |
|
|
|
unstub pyenv-exec |
|
|
|
teardown_pyvenv "3.4.1" |
|
|
|
} |
|
|
|
|
|
|
|
@test "not use pyvenv if virtualenv is available" { |
|
|
|
export PYENV_VERSION="3.4.1" |
|
|
|
setup_pyvenv "3.4.1" |
|
|
|
create_executable "3.4.1" "virtualenv" |
|
|
|
stub_pyenv "${PYENV_VERSION}" |
|
|
|
stub pyenv-prefix " : echo '${PYENV_ROOT}/versions/${PYENV_VERSION}'" |
|
|
|
stub pyenv-exec "virtualenv * : echo PYENV_VERSION=\${PYENV_VERSION} \"\$@\"" |
|
|
|
stub pyenv-exec "python -s -m ensurepip : true" |
|
|
|
|
|
|
|
create_executable "3.4.1" "python" |
|
|
|
create_executable "3.4.1" "virtualenv" |
|
|
|
create_executable "3.4.1" "pyvenv" |
|
|
|
remove_executable "3.4.1" "conda" |
|
|
|
|
|
|
|
run pyenv-virtualenv venv |
|
|
|
|
|
|
|
assert_success |
|
|
@ -66,10 +60,12 @@ OUT |
|
|
|
|
|
|
|
unstub_pyenv |
|
|
|
unstub pyenv-exec |
|
|
|
teardown_pyvenv "3.4.1" |
|
|
|
} |
|
|
|
|
|
|
|
@test "install virtualenv if pyvenv is not avaialble" { |
|
|
|
export PYENV_VERSION="3.2.1" |
|
|
|
setup_version "3.2.1" |
|
|
|
stub_pyenv "${PYENV_VERSION}" |
|
|
|
stub pyenv-prefix " : echo '${PYENV_ROOT}/versions/${PYENV_VERSION}'" |
|
|
|
stub pyenv-exec "pip install virtualenv : echo PYENV_VERSION=\${PYENV_VERSION} \"\$@\"" |
|
|
@ -78,11 +74,6 @@ OUT |
|
|
|
stub pyenv-exec "python -s */get-pip.py : true" |
|
|
|
stub curl true |
|
|
|
|
|
|
|
create_executable "3.2.1" "python" |
|
|
|
remove_executable "3.2.1" "virtualenv" |
|
|
|
remove_executable "3.2.1" "pyvenv" |
|
|
|
remove_executable "3.2.1" "conda" |
|
|
|
|
|
|
|
run pyenv-virtualenv venv |
|
|
|
|
|
|
|
assert_success |
|
|
@ -96,21 +87,18 @@ OUT |
|
|
|
unstub_pyenv |
|
|
|
unstub pyenv-exec |
|
|
|
unstub curl |
|
|
|
teardown_version "3.2.1" |
|
|
|
} |
|
|
|
|
|
|
|
@test "install virtualenv if -p has given" { |
|
|
|
export PYENV_VERSION="3.4.1" |
|
|
|
setup_pyvenv "3.4.1" |
|
|
|
stub_pyenv "${PYENV_VERSION}" |
|
|
|
stub pyenv-prefix " : echo '${PYENV_ROOT}/versions/${PYENV_VERSION}'" |
|
|
|
stub pyenv-exec "pip install virtualenv : echo PYENV_VERSION=\${PYENV_VERSION} \"\$@\"" |
|
|
|
stub pyenv-exec "virtualenv * : echo PYENV_VERSION=\${PYENV_VERSION} \"\$@\"" |
|
|
|
stub pyenv-exec "python -s -m ensurepip : true" |
|
|
|
|
|
|
|
create_executable "3.4.1" "python" |
|
|
|
remove_executable "3.4.1" "virtualenv" |
|
|
|
create_executable "3.4.1" "pyvenv" |
|
|
|
remove_executable "3.4.1" "conda" |
|
|
|
|
|
|
|
run pyenv-virtualenv -p ${TMP}/python3 venv |
|
|
|
|
|
|
|
assert_output <<OUT |
|
|
@ -122,21 +110,18 @@ OUT |
|
|
|
|
|
|
|
unstub_pyenv |
|
|
|
unstub pyenv-exec |
|
|
|
teardown_pyvenv "3.4.1" |
|
|
|
} |
|
|
|
|
|
|
|
@test "install virtualenv if --python has given" { |
|
|
|
export PYENV_VERSION="3.4.1" |
|
|
|
setup_pyvenv "3.4.1" |
|
|
|
stub_pyenv "${PYENV_VERSION}" |
|
|
|
stub pyenv-prefix " : echo '${PYENV_ROOT}/versions/${PYENV_VERSION}'" |
|
|
|
stub pyenv-exec "pip install virtualenv : echo PYENV_VERSION=\${PYENV_VERSION} \"\$@\"" |
|
|
|
stub pyenv-exec "virtualenv * : echo PYENV_VERSION=\${PYENV_VERSION} \"\$@\"" |
|
|
|
stub pyenv-exec "python -s -m ensurepip : true" |
|
|
|
|
|
|
|
create_executable "3.4.1" "python" |
|
|
|
remove_executable "3.4.1" "virtualenv" |
|
|
|
create_executable "3.4.1" "pyvenv" |
|
|
|
remove_executable "3.4.1" "conda" |
|
|
|
|
|
|
|
run pyenv-virtualenv --python=${TMP}/python3 venv |
|
|
|
|
|
|
|
assert_output <<OUT |
|
|
@ -148,10 +133,12 @@ OUT |
|
|
|
|
|
|
|
unstub_pyenv |
|
|
|
unstub pyenv-exec |
|
|
|
teardown_pyvenv "3.4.1" |
|
|
|
} |
|
|
|
|
|
|
|
@test "install virtualenv with unsetting troublesome pip options" { |
|
|
|
export PYENV_VERSION="3.2.1" |
|
|
|
setup_version "3.2.1" |
|
|
|
stub_pyenv "${PYENV_VERSION}" |
|
|
|
stub pyenv-prefix " : echo '${PYENV_ROOT}/versions/${PYENV_VERSION}'" |
|
|
|
stub pyenv-exec "pip install virtualenv : echo PIP_REQUIRE_VENV=\${PIP_REQUIRE_VENV} PYENV_VERSION=\${PYENV_VERSION} \"\$@\"" |
|
|
@ -160,11 +147,6 @@ OUT |
|
|
|
stub pyenv-exec "python -s */get-pip.py : true" |
|
|
|
stub curl true |
|
|
|
|
|
|
|
create_executable "3.2.1" "python" |
|
|
|
remove_executable "3.2.1" "virtualenv" |
|
|
|
remove_executable "3.2.1" "pyvenv" |
|
|
|
remove_executable "3.2.1" "conda" |
|
|
|
|
|
|
|
PIP_REQUIRE_VENV="true" run pyenv-virtualenv venv |
|
|
|
|
|
|
|
assert_success |
|
|
@ -178,4 +160,5 @@ OUT |
|
|
|
unstub_pyenv |
|
|
|
unstub pyenv-exec |
|
|
|
unstub curl |
|
|
|
teardown_version "3.2.1" |
|
|
|
} |