Skip to content

Commit 927914b

Browse files
committed
Make sure pydoc executable exists after creating virtualenv
1 parent e339fde commit 927914b

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

test/pyvenv.bats

+11-5
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ unstub_pyenv() {
3232

3333
run pyenv-virtualenv venv
3434

35-
assert_success
3635
assert_output <<OUT
3736
PYENV_VERSION=3.5.1 python -m venv ${PYENV_ROOT}/versions/3.5.1/envs/venv
3837
rehashed
3938
OUT
39+
assert [ -x "${PYENV_ROOT}/versions/3.5.1/envs/venv/bin/pydoc" ]
40+
assert_success
4041

4142
unstub_pyenv
4243
unstub pyenv-virtualenv-prefix
@@ -57,19 +58,20 @@ OUT
5758

5859
run pyenv-virtualenv venv
5960

60-
assert_success
6161
assert_output <<OUT
6262
PYENV_VERSION=3.5.1 virtualenv ${PYENV_ROOT}/versions/3.5.1/envs/venv
6363
rehashed
6464
OUT
65+
assert [ -x "${PYENV_ROOT}/versions/3.5.1/envs/venv/bin/pydoc" ]
66+
assert_success
6567

6668
unstub_pyenv
6769
unstub pyenv-virtualenv-prefix
6870
unstub pyenv-exec
6971
teardown_m_venv "3.5.1"
7072
}
7173

72-
@test "install virtualenv if venv is not avaialble" {
74+
@test "install virtualenv if venv is not available" {
7375
export PYENV_VERSION="3.2.1"
7476
setup_version "3.2.1"
7577
stub_pyenv "${PYENV_VERSION}"
@@ -81,12 +83,13 @@ OUT
8183

8284
run pyenv-virtualenv venv
8385

84-
assert_success
8586
assert_output <<OUT
8687
PYENV_VERSION=3.2.1 pip install virtualenv==13.1.2
8788
PYENV_VERSION=3.2.1 virtualenv ${PYENV_ROOT}/versions/3.2.1/envs/venv
8889
rehashed
8990
OUT
91+
assert [ -x "${PYENV_ROOT}/versions/3.2.1/envs/venv/bin/pydoc" ]
92+
assert_success
9093

9194
unstub_pyenv
9295
unstub pyenv-virtualenv-prefix
@@ -112,6 +115,7 @@ PYENV_VERSION=3.5.1 pip install virtualenv
112115
PYENV_VERSION=3.5.1 virtualenv --python=${TMP}/python3 ${PYENV_ROOT}/versions/3.5.1/envs/venv
113116
rehashed
114117
OUT
118+
assert [ -x "${PYENV_ROOT}/versions/3.5.1/envs/venv/bin/pydoc" ]
115119
assert_success
116120

117121
unstub_pyenv
@@ -138,6 +142,7 @@ PYENV_VERSION=3.5.1 pip install virtualenv
138142
PYENV_VERSION=3.5.1 virtualenv --python=${TMP}/python3 ${PYENV_ROOT}/versions/3.5.1/envs/venv
139143
rehashed
140144
OUT
145+
assert [ -x "${PYENV_ROOT}/versions/3.5.1/envs/venv/bin/pydoc" ]
141146
assert_success
142147

143148
unstub_pyenv
@@ -158,12 +163,13 @@ OUT
158163

159164
PIP_REQUIRE_VENV="true" run pyenv-virtualenv venv
160165

161-
assert_success
162166
assert_output <<OUT
163167
PIP_REQUIRE_VENV= PYENV_VERSION=3.2.1 pip install virtualenv==13.1.2
164168
PIP_REQUIRE_VENV= PYENV_VERSION=3.2.1 virtualenv ${PYENV_ROOT}/versions/3.2.1/envs/venv
165169
rehashed
166170
OUT
171+
assert [ -x "${PYENV_ROOT}/versions/3.2.1/envs/venv/bin/pydoc" ]
172+
assert_success
167173

168174
unstub_pyenv
169175
unstub pyenv-virtualenv-prefix

test/virtualenv.bats

+8-3
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,13 @@ unstub_pyenv() {
3434

3535
run pyenv-virtualenv "2.7.11" "venv"
3636

37-
assert_success
3837
assert_output <<OUT
3938
PYENV_VERSION=2.7.11 virtualenv ${PYENV_ROOT}/versions/2.7.11/envs/venv
4039
Installing pip from https://bootstrap.pypa.io/get-pip.py...
4140
rehashed
4241
OUT
42+
assert [ -x "${PYENV_ROOT}/versions/2.7.11/envs/venv/bin/pydoc" ]
43+
assert_success
4344

4445
unstub_pyenv
4546
unstub pyenv-virtualenv-prefix
@@ -60,12 +61,13 @@ OUT
6061

6162
run pyenv-virtualenv venv
6263

63-
assert_success
6464
assert_output <<OUT
6565
PYENV_VERSION=2.7.11 virtualenv ${PYENV_ROOT}/versions/2.7.11/envs/venv
6666
Installing pip from https://bootstrap.pypa.io/get-pip.py...
6767
rehashed
6868
OUT
69+
assert [ -x "${PYENV_ROOT}/versions/2.7.11/envs/venv/bin/pydoc" ]
70+
assert_success
6971

7072
unstub_pyenv
7173
unstub pyenv-version-name
@@ -92,6 +94,7 @@ PYENV_VERSION=2.7.11 virtualenv --verbose --python=${TMP}/python ${PYENV_ROOT}/v
9294
Installing pip from https://bootstrap.pypa.io/get-pip.py...
9395
rehashed
9496
OUT
97+
assert [ -x "${PYENV_ROOT}/versions/2.7.11/envs/venv/bin/pydoc" ]
9598
assert_success
9699

97100
unstub_pyenv
@@ -119,6 +122,7 @@ PYENV_VERSION=2.7.11 virtualenv --verbose --python=${TMP}/python ${PYENV_ROOT}/v
119122
Installing pip from https://bootstrap.pypa.io/get-pip.py...
120123
rehashed
121124
OUT
125+
assert [ -x "${PYENV_ROOT}/versions/2.7.11/envs/venv/bin/pydoc" ]
122126
assert_success
123127

124128
unstub_pyenv
@@ -176,12 +180,13 @@ OUT
176180

177181
run pyenv-virtualenv "2.7.11" "2.7.11/envs/foo"
178182

179-
assert_success
180183
assert_output <<OUT
181184
PYENV_VERSION=2.7.11 virtualenv ${PYENV_ROOT}/versions/2.7.11/envs/foo
182185
Installing pip from https://bootstrap.pypa.io/get-pip.py...
183186
rehashed
184187
OUT
188+
assert [ -x "${PYENV_ROOT}/versions/2.7.11/envs/foo/bin/pydoc" ]
189+
assert_success
185190

186191
unstub_pyenv
187192
unstub pyenv-virtualenv-prefix

0 commit comments

Comments
 (0)