mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-14 14:23:53 -05:00
Merge pull request #290 from blueyed/version-handle-missing-better
Improve `pyenv version`, if there is one missing
This commit is contained in:
@@ -52,6 +52,39 @@ 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
|
||||
}
|
||||
|
||||
pyenv-version-name-without-stderr() {
|
||||
pyenv-version-name 2>/dev/null
|
||||
}
|
||||
|
||||
@test "one missing version (without stderr)" {
|
||||
create_version "3.4.2"
|
||||
PYENV_VERSION="1.2:3.4.2" run pyenv-version-name-without-stderr
|
||||
assert_failure
|
||||
assert_output <<OUT
|
||||
3.4.2
|
||||
OUT
|
||||
}
|
||||
|
||||
@test "version with prefix in name" {
|
||||
create_version "2.7.6"
|
||||
cat > ".python-version" <<<"python-2.7.6"
|
||||
|
||||
Reference in New Issue
Block a user