tests: add 'fails on non-Linux system'

This commit is contained in:
Romwierz 2026-09-09 12:17:54 +02:00
parent 3e0ed2d1a0
commit fa03780a37

View file

@ -140,3 +140,21 @@ $envvarname=/unusual/shim/location:/another/shim/location
_PYENV_SHIM_PATH=
!
}
@test "fails on non-Linux system" {
# Make sure to use the system version of Python
mkdir -p "$PYENV_TEST_DIR"
cd "$PYENV_TEST_DIR"
echo '' > .python-version
run uname -s
if [ "$output" != Linux ]; then
run pyenv-exec -N env
assert_failure
assert_output 'Error: the --environment option is supported only on Linux'
else
run pyenv-exec -N env
echo "$status"
assert_success
fi
}