Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support python test without installation python package #3357

Merged
merged 12 commits into from
Aug 10, 2017

Conversation

jacquesqiao
Copy link
Member

@jacquesqiao jacquesqiao commented Aug 9, 2017

fix #3352
after make, can use

ctest -R test_add

to run python unit test is build dir without install the python package.

tested on all python unit test.

@@ -411,7 +411,7 @@ function(py_test TARGET_NAME)
set(multiValueArgs SRCS DEPS)
cmake_parse_arguments(py_test "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
add_test(NAME ${TARGET_NAME}
COMMAND env PYTHONPATH=${PADDLE_PYTHON_PACKAGE_DIR}
COMMAND env PYTHONPATH=${PADDLE_PYTHON_LIB_DIR}
Copy link
Contributor

@gangliao gangliao Aug 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test swig wrapper unit test??

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I have run all the python test and I don't think that copy all the generated files to python src dir is a good idea.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please pip uninstall paddlepaddle before you test this PR.

test 91
    Start 91: testGradientMachine

91: Test command: /usr/bin/env "PYTHONPATH=" "python2" "testGradientMachine.py"
91: Test timeout computed to be: 9.99988e+06
91: Traceback (most recent call last):
91:   File "testGradientMachine.py", line 15, in <module>
91:     from py_paddle import swig_paddle
91: ImportError: No module named py_paddle
1/1 Test #91: testGradientMachine ..............***Failed    0.03 sec

0% tests passed, 1 tests failed out of 1

test 90
    Start 90: testArguments

90: Test command: /usr/bin/env "PYTHONPATH=" "python2" "testArguments.py"
90: Test timeout computed to be: 9.99988e+06
90: Traceback (most recent call last):
90:   File "testArguments.py", line 15, in <module>
90:     from py_paddle import swig_paddle
90: ImportError: No module named py_paddle
1/1 Test #90: testArguments ....................***Failed    0.03 sec

Copy link
Contributor

@gangliao gangliao Aug 10, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy Python proto into paddle/v2/framework/protois necessary. because we import proto like import paddle.v2.framework.proto in our code.

Copy link
Collaborator

@wangkuiyi wangkuiyi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks to @jacquesqiao and @gangliao for this PR and #3360!

Copy link
Contributor

@gangliao gangliao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gangliao gangliao merged commit be473a6 into PaddlePaddle:develop Aug 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

make python test do not need to install python whl package
3 participants