Skip to content

Commit 7a4a540

Browse files
committed
Modified the test runner to reliably use the intended shells.
1 parent 0d2ea2e commit 7a4a540

File tree

2 files changed

+24
-23
lines changed

2 files changed

+24
-23
lines changed

tests/run_tests

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -30,27 +30,31 @@ export HOOK_VERBOSE_OPTION=-vvv
3030
# tox-created virtualenv.
3131
export VIRTUALENVWRAPPER_PYTHON="$envdir/bin/python"
3232

33-
if [ -n "${ZSH_VERSION:-}" ]
34-
then
35-
export SHELL=$(which zsh)
36-
fi
37-
3833
# Run the test scripts with a little formatting around them to make it
3934
# easier to find where each script output starts.
40-
for test_script in $scripts
35+
for test_shell in bash ksh zsh
4136
do
42-
echo
43-
echo '********************************************************************************'
44-
echo "Running $test_script"
45-
echo " VIRTUAL_ENV=$VIRTUAL_ENV"
46-
echo " VIRTUALENVWRAPPER_PYTHON=$VIRTUALENVWRAPPER_PYTHON"
47-
echo " $($VIRTUALENVWRAPPER_PYTHON -V 2>&1)"
48-
echo " PYTHONPATH=$PYTHONPATH"
49-
echo " SHELL=$SHELL"
50-
echo
51-
export SHUNIT_PARENT="$test_script"
52-
$test_script || exit 1
53-
echo
37+
test_shell_opts=
38+
if [ $test_shell = "zsh" ]; then
39+
test_shell_opts="-o shwordsplit"
40+
fi
41+
test_shell=$(which $test_shell)
42+
43+
for test_script in $scripts
44+
do
45+
echo
46+
echo '********************************************************************************'
47+
echo "Running $test_script"
48+
echo " VIRTUAL_ENV=$VIRTUAL_ENV"
49+
echo " VIRTUALENVWRAPPER_PYTHON=$VIRTUALENVWRAPPER_PYTHON"
50+
echo " $($VIRTUALENVWRAPPER_PYTHON -V 2>&1)"
51+
echo " PYTHONPATH=$PYTHONPATH"
52+
echo " SHELL=$test_shell"
53+
echo
54+
export SHUNIT_PARENT="$test_script"
55+
$test_shell $test_shell_opts $test_script || exit 1
56+
echo
57+
done
5458
done
5559

5660
exit 0

tox.ini

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22
envlist = py27,py26,py25,py24
33

44
[testenv]
5-
commands =
6-
zsh -o shwordsplit ./tests/run_tests {envdir} []
7-
ksh ./tests/run_tests {envdir} []
8-
bash ./tests/run_tests {envdir} []
5+
commands = bash ./tests/run_tests {envdir} []
96

107
# Not sure why this is needed, but on my system if it isn't included then
118
# the python version picked up for 2.6 is actually 2.7.
129
# IF THIS CAUSES YOU A PROBLEM COMMENT IT OUT BEFORE RUNNING THE TESTS.
1310
[testenv:py26]
14-
basepython=/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
11+
basepython=/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6

0 commit comments

Comments
 (0)