mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-17 16:03:42 -05:00
activate: look for a conda environment if given name is not a pyenv's prefix
This commit is contained in:
@@ -11,20 +11,22 @@ load test_helper
|
||||
|
||||
@test "detect parent shell from script (sh)" {
|
||||
unset PYENV_SHELL
|
||||
printf '#!/bin/sh\necho "$(pyenv-virtualenv-init -)"' > ${BATS_TEST_DIRNAME}/script.sh
|
||||
chmod +x ${BATS_TEST_DIRNAME}/script.sh
|
||||
run ${BATS_TEST_DIRNAME}/script.sh
|
||||
printf '#!/bin/sh\necho "$(pyenv-virtualenv-init -)"' > "${TMP}/script.sh"
|
||||
chmod +x ${TMP}/script.sh
|
||||
run ${TMP}/script.sh
|
||||
assert_success
|
||||
assert_output_contains_not ' PROMPT_COMMAND="_pyenv_virtualenv_hook;$PROMPT_COMMAND";'
|
||||
rm -f "${TMP}/script.sh"
|
||||
}
|
||||
|
||||
@test "detect parent shell from script (bash)" {
|
||||
unset PYENV_SHELL
|
||||
printf '#!/bin/bash\necho "$(pyenv-virtualenv-init -)"' > ${BATS_TEST_DIRNAME}/script.sh
|
||||
chmod +x ${BATS_TEST_DIRNAME}/script.sh
|
||||
run ${BATS_TEST_DIRNAME}/script.sh
|
||||
printf '#!/bin/bash\necho "$(pyenv-virtualenv-init -)"' > "${TMP}/script.sh"
|
||||
chmod +x ${TMP}/script.sh
|
||||
run ${TMP}/script.sh
|
||||
assert_success
|
||||
assert_output_contains ' PROMPT_COMMAND="_pyenv_virtualenv_hook;$PROMPT_COMMAND";'
|
||||
rm -f "${TMP}/script.sh"
|
||||
}
|
||||
|
||||
@test "sh-compatible instructions" {
|
||||
|
||||
Reference in New Issue
Block a user