This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author chris.jerdonek
Recipients benjamin.peterson, chris.jerdonek, ezio.melotti, inglesp, serhiy.storchaka
Date 2012-09-30.15:25:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1349018725.31.0.221940801894.issue16055@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2012-09-30 15:25:25chris.jerdoneksetrecipients: + chris.jerdonek, benjamin.peterson, ezio.melotti, inglesp, serhiy.storchaka
2012-09-30 15:25:25chris.jerdoneksetmessageid: <1349018725.31.0.221940801894.issue16055@psf.upfronthosting.co.za>
2012-09-30 15:25:25chris.jerdoneklinkissue16055 messages
2012-09-30 15:25:25chris.jerdonekcreate