mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2026-09-10 07:16:18 -04:00
* With 160 envs, cuts time from ~14s to ~2.5s * Change the output to be more like `pyenv-versions' * Shellcheck fixes * virtualenv: Only show non-envs for completion since env engines don't support piggy-backing envs * Remove dead/unused code * Fix IFS handling `IFS=: <command>' doesn't apply that IFS to expansions in <command>, it has to be set separately earlier * Adjust and refactor tests --------- Co-authored-by: Ivan Pozdeev <vano@mail.mipt.ru>
38 lines
760 B
Bash
38 lines
760 B
Bash
#!/usr/bin/env bats
|
|
|
|
load test_helper
|
|
|
|
setup() {
|
|
export PYENV_ROOT="${TMP}/pyenv"
|
|
}
|
|
|
|
@test "display conda root" {
|
|
setup_conda "anaconda-2.3.0"
|
|
stub pyenv-version-name "echo anaconda-2.3.0"
|
|
|
|
PYENV_VERSION="anaconda-2.3.0" run pyenv-virtualenv-prefix
|
|
|
|
assert_success
|
|
assert_output <<OUT
|
|
${PYENV_ROOT}/versions/anaconda-2.3.0
|
|
OUT
|
|
|
|
unstub pyenv-version-name
|
|
teardown_conda "anaconda-2.3.0"
|
|
}
|
|
|
|
@test "display conda env" {
|
|
setup_conda "anaconda-2.3.0" "foo"
|
|
stub pyenv-version-name "echo anaconda-2.3.0/envs/foo"
|
|
|
|
PYENV_VERSION="anaconda-2.3.0/envs/foo" run pyenv-virtualenv-prefix
|
|
|
|
assert_success
|
|
assert_output <<OUT
|
|
${PYENV_ROOT}/versions/anaconda-2.3.0/envs/foo
|
|
OUT
|
|
|
|
unstub pyenv-version-name
|
|
teardown_conda "anaconda-2.3.0" "foo"
|
|
}
|