Skip to content

Commit

Permalink
Fix tests failing after pyenv#423
Browse files Browse the repository at this point in the history
  • Loading branch information
ackalker committed Jan 29, 2022
1 parent 8f721ac commit bc4c73a
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 49 deletions.
28 changes: 14 additions & 14 deletions test/activate.bats
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ deactivated
export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/venv";
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}";
export _OLD_VIRTUAL_PS1="\${PS1:-}";
export PS1="(venv) \${PS1:-}";
EOS

unstub pyenv-version-name
Expand All @@ -59,8 +59,8 @@ EOS
deactivated
export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/venv";
export VIRTUAL_ENV="${PYENV_ROOT}/versions/venv";
export _OLD_VIRTUAL_PS1="\${PS1}";
export PS1="(venv) \${PS1}";
export _OLD_VIRTUAL_PS1="\${PS1:-}";
export PS1="(venv) \${PS1:-}";
EOS

unstub pyenv-version-name
Expand All @@ -87,8 +87,8 @@ pyenv-virtualenv: activate venv
export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/venv";
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}";
export _OLD_VIRTUAL_PS1="\${PS1:-}";
export PS1="(venv) \${PS1:-}";
EOS

unstub pyenv-version-name
Expand All @@ -115,8 +115,8 @@ export PYENV_ACTIVATE_SHELL=1;
export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/venv";
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}";
export _OLD_VIRTUAL_PS1="\${PS1:-}";
export PS1="(venv) \${PS1:-}";
EOS

unstub pyenv-version-name
Expand Down Expand Up @@ -192,8 +192,8 @@ export PYENV_ACTIVATE_SHELL=1;
export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/venv27";
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}";
export _OLD_VIRTUAL_PS1="\${PS1:-}";
export PS1="(venv27) \${PS1:-}";
EOS

unstub pyenv-virtualenv-prefix
Expand All @@ -218,8 +218,8 @@ export PYENV_ACTIVATE_SHELL=1;
export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/venv27";
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}";
export _OLD_VIRTUAL_PS1="\${PS1:-}";
export PS1="(venv27) \${PS1:-}";
EOS

unstub pyenv-virtualenv-prefix
Expand Down Expand Up @@ -391,8 +391,8 @@ export PYENV_ACTIVATE_SHELL=1;
export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/venv27";
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}";
export _OLD_VIRTUAL_PS1="\${PS1:-}";
export PS1="(venv27) \${PS1:-}";
EOS

unstub pyenv-sh-deactivate
Expand Down
16 changes: 8 additions & 8 deletions test/conda-activate.bats
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/anaconda-2.3.0";
export VIRTUAL_ENV="${PYENV_ROOT}/versions/anaconda-2.3.0";
export CONDA_DEFAULT_ENV="root";
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) \${PS1}";
export _OLD_VIRTUAL_PS1="\${PS1:-}";
export PS1="(anaconda-2.3.0) \${PS1:-}";
export CONDA_PREFIX="${TMP}/pyenv/versions/anaconda-2.3.0";
EOS

Expand Down Expand Up @@ -96,8 +96,8 @@ export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/miniconda-3.9.1";
export VIRTUAL_ENV="${PYENV_ROOT}/versions/miniconda-3.9.1";
export CONDA_DEFAULT_ENV="root";
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) \${PS1}";
export _OLD_VIRTUAL_PS1="\${PS1:-}";
export PS1="(miniconda-3.9.1) \${PS1:-}";
export CONDA_PREFIX="${TMP}/pyenv/versions/miniconda-3.9.1";
EOS

Expand Down Expand Up @@ -126,8 +126,8 @@ export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/anaconda-2.3.0/envs/foo";
export VIRTUAL_ENV="${PYENV_ROOT}/versions/anaconda-2.3.0/envs/foo";
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}";
export _OLD_VIRTUAL_PS1="\${PS1:-}";
export PS1="(anaconda-2.3.0/envs/foo) \${PS1:-}";
export CONDA_PREFIX="${TMP}/pyenv/versions/anaconda-2.3.0/envs/foo";
. "${PYENV_ROOT}/versions/anaconda-2.3.0/envs/foo/etc/conda/activate.d/activate.sh";
EOS
Expand Down Expand Up @@ -159,8 +159,8 @@ export PYENV_VIRTUAL_ENV="${PYENV_ROOT}/versions/miniconda-3.9.1/envs/bar";
export VIRTUAL_ENV="${PYENV_ROOT}/versions/miniconda-3.9.1/envs/bar";
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}";
export _OLD_VIRTUAL_PS1="\${PS1:-}";
export PS1="(miniconda-3.9.1/envs/bar) \${PS1:-}";
export CONDA_PREFIX="${TMP}/pyenv/versions/miniconda-3.9.1/envs/bar";
. "${PYENV_ROOT}/versions/miniconda-3.9.1/envs/bar/etc/conda/activate.d/activate.sh";
EOS
Expand Down
12 changes: 6 additions & 6 deletions test/conda-deactivate.bats
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ unset CONDA_PREFIX
unset PYENV_VIRTUAL_ENV;
unset VIRTUAL_ENV;
unset CONDA_DEFAULT_ENV;
if [ -n "\${_OLD_VIRTUAL_PATH}" ]; then
if [ -n "\${_OLD_VIRTUAL_PATH:-}" ]; then
export PATH="\${_OLD_VIRTUAL_PATH}";
unset _OLD_VIRTUAL_PATH;
fi;
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME}" ]; then
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME:-}" ]; then
export PYTHONHOME="\${_OLD_VIRTUAL_PYTHONHOME}";
unset _OLD_VIRTUAL_PYTHONHOME;
fi;
if [ -n "\${_OLD_VIRTUAL_PS1}" ]; then
if [ -n "\${_OLD_VIRTUAL_PS1:-}" ]; then
export PS1="\${_OLD_VIRTUAL_PS1}";
unset _OLD_VIRTUAL_PS1;
fi;
Expand Down Expand Up @@ -102,15 +102,15 @@ unset CONDA_PREFIX
unset PYENV_VIRTUAL_ENV;
unset VIRTUAL_ENV;
unset CONDA_DEFAULT_ENV;
if [ -n "\${_OLD_VIRTUAL_PATH}" ]; then
if [ -n "\${_OLD_VIRTUAL_PATH:-}" ]; then
export PATH="\${_OLD_VIRTUAL_PATH}";
unset _OLD_VIRTUAL_PATH;
fi;
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME}" ]; then
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME:-}" ]; then
export PYTHONHOME="\${_OLD_VIRTUAL_PYTHONHOME}";
unset _OLD_VIRTUAL_PYTHONHOME;
fi;
if [ -n "\${_OLD_VIRTUAL_PS1}" ]; then
if [ -n "\${_OLD_VIRTUAL_PS1:-}" ]; then
export PS1="\${_OLD_VIRTUAL_PS1}";
unset _OLD_VIRTUAL_PS1;
fi;
Expand Down
42 changes: 21 additions & 21 deletions test/deactivate.bats
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ setup() {
assert_output <<EOS
unset PYENV_VIRTUAL_ENV;
unset VIRTUAL_ENV;
if [ -n "\${_OLD_VIRTUAL_PATH}" ]; then
if [ -n "\${_OLD_VIRTUAL_PATH:-}" ]; then
export PATH="\${_OLD_VIRTUAL_PATH}";
unset _OLD_VIRTUAL_PATH;
fi;
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME}" ]; then
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME:-}" ]; then
export PYTHONHOME="\${_OLD_VIRTUAL_PYTHONHOME}";
unset _OLD_VIRTUAL_PYTHONHOME;
fi;
if [ -n "\${_OLD_VIRTUAL_PS1}" ]; then
if [ -n "\${_OLD_VIRTUAL_PS1:-}" ]; then
export PS1="\${_OLD_VIRTUAL_PS1}";
unset _OLD_VIRTUAL_PS1;
fi;
Expand All @@ -60,15 +60,15 @@ EOS
assert_output <<EOS
unset PYENV_VIRTUAL_ENV;
unset VIRTUAL_ENV;
if [ -n "\${_OLD_VIRTUAL_PATH}" ]; then
if [ -n "\${_OLD_VIRTUAL_PATH:-}" ]; then
export PATH="\${_OLD_VIRTUAL_PATH}";
unset _OLD_VIRTUAL_PATH;
fi;
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME}" ]; then
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME:-}" ]; then
export PYTHONHOME="\${_OLD_VIRTUAL_PYTHONHOME}";
unset _OLD_VIRTUAL_PYTHONHOME;
fi;
if [ -n "\${_OLD_VIRTUAL_PS1}" ]; then
if [ -n "\${_OLD_VIRTUAL_PS1:-}" ]; then
export PS1="\${_OLD_VIRTUAL_PS1}";
unset _OLD_VIRTUAL_PS1;
fi;
Expand All @@ -92,15 +92,15 @@ EOS
pyenv-virtualenv: deactivate venv
unset PYENV_VIRTUAL_ENV;
unset VIRTUAL_ENV;
if [ -n "\${_OLD_VIRTUAL_PATH}" ]; then
if [ -n "\${_OLD_VIRTUAL_PATH:-}" ]; then
export PATH="\${_OLD_VIRTUAL_PATH}";
unset _OLD_VIRTUAL_PATH;
fi;
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME}" ]; then
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME:-}" ]; then
export PYTHONHOME="\${_OLD_VIRTUAL_PYTHONHOME}";
unset _OLD_VIRTUAL_PYTHONHOME;
fi;
if [ -n "\${_OLD_VIRTUAL_PS1}" ]; then
if [ -n "\${_OLD_VIRTUAL_PS1:-}" ]; then
export PS1="\${_OLD_VIRTUAL_PS1}";
unset _OLD_VIRTUAL_PS1;
fi;
Expand All @@ -122,15 +122,15 @@ EOS
assert_output <<EOS
unset PYENV_VIRTUAL_ENV;
unset VIRTUAL_ENV;
if [ -n "\${_OLD_VIRTUAL_PATH}" ]; then
if [ -n "\${_OLD_VIRTUAL_PATH:-}" ]; then
export PATH="\${_OLD_VIRTUAL_PATH}";
unset _OLD_VIRTUAL_PATH;
fi;
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME}" ]; then
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME:-}" ]; then
export PYTHONHOME="\${_OLD_VIRTUAL_PYTHONHOME}";
unset _OLD_VIRTUAL_PYTHONHOME;
fi;
if [ -n "\${_OLD_VIRTUAL_PS1}" ]; then
if [ -n "\${_OLD_VIRTUAL_PS1:-}" ]; then
export PS1="\${_OLD_VIRTUAL_PS1}";
unset _OLD_VIRTUAL_PS1;
fi;
Expand All @@ -154,15 +154,15 @@ unset PYENV_VERSION;
unset PYENV_ACTIVATE_SHELL;
unset PYENV_VIRTUAL_ENV;
unset VIRTUAL_ENV;
if [ -n "\${_OLD_VIRTUAL_PATH}" ]; then
if [ -n "\${_OLD_VIRTUAL_PATH:-}" ]; then
export PATH="\${_OLD_VIRTUAL_PATH}";
unset _OLD_VIRTUAL_PATH;
fi;
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME}" ]; then
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME:-}" ]; then
export PYTHONHOME="\${_OLD_VIRTUAL_PYTHONHOME}";
unset _OLD_VIRTUAL_PYTHONHOME;
fi;
if [ -n "\${_OLD_VIRTUAL_PS1}" ]; then
if [ -n "\${_OLD_VIRTUAL_PS1:-}" ]; then
export PS1="\${_OLD_VIRTUAL_PS1}";
unset _OLD_VIRTUAL_PS1;
fi;
Expand All @@ -186,15 +186,15 @@ unset PYENV_VERSION;
unset PYENV_ACTIVATE_SHELL;
unset PYENV_VIRTUAL_ENV;
unset VIRTUAL_ENV;
if [ -n "\${_OLD_VIRTUAL_PATH}" ]; then
if [ -n "\${_OLD_VIRTUAL_PATH:-}" ]; then
export PATH="\${_OLD_VIRTUAL_PATH}";
unset _OLD_VIRTUAL_PATH;
fi;
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME}" ]; then
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME:-}" ]; then
export PYTHONHOME="\${_OLD_VIRTUAL_PYTHONHOME}";
unset _OLD_VIRTUAL_PYTHONHOME;
fi;
if [ -n "\${_OLD_VIRTUAL_PS1}" ]; then
if [ -n "\${_OLD_VIRTUAL_PS1:-}" ]; then
export PS1="\${_OLD_VIRTUAL_PS1}";
unset _OLD_VIRTUAL_PS1;
fi;
Expand All @@ -216,15 +216,15 @@ EOS
assert_output <<EOS
unset PYENV_VIRTUAL_ENV;
unset VIRTUAL_ENV;
if [ -n "\${_OLD_VIRTUAL_PATH}" ]; then
if [ -n "\${_OLD_VIRTUAL_PATH:-}" ]; then
export PATH="\${_OLD_VIRTUAL_PATH}";
unset _OLD_VIRTUAL_PATH;
fi;
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME}" ]; then
if [ -n "\${_OLD_VIRTUAL_PYTHONHOME:-}" ]; then
export PYTHONHOME="\${_OLD_VIRTUAL_PYTHONHOME}";
unset _OLD_VIRTUAL_PYTHONHOME;
fi;
if [ -n "\${_OLD_VIRTUAL_PS1}" ]; then
if [ -n "\${_OLD_VIRTUAL_PS1:-}" ]; then
export PS1="\${_OLD_VIRTUAL_PS1}";
unset _OLD_VIRTUAL_PS1;
fi;
Expand Down

0 comments on commit bc4c73a

Please sign in to comment.