mirror of
https://github.com/python/cpython.git
synced 2025-10-06 15:11:58 +00:00
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. ........
This commit is contained in:
parent
b65b4937e2
commit
19f2aeba67
164 changed files with 2281 additions and 2279 deletions
|
@ -67,7 +67,7 @@ class BaseTest(unittest.TestCase):
|
|||
else:
|
||||
obj = subtype(obj)
|
||||
realresult = getattr(obj, methodname)(*args)
|
||||
self.assert_(obj is not realresult)
|
||||
self.assertIsNot(obj, realresult)
|
||||
|
||||
# check that obj.method(*args) raises exc
|
||||
def checkraises(self, exc, obj, methodname, *args):
|
||||
|
@ -1170,34 +1170,34 @@ class MixinStrUnicodeTest:
|
|||
pass
|
||||
s1 = subclass("abcd")
|
||||
s2 = t().join([s1])
|
||||
self.assert_(s1 is not s2)
|
||||
self.assert_(type(s2) is t)
|
||||
self.assertIsNot(s1, s2)
|
||||
self.assertIs(type(s2), t)
|
||||
|
||||
s1 = t("abcd")
|
||||
s2 = t().join([s1])
|
||||
self.assert_(s1 is s2)
|
||||
self.assertIs(s1, s2)
|
||||
|
||||
# Should also test mixed-type join.
|
||||
if t is str:
|
||||
s1 = subclass("abcd")
|
||||
s2 = "".join([s1])
|
||||
self.assert_(s1 is not s2)
|
||||
self.assert_(type(s2) is t)
|
||||
self.assertIsNot(s1, s2)
|
||||
self.assertIs(type(s2), t)
|
||||
|
||||
s1 = t("abcd")
|
||||
s2 = "".join([s1])
|
||||
self.assert_(s1 is s2)
|
||||
self.assertIs(s1, s2)
|
||||
|
||||
## elif t is str8:
|
||||
## s1 = subclass("abcd")
|
||||
## s2 = "".join([s1])
|
||||
## self.assert_(s1 is not s2)
|
||||
## self.assert_(type(s2) is str) # promotes!
|
||||
## self.assertIsNot(s1, s2)
|
||||
## self.assertIs(type(s2), str) # promotes!
|
||||
|
||||
## s1 = t("abcd")
|
||||
## s2 = "".join([s1])
|
||||
## self.assert_(s1 is not s2)
|
||||
## self.assert_(type(s2) is str) # promotes!
|
||||
## self.assertIsNot(s1, s2)
|
||||
## self.assertIs(type(s2), str) # promotes!
|
||||
|
||||
else:
|
||||
self.fail("unexpected type for MixinStrUnicodeTest %r" % t)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue