[Python-checkins] r74091 - python/branches/release26-maint/Lib/test/test_warnings.py

hirokazu.yamamoto python-checkins at python.org
Sun Jul 19 05:39:55 CEST 2009


Author: hirokazu.yamamoto
Date: Sun Jul 19 05:39:54 2009
New Revision: 74091

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

Modified:
   python/branches/release26-maint/Lib/test/test_warnings.py

Modified: python/branches/release26-maint/Lib/test/test_warnings.py
==============================================================================
--- python/branches/release26-maint/Lib/test/test_warnings.py	(original)
+++ python/branches/release26-maint/Lib/test/test_warnings.py	Sun Jul 19 05:39:54 2009
@@ -347,8 +347,7 @@
                 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):


More information about the Python-checkins mailing list