Message171645
A few comments on the patch:
1) You should also check the exception type (e.g. by using PyErr_ExceptionMatches()).
2) If the exception doesn't match, you should restore the original exception so that the pure Python test framework will in turn raise it and the caller can inspect it. Currently, the caller will find out only that it doesn't match but not why. Take a look at CHECK_INVALID() to see an example of this pattern being used.
3) I would expose the functionality that checks an exception's type and text as a helper function so that it can be used throughout _testcapimodule.c. The function is nontrivial enough that we wouldn't want to be copying and pasting it throughout if we want to check exception texts for other parts of the C API. |
|
Date |
User |
Action |
Args |
2012-09-30 15:25:25 | chris.jerdonek | set | recipients:
+ chris.jerdonek, benjamin.peterson, ezio.melotti, inglesp, serhiy.storchaka |
2012-09-30 15:25:25 | chris.jerdonek | set | messageid: <1349018725.31.0.221940801894.issue16055@psf.upfronthosting.co.za> |
2012-09-30 15:25:25 | chris.jerdonek | link | issue16055 messages |
2012-09-30 15:25:25 | chris.jerdonek | create | |
|