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 dleonard0
Recipients dleonard0
Date 2008-11-27.09:49:56
SpamBayes Score 0.00016865102
Marked as misclassified No
Message-id <1227779400.76.0.0502987149884.issue4444@psf.upfronthosting.co.za>
In-reply-to
Content
Patch to allow unit tests to test for exceptions through a 'with' 
statement. Resulting (failing) test would look like this:

  import unittest

  class T(unittest.TestCase):
     def runTest(self):
        with self.assertRaises(KeyError):
           raise ValueError

This saves having to put exception raising tests into a try/except 
block, which is cool. And by cool I mean totally sweet.
History
Date User Action Args
2008-11-27 09:50:00dleonard0setrecipients: + dleonard0
2008-11-27 09:50:00dleonard0setmessageid: <1227779400.76.0.0502987149884.issue4444@psf.upfronthosting.co.za>
2008-11-27 09:49:59dleonard0linkissue4444 messages
2008-11-27 09:49:58dleonard0create