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 the.mulhern
Recipients the.mulhern
Date 2014-01-06.14:28:16
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
A normal thing for a developer to do is to convert a use of an assert* function to a use of an assert*Regex function and foolishly forget to actually specify the expected regular expression.

If they do this, the test will always pass because the callable expression will be in the place of the expected regular expression and the callable expression will, therefore, be None. It would be nice if in the constructor in AssertRaisesBaseContext (for 3.5) not only was the expected regex converted to a regex (if actually a string or bytes) but if it's not if it were checked if it were a valid regular expression object and an exception raised if this is not the case.

In the current version of AssertRaisesBaseContext.handle the comments say that if the callable object is None then the function is being used as a context manager. Not always the case, alas, perhaps the developer just forgot to add that necessary regular expression before the callable object.
Date User Action Args
2014-01-06 14:28:17the.mulhernsetrecipients: + the.mulhern
2014-01-06 14:28:17the.mulhernsetmessageid: <>
2014-01-06 14:28:17the.mulhernlinkissue20145 messages
2014-01-06 14:28:16the.mulherncreate