Author dleonard0
Recipients dleonard0
Date 2008-11-27.09:49:56
SpamBayes Score 0.000168651
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