提交 71c77cbe 编写于 作者: X xuwei06

Use IPython 5.3 for unittest

上级 6a7feb35
......@@ -149,6 +149,7 @@ endfunction()
# Create a python unittest using run_python_tests.sh,
# which takes care of making correct running environment
function(add_python_test TEST_NAME)
message("PYTHON: ${PYTHON_EXECUTABLE}")
add_test(NAME ${TEST_NAME}
COMMAND bash ${PROJ_ROOT}/paddle/scripts/run_python_tests.sh
${USE_VIRTUALENV_FOR_TEST} ${PYTHON_EXECUTABLE} ${ARGN}
......
......@@ -20,6 +20,8 @@ popd > /dev/null
USE_VIRTUALENV_FOR_TEST=$1; shift
PYTHON=$1; shift
echo python: $PYTHON
pip list
if [ $USE_VIRTUALENV_FOR_TEST -ne 0 ]; then
rm -rf .test_env
......@@ -27,9 +29,22 @@ if [ $USE_VIRTUALENV_FOR_TEST -ne 0 ]; then
source .test_env/bin/activate
PYTHON=python
fi
$PYTHON -m pip install $SCRIPTPATH/../dist/*.whl requests matplotlib IPython
export PYTHONPATH=$SCRIPTPATH/../../python/
$PYTHON -m pip install $SCRIPTPATH/../dist/*.whl
# The next line is for debug, will be deleted
$PYTHON -m pip list
$PYTHON -m pip install requests matplotlib numpy ipython==5.3
$PYTHON -m pip list
echo $PYTHON
echo PYTHONPATH: $PYTHONPATH
python -c 'import pkgutil; print(str(list(pkgutil.iter_modules("/opt/python/2.7.12/lib/python2.7/site-packages"))))'
echo "========================="
python -c 'import numpy; import google; print(dir(google)); import google.protobuf; import pkgutil; print(str(list(pkgutil.iter_modules(google.protobuf.__path__)))); import google.protobuf.descriptor; '
echo $PYTHON
echo PYTHONPATH: $PYTHONPATH
$PYTHON -c 'import numpy; import google.protobuf.descriptor; print("debug---------------")'
export PYTHONPATH=$PYTHONPATH:$SCRIPTPATH/../../python/
$PYTHON -c 'import numpy; import google.protobuf.descriptor; print("debug---------------")'
for fn in "$@"
do
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册