mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-16 07:13:53 -05:00
Improve pyenv version, if there is one missing
Display the other available ones still. Fixes https://github.com/yyuu/pyenv/issues/291
This commit is contained in:
@@ -52,6 +52,26 @@ setup() {
|
||||
assert_failure "pyenv: version \`1.2' is not installed"
|
||||
}
|
||||
|
||||
@test "one missing version (second missing)" {
|
||||
create_version "3.4.2"
|
||||
PYENV_VERSION="3.4.2:1.2" run pyenv-version-name
|
||||
assert_failure
|
||||
assert_output <<OUT
|
||||
pyenv: version \`1.2' is not installed
|
||||
3.4.2
|
||||
OUT
|
||||
}
|
||||
|
||||
@test "one missing version (first missing)" {
|
||||
create_version "3.4.2"
|
||||
PYENV_VERSION="1.2:3.4.2" run pyenv-version-name
|
||||
assert_failure
|
||||
assert_output <<OUT
|
||||
pyenv: version \`1.2' is not installed
|
||||
3.4.2
|
||||
OUT
|
||||
}
|
||||
|
||||
@test "version with prefix in name" {
|
||||
create_version "2.7.6"
|
||||
cat > ".python-version" <<<"python-2.7.6"
|
||||
|
||||
@@ -36,3 +36,24 @@ setup() {
|
||||
run pyenv-version
|
||||
assert_success "3.3.3 (set by ${PYENV_ROOT}/version)"
|
||||
}
|
||||
|
||||
@test "set by PYENV_VERSION, one missing" {
|
||||
create_version "3.3.3"
|
||||
PYENV_VERSION=3.3.3:1.2 run pyenv-version
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
pyenv: version \`1.2' is not installed
|
||||
3.3.3 (set by PYENV_VERSION environment variable)
|
||||
OUT
|
||||
}
|
||||
|
||||
@test "set by PYENV_VERSION, two missing" {
|
||||
create_version "3.3.3"
|
||||
PYENV_VERSION=3.4.2:3.3.3:1.2 run pyenv-version
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
pyenv: version \`3.4.2' is not installed
|
||||
pyenv: version \`1.2' is not installed
|
||||
3.3.3 (set by PYENV_VERSION environment variable)
|
||||
OUT
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user