File tree 4 files changed +30
-6
lines changed
4 files changed +30
-6
lines changed Original file line number Diff line number Diff line change @@ -605,7 +605,13 @@ STATUS=0
605
605
mkdir -p " ${PYENV_VIRTUALENV_CACHE_PATH} "
606
606
cd " ${PYENV_VIRTUALENV_CACHE_PATH} "
607
607
if [ -n " ${USE_CONDA} " ]; then
608
- pyenv-exec conda create $QUIET $VERBOSE --name " ${VIRTUALENV_PATH##*/ } " --yes " ${VIRTUALENV_OPTIONS[@]} " python || STATUS=" $? "
608
+ if [ -z " $VIRTUALENV_PYTHON " ]; then
609
+ # process substitution doesn't seem to work unless it's directly inserted to the command line
610
+ # if we add it to VIRTUALENV_OPTIONS instead, "broken pipe" happens
611
+ pyenv-exec conda create $QUIET $VERBOSE --name " ${VIRTUALENV_PATH##*/ } " --yes " ${VIRTUALENV_OPTIONS[@]} " --file <( pyenv-exec conda list python --full-name --export) || STATUS=" $? "
612
+ else
613
+ pyenv-exec conda create $QUIET $VERBOSE --name " ${VIRTUALENV_PATH##*/ } " --yes " ${VIRTUALENV_OPTIONS[@]} " || STATUS=" $? "
614
+ fi
609
615
else
610
616
if [ -n " ${USE_M_VENV} " ]; then
611
617
pyenv-exec " ${M_VENV_PYTHON_BIN:- python} " -m venv $QUIET $VERBOSE " ${VIRTUALENV_OPTIONS[@]} " " ${VIRTUALENV_PATH} " || STATUS=" $? "
Original file line number Diff line number Diff line change @@ -32,8 +32,8 @@ unstub_pyenv() {
32
32
run pyenv-virtualenv venv
33
33
34
34
assert_success
35
- assert_output << OUT
36
- PYENV_VERSION=miniconda3-3.16.0 conda create --name venv --yes python
35
+ assert_output_wildcards << OUT
36
+ PYENV_VERSION=miniconda3-3.16.0 conda create --name venv --yes --file /dev/fd/*
37
37
rehashed
38
38
OUT
39
39
56
56
57
57
assert_success
58
58
assert_output << OUT
59
- PYENV_VERSION=miniconda3-3.16.0 conda create --name venv --yes python=3.5 python
59
+ PYENV_VERSION=miniconda3-3.16.0 conda create --name venv --yes python=3.5
60
60
rehashed
61
61
OUT
62
62
79
79
80
80
assert_success
81
81
assert_output << OUT
82
- PYENV_VERSION=miniconda3-3.16.0 conda create --name venv --yes python=3.5 python
82
+ PYENV_VERSION=miniconda3-3.16.0 conda create --name venv --yes python=3.5
83
83
rehashed
84
84
OUT
85
85
Original file line number Diff line number Diff line change 1
- #! /usr/bin/env bats
1
+ #! /usr/bin/env bats
2
2
3
3
load test_helper
4
4
Original file line number Diff line number Diff line change @@ -83,6 +83,16 @@ assert_equal() {
83
83
fi
84
84
}
85
85
86
+ assert_equal_wildcards () {
87
+ if [[ $1 != $2 ]]; then
88
+ { echo " expected:"
89
+ echo " $2 "
90
+ echo " actual:"
91
+ echo " $1 "
92
+ } | flunk
93
+ fi
94
+ }
95
+
86
96
assert_output () {
87
97
local expected
88
98
if [ $# -eq 0 ]; then expected=" $( cat -) "
@@ -91,6 +101,14 @@ assert_output() {
91
101
assert_equal " $expected " " $output "
92
102
}
93
103
104
+ assert_output_wildcards () {
105
+ local expected
106
+ if [ $# -eq 0 ]; then expected=" $( cat -) "
107
+ else expected=" $1 "
108
+ fi
109
+ assert_equal_wildcards " $output " " $expected "
110
+ }
111
+
94
112
assert_output_contains () {
95
113
local expected=" $1 "
96
114
echo " $output " | grep -F " $expected " > /dev/null || {
You can’t perform that action at this time.
0 commit comments