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 lregebro
Recipients Julian.Scheid, barry, georg.brandl, lregebro, ncoghlan, r.david.murray
Date 2010-04-15.11:06:49
SpamBayes Score 0.021194153
Marked as misclassified No
Message-id <1271329611.39.0.684241448462.issue7490@psf.upfronthosting.co.za>
In-reply-to
Content
Sure: Catch the exception in the test, and fail if it isn't catched.

>>> try:
...     do_something_that_raises_exception()
...     raise Assertionerror("Exception Blah was not raised")
... except Blah:
...     pass

Ugly, yes, but easy. To make it less ugly you can make a "assertRaises()" like the one that exists on standard unit tests and call that. Not so ugly.
History
Date User Action Args
2010-04-15 11:06:51lregebrosetrecipients: + lregebro, barry, georg.brandl, ncoghlan, r.david.murray, Julian.Scheid
2010-04-15 11:06:51lregebrosetmessageid: <1271329611.39.0.684241448462.issue7490@psf.upfronthosting.co.za>
2010-04-15 11:06:50lregebrolinkissue7490 messages
2010-04-15 11:06:50lregebrocreate