mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-13 22:13:52 -05:00
Treat all versions with activate script as a virtual environment
This commit is contained in:
@@ -14,28 +14,28 @@ setup() {
|
||||
|
||||
PYENV_VERSION="anaconda-2.3.0" run pyenv-virtualenv-prefix
|
||||
|
||||
unstub pyenv-version-name
|
||||
unstub pyenv-prefix
|
||||
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
${PYENV_ROOT}/versions/anaconda-2.3.0
|
||||
OUT
|
||||
|
||||
unstub pyenv-version-name
|
||||
unstub pyenv-prefix
|
||||
}
|
||||
|
||||
@test "display conda env" {
|
||||
create_conda "anaconda-2.3.0" "foo"
|
||||
|
||||
stub pyenv-version-name "echo anaconda-2.3.0/envs/foo"
|
||||
stub pyenv-prefix "anaconda-2.3.0 : echo \"${PYENV_ROOT}/versions/anaconda-2.3.0\""
|
||||
stub pyenv-prefix "anaconda-2.3.0/envs/foo : echo \"${PYENV_ROOT}/versions/anaconda-2.3.0/envs/foo\""
|
||||
|
||||
PYENV_VERSION="anaconda-2.3.0/envs/foo" run pyenv-virtualenv-prefix
|
||||
|
||||
unstub pyenv-version-name
|
||||
unstub pyenv-prefix
|
||||
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
${PYENV_ROOT}/versions/anaconda-2.3.0
|
||||
${PYENV_ROOT}/versions/anaconda-2.3.0/envs/foo
|
||||
OUT
|
||||
|
||||
unstub pyenv-version-name
|
||||
unstub pyenv-prefix
|
||||
}
|
||||
|
||||
@@ -12,66 +12,55 @@ setup() {
|
||||
|
||||
@test "list virtual environments only" {
|
||||
stub pyenv-version-name ": echo system"
|
||||
stub pyenv-versions "--bare : echo \"system\";echo \"2.7.6\";echo \"3.3.3\";echo \"venv27\";echo \"venv33\""
|
||||
stub pyenv-virtualenv-prefix "2.7.6 : false"
|
||||
stub pyenv-virtualenv-prefix "3.3.3 : false"
|
||||
stub pyenv-virtualenv-prefix "venv27 : echo \"${PYENV_ROOT}/versions/2.7.6\""
|
||||
stub pyenv-virtualenv-prefix "venv33 : echo \"${PYENV_ROOT}/versions/3.3.3\""
|
||||
stub pyenv-prefix "venv27 : echo \"${PYENV_ROOT}/versions/2.7.6\""
|
||||
stub pyenv-prefix "venv33 : echo \"${PYENV_ROOT}/versions/3.3.3\""
|
||||
|
||||
run pyenv-virtualenvs
|
||||
|
||||
unstub pyenv-version-name
|
||||
unstub pyenv-versions
|
||||
unstub pyenv-virtualenv-prefix
|
||||
unstub pyenv-prefix
|
||||
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
venv27 (created from ${PYENV_ROOT}/versions/2.7.6)
|
||||
venv33 (created from ${PYENV_ROOT}/versions/3.3.3)
|
||||
OUT
|
||||
|
||||
unstub pyenv-version-name
|
||||
unstub pyenv-virtualenv-prefix
|
||||
}
|
||||
|
||||
@test "list virtual environments with hit prefix" {
|
||||
stub pyenv-version-name ": echo venv33"
|
||||
stub pyenv-versions "--bare : echo \"system\";echo \"venv27\";echo \"venv33\""
|
||||
stub pyenv-virtualenv-prefix "2.7.6 : false"
|
||||
stub pyenv-virtualenv-prefix "3.3.3 : false"
|
||||
stub pyenv-virtualenv-prefix "venv27 : echo \"/usr\""
|
||||
stub pyenv-virtualenv-prefix "venv33 : echo \"/usr\""
|
||||
stub pyenv-prefix "venv27 : echo \"/usr\""
|
||||
stub pyenv-prefix "venv33 : echo \"/usr\""
|
||||
|
||||
run pyenv-virtualenvs
|
||||
|
||||
unstub pyenv-version-name
|
||||
unstub pyenv-versions
|
||||
unstub pyenv-virtualenv-prefix
|
||||
unstub pyenv-prefix
|
||||
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
venv27 (created from /usr)
|
||||
* venv33 (created from /usr)
|
||||
OUT
|
||||
|
||||
unstub pyenv-version-name
|
||||
unstub pyenv-virtualenv-prefix
|
||||
}
|
||||
|
||||
@test "list virtual environments with --bare" {
|
||||
stub pyenv-versions "--bare : echo \"system\";echo \"venv27\";echo \"venv33\""
|
||||
stub pyenv-virtualenv-prefix "2.7.6 : false"
|
||||
stub pyenv-virtualenv-prefix "3.3.3 : false"
|
||||
stub pyenv-virtualenv-prefix "venv27 : echo \"/usr\""
|
||||
stub pyenv-virtualenv-prefix "venv33 : echo \"/usr\""
|
||||
stub pyenv-prefix "venv27 : echo \"/usr\""
|
||||
stub pyenv-prefix "venv33 : echo \"/usr\""
|
||||
|
||||
run pyenv-virtualenvs --bare
|
||||
|
||||
unstub pyenv-versions
|
||||
unstub pyenv-virtualenv-prefix
|
||||
unstub pyenv-prefix
|
||||
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
venv27
|
||||
venv33
|
||||
OUT
|
||||
|
||||
unstub pyenv-virtualenv-prefix
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user