Merged revisions 86596 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line
#9424: Replace deprecated assert* methods in the Python test suite.
........
diff --git a/Lib/test/string_tests.py b/Lib/test/string_tests.py
index eb5132e..546b486 100644
--- a/Lib/test/string_tests.py
+++ b/Lib/test/string_tests.py
@@ -62,7 +62,7 @@
pass
object = subtype(object)
realresult = getattr(object, methodname)(*args)
- self.assert_(object is not realresult)
+ self.assertTrue(object is not realresult)
# check that object.method(*args) raises exc
def checkraises(self, exc, object, methodname, *args):
@@ -1243,34 +1243,34 @@
pass
s1 = subclass("abcd")
s2 = t().join([s1])
- self.assert_(s1 is not s2)
- self.assert_(type(s2) is t)
+ self.assertTrue(s1 is not s2)
+ self.assertTrue(type(s2) is t)
s1 = t("abcd")
s2 = t().join([s1])
- self.assert_(s1 is s2)
+ self.assertTrue(s1 is s2)
# Should also test mixed-type join.
if t is unicode:
s1 = subclass("abcd")
s2 = "".join([s1])
- self.assert_(s1 is not s2)
- self.assert_(type(s2) is t)
+ self.assertTrue(s1 is not s2)
+ self.assertTrue(type(s2) is t)
s1 = t("abcd")
s2 = "".join([s1])
- self.assert_(s1 is s2)
+ self.assertTrue(s1 is s2)
elif t is str:
s1 = subclass("abcd")
s2 = u"".join([s1])
- self.assert_(s1 is not s2)
- self.assert_(type(s2) is unicode) # promotes!
+ self.assertTrue(s1 is not s2)
+ self.assertTrue(type(s2) is unicode) # promotes!
s1 = t("abcd")
s2 = u"".join([s1])
- self.assert_(s1 is not s2)
- self.assert_(type(s2) is unicode) # promotes!
+ self.assertTrue(s1 is not s2)
+ self.assertTrue(type(s2) is unicode) # promotes!
else:
self.fail("unexpected type for MixinStrUnicodeTest %r" % t)