Skip to content

Conversation

reyoung
Copy link
Collaborator

@reyoung reyoung commented Sep 26, 2017

Fix #4451

@reyoung reyoung requested review from JiayiFeng and QiJune September 26, 2017 17:11
class TestException(unittest.TestCase):
def test_exception(self):
self.assertRaises(core.EnforceNotMet,
lambda: core.__unittest_throw_exception__())
Copy link
Collaborator

@JiayiFeng JiayiFeng Sep 26, 2017

Choose a reason for hiding this comment

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

How could we get and check the error message? Use .message?
It will be better to add another unit test of the error message here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done.

namespace paddle {
namespace pybind {

extern void BindException(pybind11::module& m);
Copy link
Member

Choose a reason for hiding this comment

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

Is this extern required?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

extern is not necessary but useful for code reading.

Copy link
Member

Choose a reason for hiding this comment

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

ok~

Copy link
Collaborator

@JiayiFeng JiayiFeng left a comment

Choose a reason for hiding this comment

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

Great!

@reyoung reyoung merged commit d2edbe5 into PaddlePaddle:develop Sep 27, 2017
@reyoung reyoung deleted the feature/make_python_catch_enforce_not_met branch October 2, 2017 18:19
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.

3 participants