mirror of
https://github.com/pyenv/pyenv.git
synced 2025-12-06 18:08:37 +00:00
Some checks failed
macos_build / macos_build (3.10) (push) Has been cancelled
macos_build / macos_build (3.11) (push) Has been cancelled
macos_build / macos_build (3.12) (push) Has been cancelled
macos_build / macos_build (3.13) (push) Has been cancelled
macos_build / macos_build (3.9) (push) Has been cancelled
pyenv_tests / pyenv_tests (macos-13) (push) Has been cancelled
pyenv_tests / pyenv_tests (macos-14) (push) Has been cancelled
pyenv_tests / pyenv_tests (ubuntu-22.04) (push) Has been cancelled
pyenv_tests / pyenv_tests (ubuntu-24.04) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.10) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.11) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.12) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.13) (push) Has been cancelled
ubuntu_build / ubuntu_build (3.9) (push) Has been cancelled
- pip - pipX - pipX.Y - * -m pip Co-authored-by: Christian Fredrik Johnsen <christian@johnsen.no>
68 lines
1.6 KiB
Bash
Executable File
68 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bats
|
|
|
|
load test_helper
|
|
|
|
create_executable() {
|
|
local bin="${PYENV_ROOT}/versions/${PYENV_VERSION}/bin"
|
|
mkdir -p "$bin"
|
|
echo "#!/bin/sh" > "${bin}/$1"
|
|
chmod +x "${bin}/$1"
|
|
}
|
|
|
|
copy_src_pyenvd() {
|
|
mkdir -p "${PYENV_ROOT}"
|
|
cp -r "${BATS_TEST_DIRNAME}/../pyenv.d" "${PYENV_ROOT}"
|
|
}
|
|
|
|
@test "pip-rehash triggered when using 'pip'" {
|
|
export PYENV_VERSION="3.7.14"
|
|
create_executable "example"
|
|
create_executable "pip"
|
|
copy_src_pyenvd
|
|
run command -v example 2> /dev/null
|
|
assert_failure
|
|
run pyenv-exec pip install example
|
|
assert_success
|
|
run command -v example 2> /dev/null
|
|
assert_success
|
|
}
|
|
|
|
@test "pip-rehash triggered when using 'pip3'" {
|
|
export PYENV_VERSION="3.7.14"
|
|
create_executable "example"
|
|
create_executable "pip3"
|
|
copy_src_pyenvd
|
|
run command -v example 2> /dev/null
|
|
assert_failure
|
|
run pyenv-exec pip3 install example
|
|
assert_success
|
|
run command -v example 2> /dev/null
|
|
assert_success
|
|
}
|
|
|
|
@test "pip-rehash triggered when using 'pip3.x'" {
|
|
export PYENV_VERSION="3.7.14"
|
|
create_executable "example"
|
|
create_executable "pip3.7"
|
|
copy_src_pyenvd
|
|
run command -v example 2> /dev/null
|
|
assert_failure
|
|
run pyenv-exec pip3.7 install example
|
|
assert_success
|
|
run command -v example 2> /dev/null
|
|
assert_success
|
|
}
|
|
|
|
@test "pip-rehash triggered when using 'python -m pip install'" {
|
|
export PYENV_VERSION="3.7.14"
|
|
create_executable "example"
|
|
create_executable "python"
|
|
copy_src_pyenvd
|
|
run command -v example 2> /dev/null
|
|
assert_failure
|
|
run pyenv-exec python -m pip install example
|
|
assert_success
|
|
run command -v example 2> /dev/null
|
|
assert_success
|
|
}
|