1
0
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:
native-api
2023-01-22 18:22:26 +03:00
committed by GitHub
parent f1a1f59c87
commit c20fc7bd6a
2 changed files with 31 additions and 11 deletions

View File

@@ -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"
}