Skip to content

Commit dc96568

Browse files
committed
merge in linux changes
2 parents 4090c2d + 1eed635 commit dc96568

File tree

3 files changed

+23
-14
lines changed

3 files changed

+23
-14
lines changed

.hgignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
syntax: glob
2+
*~
23
*.pyc
34
README.html
45
build

tests/run_tests

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,17 @@ unset VIRTUALENVWRAPPER_VIRTUALENV_ARGS
4444

4545
# Run the test scripts with a little formatting around them to make it
4646
# easier to find where each script output starts.
47-
for test_shell in bash ksh zsh
47+
for test_script in $scripts
4848
do
49-
test_shell_opts=
50-
if [ $test_shell = "zsh" ]; then
51-
test_shell_opts="-o shwordsplit"
52-
fi
53-
test_shell=$(which $test_shell)
5449

55-
for test_script in $scripts
50+
for test_shell in bash ksh zsh
5651
do
52+
test_shell_opts=
53+
if [ $test_shell = "zsh" ]; then
54+
test_shell_opts="-o shwordsplit"
55+
fi
56+
export test_shell=$(which $test_shell)
57+
5758
echo
5859
echo '********************************************************************************'
5960
echo "Running $test_script"

tests/test.sh

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ setUp () {
2222
}
2323

2424
test_virtualenvwrapper_initialize() {
25-
virtualenvwrapper_initialize
25+
assertTrue "Initialized" virtualenvwrapper_initialize
2626
for hook in premkvirtualenv postmkvirtualenv prermvirtualenv postrmvirtualenv preactivate postactivate predeactivate postdeactivate
2727
do
28-
assertTrue "Global $hook was not created" "[ -f $WORKON_HOME/$hook ]"
29-
assertTrue "Global $hook is not executable" "[ -x $WORKON_HOME/$hook ]"
28+
assertTrue "Global $WORKON_HOME/$hook was not created" "[ -f $WORKON_HOME/$hook ]"
29+
assertTrue "Global $WORKON_HOME/$hook is not executable" "[ -x $WORKON_HOME/$hook ]"
3030
done
3131
assertTrue "Log file was not created" "[ -f $WORKON_HOME/hook.log ]"
3232
export pre_test_dir=$(cd "$test_dir"; pwd)
@@ -94,10 +94,17 @@ test_python_interpreter_set_incorrectly() {
9494
cd "$WORKON_HOME"
9595
mkvirtualenv --no-site-packages no_wrappers
9696
expected="ImportError: No module named virtualenvwrapper.hook_loader"
97-
output=$(VIRTUALENVWRAPPER_PYTHON=$(which python) $SHELL $return_to/virtualenvwrapper.sh 2>&1)
98-
echo "$output" | grep -q "$expected" 2>&1
99-
found=$?
100-
assertTrue "Expected \"$expected\", got: \"$output\"" "[ $found -eq 0 ]"
97+
# test_shell is set by tests/run_tests
98+
if [ "$test_shell" = "" ]
99+
then
100+
export test_shell=$SHELL
101+
fi
102+
subshell_output=$(VIRTUALENVWRAPPER_PYTHON="$WORKON_HOME/no_wrappers/bin/python" $test_shell -x $return_to/virtualenvwrapper.sh 2>&1)
103+
echo "$subshell_output"
104+
echo "$subshell_output" | grep -q "$expected" 2>&1
105+
found_it=$?
106+
echo "$found_it"
107+
assertTrue "Expected \'$expected\', got: \'$subshell_output\'" "[ $found_it -eq 0 ]"
101108
assertFalse "Failed to detect invalid Python location" "VIRTUALENVWRAPPER_PYTHON=$VIRTUAL_ENV/bin/python $SHELL $return_to/virtualenvwrapper.sh >/dev/null 2>&1"
102109
cd "$return_to"
103110
deactivate

0 commit comments

Comments
 (0)