mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-12 13:33:52 -05:00
Fix pyenv-virtualenv using a different Python version in a conda environment (#492)
Allow output checking with wildcards
This commit is contained in:
@@ -32,8 +32,8 @@ unstub_pyenv() {
|
||||
run pyenv-virtualenv venv
|
||||
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
PYENV_VERSION=miniconda3-3.16.0 conda create --name venv --yes python
|
||||
assert_output_wildcards <<OUT
|
||||
PYENV_VERSION=miniconda3-3.16.0 conda create --name venv --yes --file /dev/fd/*
|
||||
rehashed
|
||||
OUT
|
||||
|
||||
@@ -56,7 +56,7 @@ OUT
|
||||
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
PYENV_VERSION=miniconda3-3.16.0 conda create --name venv --yes python=3.5 python
|
||||
PYENV_VERSION=miniconda3-3.16.0 conda create --name venv --yes python=3.5
|
||||
rehashed
|
||||
OUT
|
||||
|
||||
@@ -79,7 +79,7 @@ OUT
|
||||
|
||||
assert_success
|
||||
assert_output <<OUT
|
||||
PYENV_VERSION=miniconda3-3.16.0 conda create --name venv --yes python=3.5 python
|
||||
PYENV_VERSION=miniconda3-3.16.0 conda create --name venv --yes python=3.5
|
||||
rehashed
|
||||
OUT
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env bats
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load test_helper
|
||||
|
||||
|
||||
@@ -83,6 +83,16 @@ assert_equal() {
|
||||
fi
|
||||
}
|
||||
|
||||
assert_equal_wildcards() {
|
||||
if [[ $1 != $2 ]]; then
|
||||
{ echo "expected:"
|
||||
echo "$2"
|
||||
echo "actual:"
|
||||
echo "$1"
|
||||
} | flunk
|
||||
fi
|
||||
}
|
||||
|
||||
assert_output() {
|
||||
local expected
|
||||
if [ $# -eq 0 ]; then expected="$(cat -)"
|
||||
@@ -91,6 +101,14 @@ assert_output() {
|
||||
assert_equal "$expected" "$output"
|
||||
}
|
||||
|
||||
assert_output_wildcards() {
|
||||
local expected
|
||||
if [ $# -eq 0 ]; then expected="$(cat -)"
|
||||
else expected="$1"
|
||||
fi
|
||||
assert_equal_wildcards "$output" "$expected"
|
||||
}
|
||||
|
||||
assert_output_contains() {
|
||||
local expected="$1"
|
||||
echo "$output" | grep -F "$expected" >/dev/null || {
|
||||
|
||||
Reference in New Issue
Block a user