From 187156d600d32084e1204b82053228db93529431 Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Sat, 16 Jul 2016 06:31:30 +0000 Subject: [PATCH] Use `python -m venv` instead on `pyvenv` in tests --- bin/pyenv-virtualenv | 2 +- test/envs.bats | 5 +++-- test/pip.bats | 10 ++++++---- test/pyvenv.bats | 10 ++++++++-- test/test_helper.bash | 5 ----- test/version.bats | 4 +++- test/virtualenv.bats | 5 +++++ 7 files changed, 26 insertions(+), 15 deletions(-) diff --git a/bin/pyenv-virtualenv b/bin/pyenv-virtualenv index 3b2e34f..d0286b2 100755 --- a/bin/pyenv-virtualenv +++ b/bin/pyenv-virtualenv @@ -141,7 +141,7 @@ detect_venv() { if [ -x "${prefix}/bin/virtualenv" ]; then HAS_VIRTUALENV=1 fi - if "${prefix}/bin/python" -m venv --help 1>/dev/null 2>&1; then + if pyenv-exec python -m venv --help 1>/dev/null 2>&1; then HAS_PYVENV=1 fi fi diff --git a/test/envs.bats b/test/envs.bats index 57b6d94..3dcc703 100644 --- a/test/envs.bats +++ b/test/envs.bats @@ -25,14 +25,15 @@ unstub_pyenv() { stub pyenv-version-name "echo '${PYENV_VERSION}'" stub pyenv-prefix " : echo '${PYENV_ROOT}/versions/${PYENV_VERSION}'" stub pyenv-virtualenv-prefix " : false" - stub pyenv-exec "pyvenv * : echo PYENV_VERSION=\${PYENV_VERSION} \"\$@\";mkdir -p \${PYENV_ROOT}/versions/3.5.1/envs/venv/bin" + stub pyenv-exec "python -m venv --help : true" + stub pyenv-exec "python -m venv * : echo PYENV_VERSION=\${PYENV_VERSION} \"\$@\";mkdir -p \${PYENV_ROOT}/versions/3.5.1/envs/venv/bin" stub pyenv-exec "python -s -m ensurepip : echo PYENV_VERSION=\${PYENV_VERSION} \"\$@\";touch \${PYENV_ROOT}/versions/3.5.1/envs/venv/bin/pip" run pyenv-virtualenv venv assert_success assert_output <