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 ezio.melotti
Recipients daniel.wagner-hall, ezio.melotti, michael.foord, r.david.murray
Date 2012-09-04.13:14:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I missed the initial patch.  What I was thinking about was to use simply

with self.assertRaises(TypeError):

instead of:
+        ctx = self.assertRaises(TypeError)
+        with ctx:
+            self.assertRaises(1)
+        self.assertIsInstance(ctx.exception, TypeError)


+        try:
+            self.assertRaises(1)
+  "Expected TypeError")
+        except TypeError:
+            pass

Unless I'm missing something, all these should be equivalent.
You could even use assertRaisesRegex to check the error message if you think that's appropriate.
Date User Action Args
2012-09-04 13:14:54ezio.melottisetrecipients: + ezio.melotti, r.david.murray, michael.foord, daniel.wagner-hall
2012-09-04 13:14:54ezio.melottisetmessageid: <>
2012-09-04 13:14:54ezio.melottilinkissue15836 messages
2012-09-04 13:14:54ezio.melotticreate