assertRaises can't be used as a context manager in 2.6.

This commit is contained in:
Hirokazu Yamamoto 2009-07-19 03:39:54 +00:00
parent e38b0a8ec0
commit 8bb2d5d1c4
1 changed files with 1 additions and 2 deletions

View File

@ -347,8 +347,7 @@ class WarnTests(unittest.TestCase):
return ("A bad formatted string %(err)" % return ("A bad formatted string %(err)" %
{"err" : "there is no %(err)s"}) {"err" : "there is no %(err)s"})
with self.assertRaises(ValueError): self.assertRaises(ValueError, self.module.warn, BadStrWarning())
self.module.warn(BadStrWarning())
class CWarnTests(BaseTest, WarnTests): class CWarnTests(BaseTest, WarnTests):