From: Hirokazu Yamamoto Date: Sun, 19 Jul 2009 03:39:54 +0000 (+0000) Subject: assertRaises can't be used as a context manager in 2.6. X-Git-Tag: v2.6.3rc1~144 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8bb2d5d1c4342ea6d22c18a80e6f5ff225c90002;p=python assertRaises can't be used as a context manager in 2.6. --- diff --git a/Lib/test/test_warnings.py b/Lib/test/test_warnings.py index 1f5d05fb8a..71944cd153 100644 --- a/Lib/test/test_warnings.py +++ b/Lib/test/test_warnings.py @@ -347,8 +347,7 @@ class WarnTests(unittest.TestCase): return ("A bad formatted string %(err)" % {"err" : "there is no %(err)s"}) - with self.assertRaises(ValueError): - self.module.warn(BadStrWarning()) + self.assertRaises(ValueError, self.module.warn, BadStrWarning()) class CWarnTests(BaseTest, WarnTests):