From fa03780a37386e3fb102c9d25830cd890c5db96d Mon Sep 17 00:00:00 2001 From: Romwierz Date: Wed, 9 Sep 2026 12:17:54 +0200 Subject: [PATCH] tests: add 'fails on non-Linux system' --- test/exec.bats | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/exec.bats b/test/exec.bats index e603c3f8..209d9cf4 100644 --- a/test/exec.bats +++ b/test/exec.bats @@ -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 +}