mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Merge pull request #1984 from pyenv/revert-1907-install_no_blank
Revert "Drop inferring version to install from `pyenv local`"
This commit is contained in:
commit
bbcecc7561
2 changed files with 16 additions and 0 deletions
|
@ -115,7 +115,12 @@ done
|
||||||
|
|
||||||
unset VERSION_NAME
|
unset VERSION_NAME
|
||||||
|
|
||||||
|
# The first argument contains the definition to install. If the
|
||||||
|
# argument is missing, try to install whatever local app-specific
|
||||||
|
# version is specified by pyenv. Show usage instructions if a local
|
||||||
|
# version is not specified.
|
||||||
DEFINITION="${ARGUMENTS[0]}"
|
DEFINITION="${ARGUMENTS[0]}"
|
||||||
|
[ -n "$DEFINITION" ] || DEFINITION="$(pyenv-local 2>/dev/null || true)"
|
||||||
[ -n "$DEFINITION" ] || usage 1 >&2
|
[ -n "$DEFINITION" ] || usage 1 >&2
|
||||||
|
|
||||||
# Define `before_install` and `after_install` functions that allow
|
# Define `before_install` and `after_install` functions that allow
|
||||||
|
|
|
@ -23,6 +23,17 @@ stub_python_build() {
|
||||||
unstub pyenv-rehash
|
unstub pyenv-rehash
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "install pyenv local version by default" {
|
||||||
|
stub_python_build 'echo python-build "$1"'
|
||||||
|
stub pyenv-local 'echo 3.4.2'
|
||||||
|
|
||||||
|
run pyenv-install
|
||||||
|
assert_success "python-build 3.4.2"
|
||||||
|
|
||||||
|
unstub python-build
|
||||||
|
unstub pyenv-local
|
||||||
|
}
|
||||||
|
|
||||||
@test "list available versions" {
|
@test "list available versions" {
|
||||||
stub_python_build \
|
stub_python_build \
|
||||||
"--definitions : echo 2.6.9 2.7.9-rc1 2.7.9-rc2 3.4.2 | tr ' ' $'\\n'"
|
"--definitions : echo 2.6.9 2.7.9-rc1 2.7.9-rc2 3.4.2 | tr ' ' $'\\n'"
|
||||||
|
|
Loading…
Reference in a new issue