mirror of
https://github.com/pyenv/pyenv.git
synced 2025-11-12 05:23:47 -05:00
Fix pyenv which to support auto-resolved prefixes (#2601)
* Resolve version name that hooks see * Avoid a 2nd iteration over configured versions
This commit is contained in:
@@ -136,3 +136,22 @@ SH
|
||||
PYENV_VERSION= run pyenv-which python
|
||||
assert_success "${PYENV_ROOT}/versions/3.4/bin/python"
|
||||
}
|
||||
|
||||
@test "resolves pyenv-latest prefixes" {
|
||||
create_executable "3.4.2" "python"
|
||||
|
||||
PYENV_VERSION=3.4 run pyenv-which python
|
||||
assert_success "${PYENV_ROOT}/versions/3.4.2/bin/python"
|
||||
}
|
||||
|
||||
@test "hooks get resolved version name" {
|
||||
create_hook which echo.bash <<!
|
||||
echo version=\$version
|
||||
exit
|
||||
!
|
||||
|
||||
create_executable "3.4.2" "python"
|
||||
|
||||
PYENV_VERSION=3.4 run pyenv-which python
|
||||
assert_success "version=3.4.2"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user