]> granicus.if.org Git - python/commitdiff
Change deprecated Exception.message to Exception.args-[0] where the use of
authorTerry Jan Reedy <tjreedy@udel.edu>
Mon, 13 Oct 2014 02:00:10 +0000 (22:00 -0400)
committerTerry Jan Reedy <tjreedy@udel.edu>
Mon, 13 Oct 2014 02:00:10 +0000 (22:00 -0400)
.message is not an essential part of the test.

Lib/test/string_tests.py
Lib/test/test_string.py
Lib/test/test_userstring.py

index 78181121228f0820c865c3315a62375a293dcb88..6d87eb695741287eec2854086a16f7a021592a21 100644 (file)
@@ -70,7 +70,7 @@ class CommonTest(unittest.TestCase):
         args = self.fixtype(args)
         with self.assertRaises(exc) as cm:
             getattr(obj, methodname)(*args)
-        self.assertNotEqual(cm.exception.message, '')
+        self.assertNotEqual(cm.exception.args[0], '')
 
     # call object.method(*args) without any checks
     def checkcall(self, object, methodname, *args):
index f69255bb3320f79d1ac889ab82b115e95b198678..e786ab6156e8e5e318f593de46f025b23ac729bd 100644 (file)
@@ -19,7 +19,7 @@ class StringTest(
     def checkraises(self, exc, obj, methodname, *args):
         with self.assertRaises(exc) as cm:
             getattr(string, methodname)(obj, *args)
-        self.assertNotEqual(cm.exception.message, '')
+        self.assertNotEqual(cm.exception.args[0], '')
 
     def checkcall(self, object, methodname, *args):
         getattr(string, methodname)(object, *args)
index 9cca14acfda8f1146f5a7f6731d2f289f0d7c5ab..c18ae54291f70a427a603119eb3845113a6489aa 100644 (file)
@@ -33,7 +33,7 @@ class UserStringTest(
         # we don't fix the arguments, because UserString can't cope with it
         with self.assertRaises(exc) as cm:
             getattr(obj, methodname)(*args)
-        self.assertNotEqual(cm.exception.message, '')
+        self.assertNotEqual(cm.exception.args[0], '')
 
     def checkcall(self, object, methodname, *args):
         object = self.fixtype(object)