mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-16 07:23:51 -05:00
Add --quiet option to activate and deactivate
This commit is contained in:
@@ -23,7 +23,23 @@ fi;
|
||||
EOS
|
||||
}
|
||||
|
||||
@test "deactivate virtualenv (without pyenv-virtualenv-init)" {
|
||||
@test "deactivate virtualenv (quiet)" {
|
||||
export PYENV_VIRTUALENV_INIT=1
|
||||
|
||||
PYENV_SHELL="bash" run pyenv-sh-deactivate --quiet
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
if declare -f deactivate 1>/dev/null 2>&1; then
|
||||
export PYENV_DEACTIVATE="\$VIRTUAL_ENV";
|
||||
deactivate;
|
||||
else
|
||||
false;
|
||||
fi;
|
||||
EOS
|
||||
}
|
||||
|
||||
@test "deactivate virtualenv (w/o pyenv-virtualenv-init)" {
|
||||
export PYENV_VIRTUALENV_INIT=
|
||||
|
||||
PYENV_SHELL="bash" run pyenv-sh-deactivate
|
||||
@@ -41,6 +57,23 @@ fi;
|
||||
EOS
|
||||
}
|
||||
|
||||
@test "deactivate virtualenv (w/o pyenv-virtualenv-init) (quiet)" {
|
||||
export PYENV_VIRTUALENV_INIT=
|
||||
|
||||
PYENV_SHELL="bash" run pyenv-sh-deactivate --quiet
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
if declare -f deactivate 1>/dev/null 2>&1; then
|
||||
pyenv shell --unset;
|
||||
export PYENV_DEACTIVATE="\$VIRTUAL_ENV";
|
||||
deactivate;
|
||||
else
|
||||
false;
|
||||
fi;
|
||||
EOS
|
||||
}
|
||||
|
||||
@test "deactivate virtualenv (fish)" {
|
||||
export PYENV_VIRTUALENV_INIT=1
|
||||
|
||||
@@ -58,7 +91,23 @@ end;
|
||||
EOS
|
||||
}
|
||||
|
||||
@test "deactivate virtualenv (fish) (without pyenv-virtualenv-init)" {
|
||||
@test "deactivate virtualenv (fish) (quiet)" {
|
||||
export PYENV_VIRTUALENV_INIT=1
|
||||
|
||||
PYENV_SHELL="fish" run pyenv-sh-deactivate --quiet
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
if functions -q deactivate
|
||||
setenv PYENV_DEACTIVATE "\$VIRTUAL_ENV";
|
||||
deactivate;
|
||||
else
|
||||
false;
|
||||
end;
|
||||
EOS
|
||||
}
|
||||
|
||||
@test "deactivate virtualenv (fish) (w/o pyenv-virtualenv-init)" {
|
||||
export PYENV_VIRTUALENV_INIT=
|
||||
|
||||
PYENV_SHELL="fish" run pyenv-sh-deactivate
|
||||
@@ -76,6 +125,22 @@ end;
|
||||
EOS
|
||||
}
|
||||
|
||||
@test "deactivate virtualenv (fish) (w/o pyenv-virtualenv-init) (quiet)" {
|
||||
export PYENV_VIRTUALENV_INIT=
|
||||
|
||||
PYENV_SHELL="fish" run pyenv-sh-deactivate --quiet
|
||||
|
||||
assert_success
|
||||
assert_output <<EOS
|
||||
if functions -q deactivate
|
||||
pyenv shell --unset;
|
||||
setenv PYENV_DEACTIVATE "\$VIRTUAL_ENV";
|
||||
deactivate;
|
||||
else
|
||||
false;
|
||||
end;
|
||||
EOS
|
||||
}
|
||||
@test "should fail if deactivate is invoked as a command" {
|
||||
run pyenv-deactivate
|
||||
|
||||
|
||||
Reference in New Issue
Block a user