[Python-Dev] unittest missing assertNotRaises

Wilfred Hughes wilfred at potatolondon.com
Tue Sep 27 20:46:52 CEST 2011


Hi folks

I wasn't sure if this warranted a bug in the tracker, so I thought I'd raise
it here first.

unittest has assertIn, assertNotIn, assertEqual, assertNotEqual and so on.
So, it seems odd to me that there isn't assertNotRaises. Is there any
particular motivation for not putting it in?

I've attached a simple patch against Python 3's trunk to give an idea of
what I have in mind.

Thanks
Wilfred
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20110927/8312b662/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: assert_not_raises.diff
Type: text/x-patch
Size: 925 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-dev/attachments/20110927/8312b662/attachment.bin>


More information about the Python-Dev mailing list