mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-10 20:43:55 -05:00
Add tests for conda's package activate/deactivate script
This commit is contained in:
@@ -126,6 +126,7 @@ export CONDA_DEFAULT_ENV="foo";
|
||||
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="(anaconda-2.3.0/envs/foo) \${PS1}";
|
||||
. "${PYENV_ROOT}/versions/anaconda-2.3.0/envs/foo/etc/conda/activate.d/activate.sh";
|
||||
EOS
|
||||
|
||||
unstub pyenv-version-name
|
||||
@@ -157,6 +158,7 @@ export CONDA_DEFAULT_ENV="bar";
|
||||
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="(miniconda-3.9.1/envs/bar) \${PS1}";
|
||||
. "${PYENV_ROOT}/versions/miniconda-3.9.1/envs/bar/etc/conda/activate.d/activate.sh";
|
||||
EOS
|
||||
|
||||
unstub pyenv-virtualenv-prefix
|
||||
|
||||
@@ -96,6 +96,7 @@ EOS
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
. "${PYENV_ROOT}/versions/anaconda-2.3.0/envs/foo/etc/conda/deactivate.d/deactivate.sh";
|
||||
unset PYENV_VIRTUAL_ENV;
|
||||
unset VIRTUAL_ENV;
|
||||
unset CONDA_DEFAULT_ENV;
|
||||
|
||||
@@ -163,8 +163,11 @@ setup_conda() {
|
||||
create_executable "${conda}/envs/${env}" "activate"
|
||||
remove_executable "${conda}/envs/${env}" "pyvenv"
|
||||
create_executable "${conda}/envs/${env}" "conda"
|
||||
mkdir -p "${PYENV_ROOT}/versions/${conda}/envs/${env}/etc/conda/activate.d"
|
||||
touch "${PYENV_ROOT}/versions/${conda}/envs/${env}/etc/conda/activate.d/activate.sh"
|
||||
mkdir -p "${PYENV_ROOT}/versions/${conda}/envs/${env}/etc/conda/deactivate.d"
|
||||
touch "${PYENV_ROOT}/versions/${conda}/envs/${env}/etc/conda/deactivate.d/deactivate.sh"
|
||||
done
|
||||
|
||||
}
|
||||
|
||||
teardown_conda() {
|
||||
|
||||
Reference in New Issue
Block a user