Restore variables set by activate script of virtualenv properly (#150)

The `activate` script does't export the variables of `_OLD_VIRTUAL_*`,
most the deactivation code needed to be moved to `sh-deactivate`.
This commit is contained in:
Yamashita, Yuu
2015-11-12 13:45:33 +00:00
parent 47feedc934
commit 83bc6a49e4
4 changed files with 248 additions and 22 deletions

View File

@@ -263,13 +263,15 @@ EOS
export VIRTUAL_ENV="${PYENV_ROOT}/versions/venv"
export PYENV_ACTIVATE_SHELL=
stub pyenv-sh-deactivate "echo deactivated"
run pyenv-sh-activate --unset
unstub pyenv-sh-deactivate
assert_success
assert_output <<EOS
pyenv-virtualenv: deactivate venv
export PYENV_DEACTIVATE="${PYENV_ROOT}/versions/venv";
unset VIRTUAL_ENV;
deactivated
EOS
}