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 <>
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.
Date User Action Args
2008-11-27 09:50:00dleonard0setrecipients: + dleonard0
2008-11-27 09:50:00dleonard0setmessageid: <>
2008-11-27 09:49:59dleonard0linkissue4444 messages
2008-11-27 09:49:58dleonard0create