@@ -22,11 +22,11 @@ setUp () {
22
22
}
23
23
24
24
test_virtualenvwrapper_initialize () {
25
- virtualenvwrapper_initialize
25
+ assertTrue " Initialized " virtualenvwrapper_initialize
26
26
for hook in premkvirtualenv postmkvirtualenv prermvirtualenv postrmvirtualenv preactivate postactivate predeactivate postdeactivate
27
27
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 ]"
30
30
done
31
31
assertTrue " Log file was not created" " [ -f $WORKON_HOME /hook.log ]"
32
32
export pre_test_dir=$( cd " $test_dir " ; pwd)
@@ -94,10 +94,17 @@ test_python_interpreter_set_incorrectly() {
94
94
cd " $WORKON_HOME "
95
95
mkvirtualenv --no-site-packages no_wrappers
96
96
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 ]"
101
108
assertFalse " Failed to detect invalid Python location" " VIRTUALENVWRAPPER_PYTHON=$VIRTUAL_ENV /bin/python $SHELL $return_to /virtualenvwrapper.sh >/dev/null 2>&1"
102
109
cd " $return_to "
103
110
deactivate
0 commit comments