mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-11 04:53:53 -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.
|
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 _OLD_VIRTUAL_PS1="\${PS1}";
|
||||||
export PS1="(anaconda-2.3.0/envs/foo) \${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
|
EOS
|
||||||
|
|
||||||
unstub pyenv-version-name
|
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.
|
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 _OLD_VIRTUAL_PS1="\${PS1}";
|
||||||
export PS1="(miniconda-3.9.1/envs/bar) \${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
|
EOS
|
||||||
|
|
||||||
unstub pyenv-virtualenv-prefix
|
unstub pyenv-virtualenv-prefix
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ EOS
|
|||||||
|
|
||||||
assert_success
|
assert_success
|
||||||
assert_output <<EOS
|
assert_output <<EOS
|
||||||
|
. "${PYENV_ROOT}/versions/anaconda-2.3.0/envs/foo/etc/conda/deactivate.d/deactivate.sh";
|
||||||
unset PYENV_VIRTUAL_ENV;
|
unset PYENV_VIRTUAL_ENV;
|
||||||
unset VIRTUAL_ENV;
|
unset VIRTUAL_ENV;
|
||||||
unset CONDA_DEFAULT_ENV;
|
unset CONDA_DEFAULT_ENV;
|
||||||
|
|||||||
@@ -163,8 +163,11 @@ setup_conda() {
|
|||||||
create_executable "${conda}/envs/${env}" "activate"
|
create_executable "${conda}/envs/${env}" "activate"
|
||||||
remove_executable "${conda}/envs/${env}" "pyvenv"
|
remove_executable "${conda}/envs/${env}" "pyvenv"
|
||||||
create_executable "${conda}/envs/${env}" "conda"
|
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
|
done
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
teardown_conda() {
|
teardown_conda() {
|
||||||
|
|||||||
Reference in New Issue
Block a user