mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-15 06:53:52 -05:00
Change prompt after activate (#52)
This commit is contained in:
@@ -5,6 +5,10 @@ load test_helper
|
||||
setup() {
|
||||
export HOME="${TMP}"
|
||||
export PYENV_ROOT="${TMP}/pyenv"
|
||||
unset PYTHONHOME
|
||||
unset PYENV_VIRTUALENV_DISABLE_PROMPT
|
||||
unset PYENV_VIRTUAL_ENV_DISABLE_PROMPT
|
||||
unset VIRTUAL_ENV_DISABLE_PROMPT
|
||||
}
|
||||
|
||||
@test "activate virtualenv from current version" {
|
||||
@@ -22,9 +26,13 @@ setup() {
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
false
|
||||
pyenv-virtualenv: activate venv
|
||||
unset PYENV_DEACTIVATE;
|
||||
export VIRTUAL_ENV="${PYENV_ROOT}/versions/venv";
|
||||
pyenv-virtualenv: prompt changing will be removed from future release. configure \`export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
|
||||
export _OLD_VIRTUAL_PS1="\${PS1}";
|
||||
export PS1="(venv) \${PS1}";
|
||||
EOS
|
||||
}
|
||||
|
||||
@@ -43,9 +51,13 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
false
|
||||
pyenv-virtualenv: activate venv
|
||||
unset PYENV_DEACTIVATE;
|
||||
export VIRTUAL_ENV="${PYENV_ROOT}/versions/venv";
|
||||
pyenv-virtualenv: prompt changing will be removed from future release. configure \`export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
|
||||
export _OLD_VIRTUAL_PS1="\${PS1}";
|
||||
export PS1="(venv) \${PS1}";
|
||||
EOS
|
||||
}
|
||||
|
||||
@@ -69,11 +81,15 @@ EOS
|
||||
|
||||
eval "\$(pyenv virtualenv-init -)"
|
||||
|
||||
false
|
||||
pyenv-virtualenv: activate venv
|
||||
export PYENV_VERSION="venv";
|
||||
export PYENV_ACTIVATE_SHELL=1;
|
||||
unset PYENV_DEACTIVATE;
|
||||
export VIRTUAL_ENV="${PYENV_ROOT}/versions/venv";
|
||||
pyenv-virtualenv: prompt changing will be removed from future release. configure \`export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
|
||||
export _OLD_VIRTUAL_PS1="\${PS1}";
|
||||
export PS1="(venv) \${PS1}";
|
||||
EOS
|
||||
}
|
||||
|
||||
@@ -92,9 +108,11 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
false
|
||||
pyenv-virtualenv: activate venv
|
||||
set -e PYENV_DEACTIVATE;
|
||||
setenv VIRTUAL_ENV "${PYENV_ROOT}/versions/venv";
|
||||
pyenv-virtualenv: prompt changing not work for fish.
|
||||
EOS
|
||||
}
|
||||
|
||||
@@ -118,11 +136,13 @@ EOS
|
||||
|
||||
status --is-interactive; and . (pyenv virtualenv-init -|psub)
|
||||
|
||||
false
|
||||
pyenv-virtualenv: activate venv
|
||||
setenv PYENV_VERSION "venv";
|
||||
setenv PYENV_ACTIVATE_SHELL 1;
|
||||
set -e PYENV_DEACTIVATE;
|
||||
setenv VIRTUAL_ENV "${PYENV_ROOT}/versions/venv";
|
||||
pyenv-virtualenv: prompt changing not work for fish.
|
||||
EOS
|
||||
}
|
||||
|
||||
@@ -139,11 +159,15 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
false
|
||||
pyenv-virtualenv: activate venv27
|
||||
export PYENV_VERSION="venv27";
|
||||
export PYENV_ACTIVATE_SHELL=1;
|
||||
unset PYENV_DEACTIVATE;
|
||||
export VIRTUAL_ENV="${PYENV_ROOT}/versions/venv27";
|
||||
pyenv-virtualenv: prompt changing will be removed from future release. configure \`export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
|
||||
export _OLD_VIRTUAL_PS1="\${PS1}";
|
||||
export PS1="(venv27) \${PS1}";
|
||||
EOS
|
||||
}
|
||||
|
||||
@@ -165,11 +189,15 @@ EOS
|
||||
|
||||
eval "\$(pyenv virtualenv-init -)"
|
||||
|
||||
false
|
||||
pyenv-virtualenv: activate venv27
|
||||
export PYENV_VERSION="venv27";
|
||||
export PYENV_ACTIVATE_SHELL=1;
|
||||
unset PYENV_DEACTIVATE;
|
||||
export VIRTUAL_ENV="${PYENV_ROOT}/versions/venv27";
|
||||
pyenv-virtualenv: prompt changing will be removed from future release. configure \`export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
|
||||
export _OLD_VIRTUAL_PS1="\${PS1}";
|
||||
export PS1="(venv27) \${PS1}";
|
||||
EOS
|
||||
}
|
||||
|
||||
@@ -186,11 +214,13 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
false
|
||||
pyenv-virtualenv: activate venv27
|
||||
setenv PYENV_VERSION "venv27";
|
||||
setenv PYENV_ACTIVATE_SHELL 1;
|
||||
set -e PYENV_DEACTIVATE;
|
||||
setenv VIRTUAL_ENV "${PYENV_ROOT}/versions/venv27";
|
||||
pyenv-virtualenv: prompt changing not work for fish.
|
||||
EOS
|
||||
}
|
||||
|
||||
@@ -212,20 +242,27 @@ EOS
|
||||
|
||||
status --is-interactive; and . (pyenv virtualenv-init -|psub)
|
||||
|
||||
false
|
||||
pyenv-virtualenv: activate venv27
|
||||
setenv PYENV_VERSION "venv27";
|
||||
setenv PYENV_ACTIVATE_SHELL 1;
|
||||
set -e PYENV_DEACTIVATE;
|
||||
setenv VIRTUAL_ENV "${PYENV_ROOT}/versions/venv27";
|
||||
pyenv-virtualenv: prompt changing not work for fish.
|
||||
EOS
|
||||
}
|
||||
|
||||
@test "unset invokes deactivate" {
|
||||
export VIRTUAL_ENV="${PYENV_ROOT}/versions/venv"
|
||||
export PYENV_ACTIVATE_SHELL=
|
||||
|
||||
run pyenv-sh-activate --unset
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
pyenv deactivate
|
||||
pyenv-virtualenv: deactivate venv
|
||||
export PYENV_DEACTIVATE="${PYENV_ROOT}/versions/venv";
|
||||
unset VIRTUAL_ENV;
|
||||
EOS
|
||||
}
|
||||
|
||||
@@ -315,11 +352,15 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
false
|
||||
pyenv-virtualenv: activate venv27
|
||||
export PYENV_VERSION="venv27:2.7.10";
|
||||
export PYENV_ACTIVATE_SHELL=1;
|
||||
unset PYENV_DEACTIVATE;
|
||||
export VIRTUAL_ENV="${PYENV_ROOT}/versions/venv27";
|
||||
pyenv-virtualenv: prompt changing will be removed from future release. configure \`export PYENV_VIRTUALENV_DISABLE_PROMPT=1' to simulate the behavior.
|
||||
export _OLD_VIRTUAL_PS1="\${PS1}";
|
||||
export PS1="(venv27) \${PS1}";
|
||||
EOS
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user